Question

Accessing and using Kafka SSL certificate on App Platform

Hi, We added a managed Kafka on the Databases section. The SSL certificates are available on that Kafka instance. We planned to have a worker that will be deployed on an App Platform. The Kafka config on our worker requires to have the certificate file on disk. I have two questions. First is the Kafka certificate provisionned for all App Platforms instance and how do we access it from an App Platform environment variables (Something like KAFKA_CERTICATE={kafka.CA_ERT}?)? Because its not possible to push a certificate on disk on an App Platform, what will be the workaround?


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
July 5, 2024

Hi there,

In order for the certificate, and all other Kafka details, to be available as env variables to your app, you need to make sure that you’ve added the Kafka cluster as a component to your App Platform first.

You can now add existing Kafka databases to App Platform apps but keep in mind that this feature is in beta.

Once you’ve followed the steps above the App Platform will provide the bindable environment variables that automatically provide connection details for your Kafka database.

To integrate an existing Kafka database, follow the steps to add the database to your app, then add the following environment variable key value pairs to your app, replacing your-kafka-instance-name with your database cluster’s name:

Example Key Value Format Description
KAFKA_BROKER ${your-kafka-instance-name.HOSTNAME}:${your-kafka-instance-name.PORT} The hostname and port of the database’s Kafka brokers
KAFKA_USERNAME ${your-kafka-instance-name.USERNAME} The username for authenticating with the Kafka database
KAFKA_PASSWORD ${your-kafka-instance-name.PASSWORD} The password for authenticating with the Kafka database
KAFKA_CA_CERT ${your-kafka-instance-name.CA_CERT} The CA certificate for TLS authentication with the Kafka database

Let me know how this goes!

- Bobby

Hey PapaSougouWele,

App Platform doesn’t manage certificates directly, but there are workarounds! For Kafka with App Platform, consider using a Secret Manager or mounting a volume with the certificate.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.