Open arcenik opened 1 year ago
The problem is that /consul/data is owned by root.root
2023-06-28T14:28:21.706517247Z + id
2023-06-28T14:28:21.706829486Z uid=100(consul) gid=1000(consul) groups=1000(consul)
2023-06-28T14:28:21.706868412Z + ls -l /consul
2023-06-28T14:28:21.707640875Z
2023-06-28T14:28:21.707642284Z /consul:
2023-06-28T14:28:21.707643698Z total 12
2023-06-28T14:28:21.707645116Z drwxrwsrwx 3 root consul 4096 Jun 28 14:27 config
2023-06-28T14:28:21.707646616Z drwxr-xr-x 2 root root 4096 Jun 28 14:27 data
2023-06-28T14:28:21.707648150Z drwxrwsrwx 2 root consul 4096 Jun 28 14:28 extra-config
2023-06-28T14:37:18.474949103Z + df -h /consul/data
2023-06-28T14:37:18.476382185Z Filesystem Size Used Available Use% Mounted on
2023-06-28T14:37:18.476392607Z /dev/vda1 17.0G 1.4G 14.6G 9% /consul/data
A fix in charts/consul/templates/server-statefulset.yaml:
initContainers:
- name: fix-consul-data-owner
image: busybox
securityContext:
runAsNonRoot: false
runAsUser: 0
command:
- "/bin/sh"
- "-cex"
- "chown -R 100:1000 /consul/data"
volumeMounts:
- name: data-{{ .Release.Namespace | trunc 58 | trimSuffix "-" }}
mountPath: /consul/data
I ran into this issue while trying to test things with vault.
Change in the PR fixed it, except for a small syntax issue in the values.yml, (endif) made a comment on the PR š
Community Note
Overview of the Issue
The chart does not works on a Minikube cluster based on VM (both Virtualbox and KVM tested).
Reproduction Steps
Start the minikube cluster with
Install the chart with these values
Logs
Logs of server pod-0
Expected behavior
Consul should start.
Environment details
Additional Context
k8s version