<p>I was installing Keycloak using <a href="https://operatorhub.io/operator/keycloak-operator" rel="nofollow noreferrer">Operator</a> (version 13.0.0). The updated code has theme related stuff <a href="https://github.com/keycloak/keycloak-operator" rel="nofollow noreferrer">github repository</a> and supports custom theme integration quite well. All we need an URL where the custom <code>theme</code> is located. I tried it and worked flawlessly.</p>
<p>However, what if we have themes in some local directory, not on some public URL. How do we suppose to upload the <code>theme</code> in the Keycloak then?</p>
<p>I've tried using the File URL and file paths as well but didn't work for me.</p>
<p>The <code>Keycloak.yaml</code></p>
<pre><code>apiVersion: keycloak.org/v1alpha1
kind: Keycloak
metadata:
  name: keycloak-test
  labels:
    app: keycloak-test
spec:
  instances: 1
  extensions:
    - https://SOME-PUBLIC-URL/keycloak-themes.jar                    
  externalAccess:
    enabled: False
  podDisruptionBudget:
    enabled: True
</code></pre>

<p><strong>We can add custom keycloak themes in keycloak operator (v13.0.0) using the below steps:</strong></p>
<ol>
<li>Create a jar file for your custom theme using step shown here <a href="https://www.keycloak.org/docs/latest/server_development/#deploying-themes" rel="nofollow noreferrer">Deploying Keycloak Themes</a></li>
<li>Create a kubernetes configmap of the jar using the following command</li>
</ol>
<pre><code>kubectl create cm customtheme --from-file customtheme.jar
</code></pre>
<ol start="3">
<li>To use above configmap update <code>Keycloak.yaml</code> and add the following code block</li>
</ol>
<pre><code>  keycloakDeploymentSpec:
    experimental:
      volumes:
        defaultMode: 0777
        items:
          - name: customtheme
            mountPath: /opt/jboss/keycloak/standalone/deployments/custom-themes
            subPath: customtheme.jar
            configMaps:
              - customtheme
</code></pre>
<p><strong>Note:</strong> Make sure the size of theme is less than 1MB.</p>
