diff --git a/charts/clabernetes/templates/deployment.yaml b/charts/clabernetes/templates/deployment.yaml index 804ee784..a21360e0 100644 --- a/charts/clabernetes/templates/deployment.yaml +++ b/charts/clabernetes/templates/deployment.yaml @@ -25,11 +25,11 @@ spec: matchLabels: clabernetes/app: {{ .Values.appName }} release: {{ .Release.Name }} - replicas: {{ .Values.replicaCount }} + replicas: {{ .Values.manager.replicaCount }} strategy: rollingUpdate: maxSurge: 1 - {{- if (eq (int .Values.replicaCount) 1) }} + {{- if (eq (int .Values.manager.replicaCount) 1) }} maxUnavailable: 0 {{- else }} maxUnavailable: 1 @@ -138,10 +138,8 @@ spec: fieldPath: metadata.namespace - name: CLIENT_OPERATION_TIMEOUT_MULTIPLIER value: "{{ .Values.manager.clientOperationTimeoutMultiplier }}" - {{- if .Values.manager.inClusterDNSSuffixOverride }} - - name: IN_CLUSTER_DNS_SUFFIX_OVERRIDE - value: {{ .Values.manager.inClusterDNSSuffixOverride }} - {{- end }} + - name: IN_CLUSTER_DNS_SUFFIX + value: {{ .Values.manager.inClusterDNSSuffix }} - name: MANAGER_LOGGER_LEVEL value: {{ .Values.manager.managerLogLevel }} - name: CONTROLLER_LOGGER_LEVEL diff --git a/charts/clabernetes/values.yaml b/charts/clabernetes/values.yaml index bdc1fc80..947a9839 100644 --- a/charts/clabernetes/values.yaml +++ b/charts/clabernetes/values.yaml @@ -35,7 +35,7 @@ manager: clientOperationTimeoutMultiplier: 1 managerLogLevel: info controllerLogLevel: info - # inClusterDNSSuffixOverride: domain.or.whatever + inClusterDNSSuffix: svc.cluster.local # pod affinity settings, directly inserted into manager deployment spec; if not provided basic # common-sense anti-affinity is applied. diff --git a/constants/env.go b/constants/env.go index 6e399323..5261990a 100644 --- a/constants/env.go +++ b/constants/env.go @@ -18,9 +18,9 @@ const ( // operation timeout. ClientOperationTimeoutMultiplierEnv = "CLIENT_OPERATION_TIMEOUT_MULTIPLIER" - // InClusterDNSSuffixOverrideEnv is the env var specifying an optional DNS suffix to replace the - // default value of 'svc.cluster.local". - InClusterDNSSuffixOverrideEnv = "IN_CLUSTER_DNS_SUFFIX_OVERRIDE" + // InClusterDNSSuffixEnv is the env var specifying the DNS suffix to use to resolve in cluster + // services, typically 'svc.cluster.local". + InClusterDNSSuffixEnv = "IN_CLUSTER_DNS_SUFFIX" ) const ( diff --git a/controllers/topology/service.go b/controllers/topology/service.go index 50282849..6779d555 100644 --- a/controllers/topology/service.go +++ b/controllers/topology/service.go @@ -83,7 +83,7 @@ func serviceConforms( // override value. func GetServiceDNSSuffix() string { return clabernetesutil.GetEnvStrOrDefault( - clabernetesconstants.InClusterDNSSuffixOverrideEnv, + clabernetesconstants.InClusterDNSSuffixEnv, clabernetesconstants.DefaultInClusterDNSSuffix, ) } diff --git a/util/env.go b/util/env.go index c15accea..10388fd2 100644 --- a/util/env.go +++ b/util/env.go @@ -9,7 +9,7 @@ import ( // if casting fails or the environment variable is not set. func GetEnvStrOrDefault(k, d string) string { v, ok := os.LookupEnv(k) - if ok { + if ok && v != "" { return v }