Search code examples
kuberneteskubernetes-helmbitnami

Unable to install a helm chart after dependency update


Im new to helm. While installing a helm chart I had to update its dependency, post which Im unable to install the helm chart.

These are the steps that I have followed:

  1. Downloaded the helm chart using
helm pull codecentric/keycloak --version 18.1.1 --untar
  1. Changed chart.yaml two fields, i.e, name: postgresql is changed to name: postgresql-ha and 10.3.13 changed to version: 9.1.0
  2. Deleted the existing dependency under the charts folder i.e , rm -R charts/postgresql
  3. Helm dependency update I have done using : helm dependency update keycloak
  4. When I install this updated helm, Im facing the below issue:
$helm install keycloak ./keycloak -n identity
Error: INSTALLATION FAILED: template: keycloak/templates/statefulset.yaml:59:48: executing "keycloak/templates/statefulset.yaml" at <include "keycloak.postgresql.fullname" .>: error calling include: template: keycloak/templates/_helpers.tpl:68:3: executing "keycloak.postgresql.fullname" at <include "postgresql.primary.fullname" $postgresContext>: error calling include: template: no template "postgresql.primary.fullname" associated with template "gotpl"

I see that its tried to get value from _helpers.tpl file, so I have tried to update the file for words having postgresql to postgresql-ha this has not solved the issue.


Solution

  • it seems that the statefulset template in the keycloak chart includes a function from the postgresql chart when its deployment is enabled. since you replaced the postgresql chart with the postgresql-ha chart, the function cannot be included (probably because the function doesn't exist in the postgresql-ha chart) and therefore the installation fails with this error.

    I suggest you keep the keycloak chart at its original state, deploy the postgresql-ha chart separately and configure keycloak to use the postgresql-ha deployment instead. This way you don't break the functionality of the keycloak chart but can use the postgresl-ha setup.

    How this is done is explained in the docs of the keycloak chart (https://github.com/codecentric/helm-charts/tree/master/charts/keycloak#using-an-external-database).