Kafka - Confluent Cloud

To use Confluent Cloud new tab (Cloud-Native Kafka-as-a-Service) you place the connection credentials in a Secret new tab. The Secret must contain three entries:

  • bootstrapServerKey - the URL to the Kafka bootstrap server, which is shown in Cluster settings in the Confluent Cloud console new tab

  • apiKey - the access key, which can be created in API access in the Confluent Cloud console new tab

  • apiSecret - the secret of the API access key

The Secret can be created with for example:

kubectl create secret generic \
    shopping-cart-service-kafka-secret \
    --from-literal=bootstrapServer=<url> \
    --from-literal=apiKey=<api-key> \
    --from-literal=apiSecret=<api-secret>

To enable the Kafka integration you define the name of the secret in kafkaConfluentCloud of the deployment descriptor:

apiVersion: akka.lightbend.com/v1
kind: AkkaMicroservice
metadata:
  name: shopping-cart-service
spec:
  image: <image>
  kafkaConfluentCloud:
    credentialsSecret: shopping-cart-service-kafka-secret

Apply the deployment descriptor:

kubectl apply -f kubernetes/shopping-cart-service-cr.yml

The Akka Operator will automatically provide the configuration for the connection based on the Secret when the application starts the ActorSystem.