Skip to content

Commit

Permalink
Update configuration script to correctly handle error and use auth (h…
Browse files Browse the repository at this point in the history
…elm#10370)

Signed-off-by: Karol Chrapek <[email protected]>
  • Loading branch information
kaarolch authored and k8s-ci-robot committed Jan 10, 2019
1 parent 4704252 commit 438ed8f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion stable/kafka-manager/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: kafka-manager
version: 1.0.0
version: 1.1.0
appVersion: 1.3.3.18
kubeVersion: "^1.8.0-0"
description: A tool for managing Apache Kafka.
Expand Down
6 changes: 3 additions & 3 deletions stable/kafka-manager/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ metadata:
data:
addClusters.sh: |
#!/bin/bash
set -ex
set -e
{{- range $cluster := .Values.clusters }}
{{ printf "curl http://%s:9000/clusters -X POST " (include "kafka-manager.fullname" $) -}}
{{ printf "curl http://%s:9000/clusters -X POST -f " (include "kafka-manager.fullname" $) -}}
{{- printf "-d name=%s " (default "default" $cluster.name) -}}
{{- printf "-d zkHosts=%s " (default (include "kafka-manager.zkHosts" $) $cluster.zkHosts ) -}}
{{- printf "-d kafkaVersion=%s " (default "1.0.0" $cluster.kafkaVersion) -}}
Expand Down Expand Up @@ -46,6 +46,6 @@ data:
{{- printf "-d tuning.kafkaManagedOffsetGroupCacheSize=%s " (default "1000000" $cluster.tuning.kafkaManagedOffsetGroupCacheSize) -}}
{{- printf "-d tuning.kafkaManagedOffsetGroupExpireDays=%s " (default "7" $cluster.tuning.kafkaManagedOffsetGroupExpireDays) -}}
{{- printf "-d securityProtocol=%s " (default "PLAINTEXT" $cluster.securityProtocol) -}}
{{- printf "|| exit 1;" -}}
{{- printf "$( if $KAFKA_MANAGER_AUTH_ENABLED; then echo -u $KAFKA_MANAGER_USERNAME:$KAFKA_MANAGER_PASSWORD ; fi ) " -}}
{{- end -}}
{{- end -}}
13 changes: 13 additions & 0 deletions stable/kafka-manager/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/usr/local/script/addClusters.sh"]
env:
- name: KAFKA_MANAGER_AUTH_ENABLED
value: {{ .Values.basicAuth.enabled | quote }}
- name: KAFKA_MANAGER_USERNAME
valueFrom:
secretKeyRef:
name: {{ template "kafka-manager.fullname" . }}
key: basicAuthUsername
- name: KAFKA_MANAGER_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "kafka-manager.fullname" . }}
key: basicAuthPassword
volumeMounts:
- name: script-volume
mountPath: "/usr/local/script"
Expand Down

0 comments on commit 438ed8f

Please sign in to comment.