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

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

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

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel