camel-kafka-connector
camel-kafka-connector copied to clipboard
Using Kubernetes secrets to update AWS credentials in connector YAML
I have a AWS s3 source connector with the following configurations :
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaConnector
metadata:
name: cloudtrail-s3-source-connector
namespace : my-kafka
labels:
strimzi.io/cluster: my-kafka-connect-cluster
spec:
class: org.apache.camel.kafkaconnector.aws2s3.CamelAws2s3SourceConnector
tasksMax: 1
config:
topics: <topic>
camel.source.path.bucketNameOrArn: <bucket-name>
camel.component.aws2-s3.useDefaultCredentialsProvider: false
camel.component.aws2-s3.moveAfterRead: false
camel.source.endpoint.region: xxxx
camel.component.aws2-s3.deleteAfterRead: true
camel.component.aws2-s3.accessKey:xxxxx
camel.component.aws2-s3.secretKey:xxx
camel.component.aws2-s3.region:xxxx
I also have a Kubernetes secret which contains the access key, secret key and region. The Kubernetes secret keeps getting rotated every x duration. How can I link the credentials in the YAML file to the credentials present in the Kubernetes secret? I'm trying to avoid hardcoding credentials in the YAML file.