Skip to content

Instantly share code, notes, and snippets.

@id
Created March 26, 2025 15:19
Show Gist options
  • Save id/4ab4442d3f406b36728bb8d9063550db to your computer and use it in GitHub Desktop.
Save id/4ab4442d3f406b36728bb8d9063550db to your computer and use it in GitHub Desktop.
emqx in k8s with kafka config example
apiVersion: apps.emqx.io/v2beta1
kind: EMQX
metadata:
name: emqx
spec:
image: emqx/emqx-enterprise:5.6.0
config:
data: |
log.console.level = debug
connectors {
kafka_producer {
cloud {
authentication {
mechanism = plain
username = kafka_username
password = "file:///mounted/kafka/password.txt"
}
bootstrap_hosts = "localhost:9092"
ssl {enable = true, verify = verify_peer}
}
}
}
actions {
kafka_producer {
cloud {
connector = cloud
enable = true
parameters {
message {
key = "${.clientid}"
timestamp = "${.timestamp}"
value = "${.}"
}
topic = "emqx"
}
}
}
}
coreTemplate:
spec:
replicas: 3
extraVolumes:
- name: kafka-creds
secret:
secretName: kafka-creds
extraVolumeMounts:
- name: kafka-creds
mountPath: /mounted/kafka
dashboardServiceTemplate:
enabled: true
spec:
type: LoadBalancer
apiVersion: v1
kind: Secret
metadata:
name: kafka-creds
type: Opaque
stringData:
password.txt: |
password123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment