This is an automated email from the ASF dual-hosted git repository.

dgrove pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk-deploy-kube.git


The following commit(s) were added to refs/heads/master by this push:
     new 1e6ff45  fix: kafka, zookeeper, controller get num in hostname (#513)
1e6ff45 is described below

commit 1e6ff45c982882ccffacb2036a083819994dee1e
Author: Zihao Chang <[email protected]>
AuthorDate: Thu Aug 29 21:27:22 2019 +0800

    fix: kafka, zookeeper, controller get num in hostname (#513)
---
 helm/openwhisk/templates/controller-pod.yaml | 2 +-
 helm/openwhisk/templates/kafka-pod.yaml      | 2 +-
 helm/openwhisk/templates/zookeeper-pod.yaml  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/helm/openwhisk/templates/controller-pod.yaml 
b/helm/openwhisk/templates/controller-pod.yaml
index 454959f..abbaedc 100644
--- a/helm/openwhisk/templates/controller-pod.yaml
+++ b/helm/openwhisk/templates/controller-pod.yaml
@@ -69,7 +69,7 @@ spec:
         securityContext:
           privileged: true
 {{- end }}
-        command: ["/bin/bash", "-c", "/init.sh `hostname | cut -d'-' -f3`"]
+        command: ["/bin/bash", "-c", "/init.sh `hostname | awk -F '-' '{print 
$NF}'`"]
         ports:
         - name: controller
           containerPort: {{ .Values.controller.port }}
diff --git a/helm/openwhisk/templates/kafka-pod.yaml 
b/helm/openwhisk/templates/kafka-pod.yaml
index a74452d..bb49a8d 100644
--- a/helm/openwhisk/templates/kafka-pod.yaml
+++ b/helm/openwhisk/templates/kafka-pod.yaml
@@ -64,7 +64,7 @@ spec:
       - name: kafka
         image: "{{- .Values.docker.registry.name -}}{{- 
.Values.kafka.imageName -}}:{{- .Values.kafka.imageTag -}}"
         imagePullPolicy: {{ .Values.kafka.imagePullPolicy | quote }}
-        command: ["/bin/bash", "-c", "export KAFKA_BROKER_ID=`hostname | cut 
-d'-' -f3`; export KAFKA_ADVERTISED_HOST_NAME=`hostname -f`; 
/usr/bin/start-kafka.sh"]
+        command: ["/bin/bash", "-c", "export KAFKA_BROKER_ID=`hostname | awk 
-F '-' '{print $NF}'`; export KAFKA_ADVERTISED_HOST_NAME=`hostname -f`; 
/usr/bin/start-kafka.sh"]
 {{- if .Values.k8s.persistence.enabled }}
         volumeMounts:
         - mountPath: /kafka
diff --git a/helm/openwhisk/templates/zookeeper-pod.yaml 
b/helm/openwhisk/templates/zookeeper-pod.yaml
index b4fb0a1..9d6d778 100644
--- a/helm/openwhisk/templates/zookeeper-pod.yaml
+++ b/helm/openwhisk/templates/zookeeper-pod.yaml
@@ -67,7 +67,7 @@ spec:
       - name: zookeeper
         image: "{{- .Values.docker.registry.name -}}{{- 
.Values.zookeeper.imageName -}}:{{- .Values.zookeeper.imageTag -}}"
         imagePullPolicy: {{ .Values.zookeeper.imagePullPolicy | quote }}
-        command: ["/bin/bash", "-c", "hostname -s | cut -d'-' -f3 > {{ 
.Values.zookeeper.config.dataDir }}/myid; cat {{ 
.Values.zookeeper.config.dataDir }}/myid; cat /conf/zoo.cfg; zkServer.sh 
start-foreground"]
+        command: ["/bin/bash", "-c", "hostname -s | awk -F '-' '{print $NF}'> 
{{ .Values.zookeeper.config.dataDir }}/myid; cat {{ 
.Values.zookeeper.config.dataDir }}/myid; cat /conf/zoo.cfg; zkServer.sh 
start-foreground"]
         ports:
         - name: zookeeper
           containerPort: {{ .Values.zookeeper.port }}

Reply via email to