skip to Main Content

I’m trying to upgrade keycloak helm chart in Azure Kubernetes by passing image tag values to new version, but it is only picking old version value from chart.yaml.

I am using this keycloak helm chart repository.

https://github.com/bitnami/charts/tree/main/bitnami/keycloak

my Chart.yaml

apiVersion: v2
name: keycloak
description: A Helm chart to deploy Keycloak and Keycloak Config CLI
appVersion: 22.0.5
dependencies:
- name: common
  repository: oci://registry-1.docker.io/bitnamicharts
  tags:
  - bitnami-common
  version: 2.x.x
keywords:
- keycloak
version: 17.3.6

values.yaml

keycloak:
  image:
    repository: docker.io/bitnami/keycloak
    tag: 23.0.6-debian-11-r4
    pullPolicy: IfNotPresent
  # Add any Keycloak specific configurations here

keycloakConfigCli:
  image:
    repository: docker.io/bitnami/keycloak-config-cli
    tag: 5.9.0-debian-11-r1
    pullPolicy: IfNotPresent
  # Add any Keycloak Config CLI specific configurations here

2

Answers


  1. I used the same keycloak link which you used and was able to # update keycloak helm chart version through values.yaml?

    First deploy keycloak as usual using your link

    enter image description here

    Once deployed, now in order to change the version
    first, identify the Keycloak Helm release: helm list -A
    then verify if your keycloak is deployed as stateful or not using kubectl get statefulsets -A
    This command will list all StatefulSets across all namespaces. Look for Keycloak in the output. Now that you know that your Keycloak deployment is deployed as a StatefulSet, not a Deployment.

    update the Keycloak image in a StatefulSet, use the following command:

    kubectl set image statefulset/keycloak keycloak=docker.io/bitnami/keycloak:23.0.6-debian-11-r4 -n default
    

    This command specifies the image for the keycloak container within the keycloak StatefulSet in the default namespace.

    You can verify the progress using

    kubectl rollout status statefulset/keycloak -n default
    

    Finally after rollout is complete verify

    kubectl get pods -l app.kubernetes.io/name=keycloak -n default -o=jsonpath="{.items[*].spec.containers[*].image}"
    

    There you go-
    originally when initially deployed, it was at 23.0.7

    enter image description here

    now it is at 23.0.6 debian-11-r4
    enter image description here

    pods are up as well
    enter image description here

    Login or Signup to reply.
  2. I think in order to trigger the changes you made in the values.yaml file you will need to change the Chart version in Chart.yaml file as well, then run the helm upgrade command for your keycloak helm chart

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search