Skip to content

Commit

Permalink
fix permissions for /consul/extra-config
Browse files Browse the repository at this point in the history
On openshift/okd you might not have permissions to create directories
everywhere. But you can introduce mounts.

Here we're just creating insignificant mount-points for the extra-config
to do it's thing, thus eliminating the need for creating the directory,
which the user running the container might not have permissions to do.

Fixes #1306
  • Loading branch information
eb4x committed Jun 25, 2022
1 parent 9b7425a commit 44da44b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 0 additions & 1 deletion charts/consul/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ substitution for HOST_IP/POD_IP/HOSTNAME. Useful for dogstats telemetry. The out
is passed to consul as a -config-file param on command line.
*/}}
{{- define "consul.extraconfig" -}}
mkdir -p /consul/extra-config
cp /consul/config/extra-from-values.json /consul/extra-config/extra-from-values.json
[ -n "${HOST_IP}" ] && sed -Ei "s|HOST_IP|${HOST_IP?}|g" /consul/extra-config/extra-from-values.json
[ -n "${POD_IP}" ] && sed -Ei "s|POD_IP|${POD_IP?}|g" /consul/extra-config/extra-from-values.json
Expand Down
4 changes: 4 additions & 0 deletions charts/consul/templates/client-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ spec:
- name: config
configMap:
name: {{ template "consul.fullname" . }}-client-config
- name: extra-config
emptyDir: {}
- name: consul-data
emptyDir:
medium: "Memory"
Expand Down Expand Up @@ -359,6 +361,8 @@ spec:
mountPath: /consul/data
- name: config
mountPath: /consul/config
- name: extra-config
mountPath: /consul/extra-config
- mountPath: /consul/login
name: consul-data
readOnly: true
Expand Down
4 changes: 4 additions & 0 deletions charts/consul/templates/server-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ spec:
- name: config
configMap:
name: {{ template "consul.fullname" . }}-server-config
- name: extra-config
emptyDir: {}
{{- if (and .Values.global.tls.enabled (not .Values.global.secretsBackend.vault.enabled)) }}
- name: consul-ca-cert
secret:
Expand Down Expand Up @@ -303,6 +305,8 @@ spec:
mountPath: /consul/data
- name: config
mountPath: /consul/config
- name: extra-config
mountPath: /consul/extra-config
{{- if (and .Values.global.tls.enabled (not .Values.global.secretsBackend.vault.enabled)) }}
- name: consul-ca-cert
mountPath: /consul/tls/ca/
Expand Down

0 comments on commit 44da44b

Please sign in to comment.