-
Notifications
You must be signed in to change notification settings - Fork 91
Deploy a SASL_PLAIN Kafka listener & test notifications against it #2300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development/2.13
Are you sure you want to change the base?
Changes from all commits
4db9f72
a091dc4
22d0a30
3d0d560
20a175e
f42b9d3
bc1352c
da91813
13b692a
89a3abb
0e34d39
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,6 +11,37 @@ KAFKA_HOST_PORT=${KAFKA_HOST_PORT:1:-1} | |||||||||||||||||||||||||
| export NOTIF_KAFKA_HOST=${KAFKA_HOST_PORT%:*} | ||||||||||||||||||||||||||
| export NOTIF_KAFKA_PORT=${KAFKA_HOST_PORT#*:} | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| export NOTIF_KAFKA_AUTH_HOST="${ZENKO_NAME}-base-queue-auth-0" | ||||||||||||||||||||||||||
| export NOTIF_KAFKA_AUTH_HOST_PORT="$NOTIF_KAFKA_AUTH_HOST:$NOTIF_KAFKA_PORT" | ||||||||||||||||||||||||||
| export NOTIF_KAFKA_AUTH_PORT=9094 | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Add an extra SASL_PLAIN Kafka listener, to support testing authenticated Kafka for bucket notifications | ||||||||||||||||||||||||||
| kubectl get zookeepercluster "${ZENKO_NAME}-base-quorum" -o json | jq '. | ||||||||||||||||||||||||||
| | .metadata |= {namespace, name: "\(.name)-auth" } | ||||||||||||||||||||||||||
| | del(.spec.labels) | ||||||||||||||||||||||||||
| | del(.spec.persistence) | ||||||||||||||||||||||||||
| | .spec.storageType |= "ephemeral" | ||||||||||||||||||||||||||
| | del(.spec.pod.affinity) | ||||||||||||||||||||||||||
| | del(.spec.pod.labels) | ||||||||||||||||||||||||||
| | del(.status) | ||||||||||||||||||||||||||
| ' | kubectl apply -f - | ||||||||||||||||||||||||||
| kubectl wait --for=jsonpath='{.status.readyReplicas}'=1 --timeout 10m zookeepercluster "${ZENKO_NAME}-base-quorum-auth" | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| kubectl get kafkacluster "${ZENKO_NAME}-base-queue" -o json | jq '. | ||||||||||||||||||||||||||
| | .metadata |= {namespace, name: "\(.name)-auth" } | ||||||||||||||||||||||||||
delthas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||
| | del(.status) | ||||||||||||||||||||||||||
| | .spec.listenersConfig.internalListeners |= . + [{containerPort: 9094, name: "auth", type: "sasl_plaintext", usedForInnerBrokerCommunication: false}] | ||||||||||||||||||||||||||
| | .spec.readOnlyConfig |= (. + " | ||||||||||||||||||||||||||
| sasl.enabled.mechanisms=PLAIN | ||||||||||||||||||||||||||
delthas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||
| listener.name.auth.plain.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username=\"'"$NOTIF_AUTH_DEST_USERNAME"'\" password=\"'"$NOTIF_AUTH_DEST_PASSWORD"'\" user_'"$NOTIF_AUTH_DEST_USERNAME"'=\"'"$NOTIF_AUTH_DEST_PASSWORD"'\"; | ||||||||||||||||||||||||||
| ") | ||||||||||||||||||||||||||
| | del(.spec.brokerConfigGroups.default.storageConfigs[].pvcSpec) | ||||||||||||||||||||||||||
| | .spec.brokerConfigGroups.default.storageConfigs[].emptyDir |= {medium: "Memory"} | ||||||||||||||||||||||||||
| | .spec.zkAddresses |= ["'"${ZENKO_NAME}-base-quorum-auth-0.${ZENKO_NAME}-base-quorum-auth-headless:2181"'"] | ||||||||||||||||||||||||||
| | .spec.cruiseControlConfig.capacityConfig |= ({brokerCapacities: [{brokerId: "-1", capacity: {DISK: "1000", CPU: "100", NW_IN: "1000", NW_OUT: "1000"}}]} | tostring) | ||||||||||||||||||||||||||
| ' | kubectl apply -f - | ||||||||||||||||||||||||||
| kubectl wait --for=jsonpath='{.status.state}'=ClusterRunning --timeout 10m kafkacluster "${ZENKO_NAME}-base-queue-auth" | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| UUID=$(kubectl get secret -l app.kubernetes.io/name=backbeat-config,app.kubernetes.io/instance=end2end \ | ||||||||||||||||||||||||||
| -o jsonpath='{.items[0].data.config\.json}' | base64 -di | jq .extensions.replication.topic) | ||||||||||||||||||||||||||
| UUID=${UUID%.*} | ||||||||||||||||||||||||||
|
|
@@ -48,6 +79,7 @@ kubectl run kafka-topics \ | |||||||||||||||||||||||||
| --command -- bash -c \ | ||||||||||||||||||||||||||
| "kafka-topics.sh --create --topic $NOTIF_DEST_TOPIC --bootstrap-server $KAFKA_HOST_PORT --if-not-exists ; \ | ||||||||||||||||||||||||||
| kafka-topics.sh --create --topic $NOTIF_ALT_DEST_TOPIC --bootstrap-server $KAFKA_HOST_PORT --if-not-exists ; \ | ||||||||||||||||||||||||||
| kafka-topics.sh --create --topic $NOTIF_AUTH_DEST_TOPIC --bootstrap-server $NOTIF_KAFKA_AUTH_HOST_PORT --if-not-exists ; \ | ||||||||||||||||||||||||||
delthas marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||
| kafka-topics.sh --create --topic $NOTIF_AUTH_DEST_TOPIC --bootstrap-server $NOTIF_KAFKA_AUTH_HOST_PORT --if-not-exists ; \ | |
| kafka-topics.sh --create --topic $NOTIF_AUTH_DEST_TOPIC --bootstrap-server $NOTIF_KAFKA_AUTH_HOST:$NOTIF_KAFKA_AUTH_PORT --if-not-exists ; \ |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The kafka-topics.sh command for creating topics on the authenticated Kafka cluster doesn't include SASL authentication parameters. To create topics on a SASL_PLAIN secured cluster, the command needs to include --command-config with a properties file containing security.protocol=SASL_PLAINTEXT, sasl.mechanism=PLAIN, and sasl.jaas.config credentials.
| "kafka-topics.sh --create --topic $NOTIF_DEST_TOPIC --bootstrap-server $KAFKA_HOST_PORT --if-not-exists ; \ | |
| kafka-topics.sh --create --topic $NOTIF_ALT_DEST_TOPIC --bootstrap-server $KAFKA_HOST_PORT --if-not-exists ; \ | |
| kafka-topics.sh --create --topic $NOTIF_AUTH_DEST_TOPIC --bootstrap-server $NOTIF_KAFKA_AUTH_HOST_PORT --if-not-exists ; \ | |
| "KAFKA_CLIENT_CONFIG=/tmp/kafka-client-sasl.properties; \ | |
| echo 'security.protocol=SASL_PLAINTEXT' > \${KAFKA_CLIENT_CONFIG}; \ | |
| echo 'sasl.mechanism=PLAIN' >> \${KAFKA_CLIENT_CONFIG}; \ | |
| echo \"sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username=\\\"${NOTIF_KAFKA_USERNAME}\\\" password=\\\"${NOTIF_KAFKA_PASSWORD}\\\";\" >> \${KAFKA_CLIENT_CONFIG}; \ | |
| kafka-topics.sh --create --topic $NOTIF_DEST_TOPIC --bootstrap-server $KAFKA_HOST_PORT --if-not-exists ; \ | |
| kafka-topics.sh --create --topic $NOTIF_ALT_DEST_TOPIC --bootstrap-server $KAFKA_HOST_PORT --if-not-exists ; \ | |
| kafka-topics.sh --create --topic $NOTIF_AUTH_DEST_TOPIC --bootstrap-server $NOTIF_KAFKA_AUTH_HOST_PORT --command-config \${KAFKA_CLIENT_CONFIG} --if-not-exists ; \ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,11 +2,11 @@ | |
| # to sort keys, use the following command | ||
| # yq eval 'sortKeys(.)' -i deps.yaml | ||
| backbeat: | ||
| sourceRegistry: ghcr.io/scality | ||
| sourceRegistry: ghcr.io/scality/playground/delthas | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to be updated before merging
delthas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| dashboard: backbeat/backbeat-dashboards | ||
| image: backbeat | ||
| policy: backbeat/backbeat-policies | ||
| tag: 9.1.2 | ||
| tag: 9.0.17-hcdea8d6b6a6de4e49c07067cafa847a2ae86b8a3 | ||
delthas marked this conversation as resolved.
Show resolved
Hide resolved
delthas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| envsubst: BACKBEAT_TAG | ||
| busybox: | ||
| image: busybox | ||
|
|
@@ -136,7 +136,7 @@ vault: | |
| zenko-operator: | ||
| sourceRegistry: ghcr.io/scality | ||
| image: zenko-operator | ||
| tag: v1.8.0 | ||
| tag: 6665b3a70724e72e0cec4180129513036fcd9452 | ||
delthas marked this conversation as resolved.
Show resolved
Hide resolved
delthas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| envsubst: ZENKO_OPERATOR_TAG | ||
| zookeeper: | ||
| sourceRegistry: pravega | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.