Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
io.strimzi:kafka-env-var-config-provider
Advanced tools
Apache Kafka configuration provider for reading data from environment variables
Apache Kafka® supports pluggable configuration providers which can load configuration data from external sources. The configuration provider in this repo can be used to load data from environment variables. It can be used in all Kafka components and does not depend on the other Strimzi components. So you could, for example, use it with your producer or consumer applications even if you don't use the Strimzi operators to provide your Kafka cluster. One of the example use-cases is to load certificates or JAAS configuration from environment variables mapped from Kubernetes Secrets.
From Strimzi Kafka Operators release 0.25.0, the EnvVar Configuration Provider is included in all the Kafka deployments. You can use it for example with Kafka Connect and Kafka Connect connectors. The following example shows how to use it to get a database password from an environment variable in the connector configuration:
Deploy Kafka Connect, enable the EnvVar Configuration Provider and map database password to the DB_PASSWORD
environment variable:
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaConnect
metadata:
name: my-connect
annotations:
strimzi.io/use-connector-resources: "true"
spec:
# ...
config:
# ...
config.providers: env
config.providers.env.class: io.strimzi.kafka.EnvVarConfigProvider
# ...
externalConfiguration:
env:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: db-creds
key: dbPassword
# ...
Create the connector:
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaConnector
metadata:
name: my-connector
labels:
strimzi.io/cluster: my-connect
spec:
# ...
config:
option: ${env:DB_PASSWORD}
# ...
You can add EnvVar Configuration Provider as any other Java dependency using Maven or any other build tool. For example:
<dependency>
<groupId>io.strimzi</groupId>
<artifactId>kafka-env-var-config-provider</artifactId>
<version>0.1.0</version>
</dependency>
You can also use the EnvVar Configuration Provider with your own Apache Kafka deployments not managed by Strimzi.
To add EnvVar Configuration Provider to your own Apache Kafka server distribution, you can download the ZIP or TAR.GZ files frm the GitHub release page and unpack it into Kafka's libs
directory.
First, you need to initialize the configuration provider.
config.providers=env
config.providers.env.class=io.strimzi.kafka.EnvVarConfigProvider
Once you initialize it, you can use it to load data from environment variables. For example:
option=${env:MY_ENV_VAR}
If you run Apache Kafka on Kubernetes, you might also be interested in our Kubernetes Configuration Provider.
FAQs
Unknown package
We found that io.strimzi:kafka-env-var-config-provider demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.