jp-gouin / helm-openldap

Helm chart of Openldap in High availability with multi-master replication and PhpLdapAdmin and Ltb-Passwd
Apache License 2.0
181 stars 115 forks source link

Issue with volumePermissions #147

Closed zerowebcorp closed 5 months ago

zerowebcorp commented 5 months ago

Describe the bug

When running on a bare metal k8s server and testing with a local volume mounted as hostPath, the bitnami non-root container is not able to access the PV even though the pv is created. The solution, as I understand is to use the volumePermissions init container. However, enabling this option throws an error.

To Reproduce


volumePermissions:
  enabled: true
  image:
    registry: docker.io
    repository: bitnami/bitnami-shell
    tag: 10-debian-10
    pullPolicy: IfNotPresent

    command: ['sh', '-c', 'chmod -R g+rwX /bitnami']
  resources:
    requests: {}

Expected behavior

initContainer is created.

Error

➜  helm upgrade --install openldap helm-openldap/openldap-stack-ha -f values.yaml
Error: UPGRADE FAILED: failed to create resource: StatefulSet in version "v1" cannot be handled as a StatefulSet: json: cannot unmarshal object into Go struct field Container.spec.template.spec.initContainers.command of type []string
➜  
zerowebcorp commented 5 months ago

I did find this as a workaround

initContainers:
  - name: volume-permissions
    image: busybox
    command: [ 'sh', '-c', 'chmod -R g+rwX /bitnami' ]
    volumeMounts:
      - mountPath: /bitnami
        name: data
jp-gouin commented 5 months ago

Fix in v4.2.2