Sachin G
09/25/2025, 4:36 AMIan Roberts
09/25/2025, 1:11 PMwhoami command as well as the env command to ensure they are set for the correct user?Sachin G
09/25/2025, 2:02 PMIan Roberts
09/25/2025, 2:13 PMSachin G
09/25/2025, 2:19 PMSachin G
09/25/2025, 2:20 PMSachin G
09/25/2025, 2:21 PMIan Roberts
09/25/2025, 2:21 PMSachin G
09/25/2025, 2:22 PMsed -i "/^exec.*/i export KAFKA_JAAS_CONFIG=\"org.apache.kafka.common.security.plain.PlainLoginModule required username='${USERNAME}' password='${PASSWORD}';\"" "$RUNDRUIDSachin G
09/25/2025, 2:23 PMSachin G
09/25/2025, 2:23 PMIan Roberts
09/25/2025, 2:24 PMSachin G
09/25/2025, 2:25 PMIan Roberts
09/25/2025, 2:26 PMSachin G
09/25/2025, 2:27 PMSachin G
09/25/2025, 2:31 PMexport KAFKA_USERNAME="1234"
sudo -E -u grove env | grep KAFKA_USERNAME
export KAFKA_PASSWORD="1233444"
sudo -E -u grove env | grep KAFKA_PASSWORDSachin G
09/25/2025, 2:31 PMSachin G
09/25/2025, 2:31 PMIan Roberts
09/25/2025, 2:34 PMIan Roberts
09/25/2025, 2:35 PMIan Roberts
09/25/2025, 2:42 PMSachin G
09/25/2025, 2:44 PMSachin G
09/25/2025, 2:45 PMIan Roberts
09/25/2025, 2:55 PMSachin G
09/25/2025, 3:01 PM# Replace `your_username` and `your_password` with your actual credentials.
# The keys used here (KAFKA_USERNAME, KAFKA_PASSWORD) will be the names
# of the environment variables inside your pods.
kubectl create secret generic kafka-credentials \
--from-literal=KAFKA_USERNAME='your_username' \
--from-literal=KAFKA_PASSWORD='your_password'
# Verify the secret was created. The output will show the keys but not the values.
kubectl describe secret kafka-credentials
druid:
overlords:
roleGroups:
default:
env:
- name: KAFKA_USERNAME
valueFrom:
secretKeyRef:
name: kafka-credentials # Name of the Secret created above
key: KAFKA_USERNAME # Key within the Secret
- name: KAFKA_PASSWORD
valueFrom:
secretKeyRef:
name: kafka-credentials
key: KAFKA_PASSWORD
middleManagers:
roleGroups:
default:
env:
- name: KAFKA_USERNAME
valueFrom:
secretKeyRef:
name: kafka-credentials
key: KAFKA_USERNAME
- name: KAFKA_PASSWORD
valueFrom:
secretKeyRef:
name: kafka-credentials
key: KAFKA_PASSWORD
# Include the Indexer role if your tasks run there
indexers:
roleGroups:
default:
env:
- name: KAFKA_USERNAME
valueFrom:
secretKeyRef:
name: kafka-credentials
key: KAFKA_USERNAME
- name: KAFKA_PASSWORD
valueFrom:
secretKeyRef:
name: kafka-credentials
key: KAFKA_PASSWORD
#!/bin/bash
# ... (rest of your user-init script) ...
# Construct and export the KAFKA_JAAS_CONFIG environment variable
export KAFKA_JAAS_CONFIG="org.apache.kafka.common.security.plain.PlainLoginModule required username=\"${KAFKA_USERNAME}\" password=\"${KAFKA_PASSWORD}\";"
# ... (rest of your user-init script) ...Ian Roberts
09/25/2025, 3:04 PMSachin G
09/25/2025, 3:06 PMSachin G
09/25/2025, 3:06 PMSachin G
09/25/2025, 3:06 PMIan Roberts
09/25/2025, 3:06 PM