You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by dg...@apache.org on 2018/09/20 14:29:46 UTC

[incubator-openwhisk-deploy-kube] branch master updated: Make k8s domain name configurable in values.yaml (#299)

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/incubator-openwhisk-deploy-kube.git


The following commit(s) were added to refs/heads/master by this push:
     new 37654c8  Make k8s domain name configurable in values.yaml (#299)
37654c8 is described below

commit 37654c8298833aa494463a110fe0d8f9e9b6fada
Author: Ying Chun Guo <gu...@cn.ibm.com>
AuthorDate: Thu Sep 20 22:29:29 2018 +0800

    Make k8s domain name configurable in values.yaml (#299)
---
 helm/openwhisk/templates/_helpers.tpl   | 15 ++++++++-------
 helm/openwhisk/templates/zookeeper.yaml |  3 ++-
 helm/openwhisk/values.yaml              |  3 +++
 3 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/helm/openwhisk/templates/_helpers.tpl b/helm/openwhisk/templates/_helpers.tpl
index e326187..f86c58e 100644
--- a/helm/openwhisk/templates/_helpers.tpl
+++ b/helm/openwhisk/templates/_helpers.tpl
@@ -3,12 +3,12 @@
 
 {{/* hostname for apigateway */}}
 {{- define "apigw_host" -}}
-{{ .Values.apigw.name }}.{{ .Release.Namespace }}.svc.cluster.local
+{{ .Values.apigw.name }}.{{ .Release.Namespace }}.svc.{{ .Values.k8s.domain }}
 {{- end -}}
 
 {{/* hostname for controller */}}
 {{- define "controller_host" -}}
-{{ .Values.controller.name }}.{{ .Release.Namespace }}.svc.cluster.local
+{{ .Values.controller.name }}.{{ .Release.Namespace }}.svc.{{ .Values.k8s.domain }}
 {{- end -}}
 
 {{/* hostname for database */}}
@@ -16,7 +16,7 @@
 {{- if .Values.db.external -}}
 {{ .Values.db.host }}
 {{- else -}}
-{{ .Values.db.name }}.{{ .Release.Namespace }}.svc.cluster.local
+{{ .Values.db.name }}.{{ .Release.Namespace }}.svc.{{ .Values.k8s.domain }}
 {{- end -}}
 {{- end -}}
 
@@ -29,13 +29,13 @@
 {{- if .Values.kafka.external -}}
 {{ .Values.kafka.name }}
 {{- else -}}
-{{ .Values.kafka.name }}.{{ .Release.Namespace }}.svc.cluster.local
+{{ .Values.kafka.name }}.{{ .Release.Namespace }}.svc.{{ .Values.k8s.domain }}
 {{- end -}}
 {{- end -}}
 
 {{/* hostname for redis */}}
 {{- define "redis_host" -}}
-{{ .Values.redis.name }}.{{ .Release.Namespace }}.svc.cluster.local
+{{ .Values.redis.name }}.{{ .Release.Namespace }}.svc.{{ .Values.k8s.domain }}
 {{- end -}}
 
 {{/* client connection string for zookeeper cluster (server1:port server2:port ... serverN:port)*/}}
@@ -45,7 +45,8 @@
 {{- else -}}
 {{- $zkname := .Values.zookeeper.name }}
 {{- $zkport := .Values.zookeeper.port }}
-{{- range $i, $e := until (int .Values.zookeeper.replicaCount) -}}{{ if ne $i 0 }},{{ end }}{{ $zkname }}-{{ . }}.{{ $zkname }}.{{ $.Release.Namespace }}.svc.cluster.local:{{ $zkport }}{{ end }}
+{{- $kubeDomain := .Values.k8s.domain }}
+{{- range $i, $e := until (int .Values.zookeeper.replicaCount) -}}{{ if ne $i 0 }},{{ end }}{{ $zkname }}-{{ . }}.{{ $zkname }}.{{ $.Release.Namespace }}.svc.{{ $kubeDomain }}:{{ $zkport }}{{ end }}
 {{- end -}}
 {{- end -}}
 
@@ -54,7 +55,7 @@
 {{- if .Values.zookeeper.external -}}
 {{ .Values.zookeeper.name }}
 {{- else -}}
-{{ .Values.zookeeper.name }}-0.{{ .Values.zookeeper.name }}.{{ $.Release.Namespace }}.svc.cluster.local
+{{ .Values.zookeeper.name }}-0.{{ .Values.zookeeper.name }}.{{ $.Release.Namespace }}.svc.{{ .Values.k8s.domain }}
 {{- end -}}
 {{- end -}}
 
diff --git a/helm/openwhisk/templates/zookeeper.yaml b/helm/openwhisk/templates/zookeeper.yaml
index 56bfc1b..1132f66 100644
--- a/helm/openwhisk/templates/zookeeper.yaml
+++ b/helm/openwhisk/templates/zookeeper.yaml
@@ -35,11 +35,12 @@ data:
     syncLimit={{ .Values.zookeeper.config.syncLimit }}
     dataDir={{ .Values.zookeeper.config.dataDir }}
     dataLogDir={{ .Values.zookeeper.config.dataLogDir }}
+{{- $kubeDomain := .Values.k8s.domain }}
 {{- $zkname := .Values.zookeeper.name }}
 {{- $zkserverport := .Values.zookeeper.serverPort }}
 {{- $zkelectionport := .Values.zookeeper.leaderElectionPort }}
 {{- range $i, $e := until (int .Values.zookeeper.replicaCount) }}
-    server.{{ . }}={{ $zkname }}-{{ . }}.{{ $zkname }}.{{ $.Release.Namespace }}.svc.cluster.local:{{ $zkserverport }}:{{ $zkelectionport }}
+    server.{{ . }}={{ $zkname }}-{{ . }}.{{ $zkname }}.{{ $.Release.Namespace }}.svc.{{ $kubeDomain }}:{{ $zkserverport }}:{{ $zkelectionport }}
 {{- end }}
 
 ---
diff --git a/helm/openwhisk/values.yaml b/helm/openwhisk/values.yaml
index 1479d3a..fe2bfbf 100644
--- a/helm/openwhisk/values.yaml
+++ b/helm/openwhisk/values.yaml
@@ -217,3 +217,6 @@ affinity:
   edgeNodeLabel: edge
   invokerNodeLabel: invoker
   providerNodeLabel: provider
+
+k8s:
+  domain: cluster.local