Environment variables for Kafka¶
These variables are made available to your application when Kafka is enabled.
|Comma-separated list of HOST:PORT pairs to Kafka brokers
|URL to schema registry
|Username to use with schema registry
|Password to use with schema registry
|Client certificate for connecting to the Kafka brokers, as string data
|Client certificate for connecting to the Kafka brokers, as file
|Client certificate key for connecting to the Kafka brokers, as string data
|Client certificate key for connecting to the Kafka brokers, as file
|Certificate authority used to validate the Kafka brokers, as string data
|Certificate authority used to validate the Kafka brokers, as file
|Password needed to use the keystore and truststore
|PKCS#12 keystore for use with Java clients, as file
|JKS truststore for use with Java clients, as file
|A timestamp of when the secret was created
Authentication and authorization¶
The NAIS platform will generate new credentials when your applications is deployed. Kafka requires TLS client certificates for authentication. Make sure your Kafka and/or TLS library can do client certificate authentication, and that you can specify a custom CA certificate for server validation.
Readiness and liveness¶
Making proper use of liveness and readiness probes can help with many situations. If producing or consuming Kafka messages are a vital part of your application, you should consider failing one or both probes if you have trouble with Kafka connectivity. Depending on your application, failing liveness might be the proper course of action. This will make sure your application is restarted when it is experiencing problems, which might help.
In other cases, failing just the readiness probe will allow your application to continue running, attempting to move forward without being killed. Failing readiness will be most helpful during deployment, where the old instances will keep running until the new are ready. If the new instances are not able to connect to Kafka, keeping the old ones until the problem is resolved will allow your application to continue working.