MountVolume.SetUp failed for volume "realm-secret" : secrets "realm-secret" not found MountVolume.SetUp failed for volume "realm-secret" : secrets "realm-secret" not found kubernetes kubernetes

MountVolume.SetUp failed for volume "realm-secret" : secrets "realm-secret" not found


The reason is you are referencing a secret named realm-secret in extraVolumes, but that secret with name realm-secret is created neither by the helm chart (named stable/keycloak) nor by you manually.

You can easily find that chart in https://github.com/helm/charts/tree/master/stable/keycloak.

Solution

In values.yaml, the field extraVolume and extraVolumeMount is kept to provide an extra volume and extra volumeMount by user if they need. They will be used in the keycloak pod.

So if you need to provide extraVolumes that will mount a secret, then you have to create that secret all by yourself, so you'll need to create secret realm-secret in the same namespace in which you install/upgrade your chart. And only then install/upgrade the chart.

$ kubectl create secret generic realm-secret --namespace=<chart_namespace> --from-file=path/to/realm.json