<p>I am trying to get keycloak up and running on my minikube. </p>

<p>I am installing keycloak with</p>

<p><code>helm upgrade -i -f kubernetes/keycloak/values.yaml keycloak stable/keycloak --set keycloak.persistence.dbHost=rolling-newt-postgresql</code></p>

<p>I see an error in dashboard that says:</p>

<blockquote>
  <p>MountVolume.SetUp failed for volume "realm-secret" : secrets
  "realm-secret" not found</p>
</blockquote>

<p>In my <code>values.yaml</code> I have this configuration:</p>

<pre><code>  extraVolumes: |
    - name: realm-secret
      secret:
        secretName: realm-secret
    - name: theme
      emptyDir: {}
    - name: spi
      emptyDir: {}
  extraVolumeMounts: |
    - name: realm-secret
      mountPath: "/realm/"
      readOnly: true
    - name: theme
      mountPath: /opt/jboss/keycloak/themes/mytheme
    - name: spi
      mountPath: /opt/jboss/keycloak/standalone/deployments
</code></pre>

<p>I also have a <code>realm.json</code> file. </p>

<p><strong>Question</strong></p>

<p>What do I need to do with this <code>real.json</code> file prior to installing keycloak? How do I do that ?</p>

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

<p>You can easily find that chart in <a href="https://github.com/helm/charts/tree/master/stable/keycloak" rel="noreferrer">https://github.com/helm/charts/tree/master/stable/keycloak</a>.</p>

<h3>Solution</h3>

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

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

<pre><code>$ kubectl create secret generic realm-secret --namespace=&lt;chart_namespace&gt; --from-file=path/to/realm.json
</code></pre>
