Skip to content

Commit

Permalink
Adding -use-https flag to client-daemonset.yaml when externalServers …
Browse files Browse the repository at this point in the history
…are enabled
  • Loading branch information
jmurret committed Mar 14, 2022
1 parent c6072a1 commit 7a56bb8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions charts/consul/templates/client-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -478,10 +478,16 @@ spec:
value: "/consul/tls/ca/tls.crt"
{{- end }}
{{- end }}
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
command:
- "/bin/sh"
- "-ec"
- |
CONSUL_FULLNAME="{{template "consul.fullname" . }}"
consul-k8s-control-plane acl-init \
-component-name=client \
-acl-auth-method="{{ template "consul.fullname" . }}-k8s-component-auth-method" \
Expand All @@ -490,20 +496,23 @@ spec:
{{- end }}
-log-level={{ default .Values.global.logLevel .Values.client.logLevel }} \
-log-json={{ .Values.global.logJSON }} \
-init-type="client" \
{{- if .Values.externalServers.enabled }}
{{- if .Values.global.tls.enabled }}
-use-https \
{{- end }}
{{- range .Values.externalServers.hosts }}
-server-address={{ quote . }} \
{{- end }}
-server-port={{ .Values.externalServers.httpsPort }} \
{{- if .Values.externalServers.tlsServerName }}
-tls-server-name={{ .Values.externalServers.tlsServerName }} \
-tls-server-name={{ .Values.externalServers.tlsServerName }} \
{{- end }}
{{- else }}
{{- range $index := until (.Values.server.replicas | int) }}
-server-address="${CONSUL_FULLNAME}-server-{{ $index }}.${CONSUL_FULLNAME}-server.${NAMESPACE}.svc" \
{{- end }}
{{- end }}
-init-type="client"
volumeMounts:
- name: aclconfig
mountPath: /consul/aclconfig
Expand Down
1 change: 1 addition & 0 deletions charts/consul/test/unit/client-daemonset.bats
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,7 @@ local actual=$(echo $object |
local command=$(helm template \
-s templates/client-daemonset.yaml \
--set 'global.acls.manageSystemACLs=true' \
--set 'global.tls.enabled=true' \
--set 'externalServers.enabled=true' \
--set 'server.enabled=false' \
--set 'externalServers.hosts[0]=computer' \
Expand Down

0 comments on commit 7a56bb8

Please sign in to comment.