This repository contains a Kafka Configuration Provider for environment variables. It can be used to externalize configs and inject values of environment variables into property values. To use this feature, simply add this jat to the classpath of your application and use it with the Apache Kafka ConfigProvider configuration (example for a ssl key provided via env var):
config.providers=env
config.providers.env.class=com.github.schm1tz1.kafka.EnvVarConfigProvider
ssl.key.password=${env:KEY_PASSPHRASE}
There is also a Kafka Improvement Proposal KIP-887 that will go live with Apache Kafka 3.5.0 to have this feature included into Kafka.