<p>I am trying to convert docker-compose.yaml Keycloak to Char values, I'm stuck with this a bit:</p>
<p>Docker-compose config looks like this:</p>
<pre><code>  keycloak:
    container_name: keycloak
    image: jboss/keycloak:10.0.0
    hostname: keycloak
    command:
      [
        '-b',
        '0.0.0.0',
        '-Djboss.socket.binding.port-offset=1000',
        '-Dkeycloak.migration.action=import',
        '-Dkeycloak.migration.provider=dir',
        '-Dkeycloak.migration.dir=/keycloak',
        '-Dkeycloak.migration.strategy=IGNORE_EXISTING',
      ]
    volumes:
      - ./keycloak:/realm-config
    environment:
      KEYCLOAK_USER: admin@example.com
      KEYCLOAK_PASSWORD: password
    networks:
      keycloak:
        aliases:
          - keycloak.localtest.me
    ports:
      - 9080:9080/tcp

</code></pre>
<p>What I'm trying to do with Chart values:</p>
<pre><code>keycloak:
  basepath: auth
  username: admin
  password: password
  route:
    tls:
      enabled: false
  extraEnv: |
    - name: PROXY_ADDRESS_FORWARDING
      value: &quot;true&quot;
    - name: KEYCLOAK_IMPORT
      value: /keycloak/master-realm.json
    - name: JAVA_OPTS
      value: &gt;-
        -Djboss.socket.binding.port-offset=1000
  extraVolumes: |
    - name: realm-secret
      secret:
        secretName: realm-secret
  extraVolumeMounts: |
    - name: realm-secret
      mountPath: &quot;../keycloak/&quot;
      readOnly: true
  ingress:
    enabled:    true
    annotations:
      kubernetes.io/ingress.class: nginx
      nginx.ingress.kubernetes.io/use-regex: &quot;true&quot;
    path: /auth/?(.*)
    hosts:
      - keycloak.localtest.me
</code></pre>
<p>I don't quite understand where to put this from docker-compose.yaml:</p>
<pre><code>    command:
      [
        '-b',
        '0.0.0.0',
        '-Djboss.socket.binding.port-offset=1000',
        '-Dkeycloak.migration.action=import',
        '-Dkeycloak.migration.provider=dir',
        '-Dkeycloak.migration.dir=/realm-config',
        '-Dkeycloak.migration.strategy=IGNORE_EXISTING',
      ]
</code></pre>
<p>P.S I'm trying to run a k8s example for <a href="https://github.com/oauth2-proxy/oauth2-proxy/tree/master/contrib/local-environment" rel="nofollow noreferrer">https://github.com/oauth2-proxy/oauth2-proxy/tree/master/contrib/local-environment</a>
There they have k8s demo with Dex, and I want to adapt it with Keycloak.</p>

<p>You can use kompose tool to directly convert docker compose to kubernetes files. If you want to make a helm chart just replace with templates and provide values in chart values. Also Kubernetes deployment  has command field in yaml.</p>
<p>as you can see in github.com/codecentric/helm-charts/blob/master/charts/keycloak/… <strong>command</strong> is set by .Values.command</p>
<p>So in file github.com/codecentric/helm-charts/blob/master/charts/keycloak/… replace <strong>command : []</strong> with your <strong>docker-compose command</strong>.</p>
