Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure when using mariadb since 2.9.0 #160

Closed
roelofjansen opened this issue Nov 1, 2021 · 9 comments
Closed

Failure when using mariadb since 2.9.0 #160

roelofjansen opened this issue Nov 1, 2021 · 9 comments

Comments

@roelofjansen
Copy link

I cannot update to 2.9.0. I use the mariadb subchart and noticed it was updated. I changed my values.yaml accordingly but I get the following error;

Error: template: nextcloud/charts/nextcloud/templates/deployment.yaml:75:66: executing "nextcloud/charts/nextcloud/templates/deployment.yaml" at <.Subcharts.mariadb>: nil pointer evaluating interface {}.mariadb

The error is caused by;
value: {{ template "mariadb.primary.fullname" .Subcharts.mariadb }}

The .Subcharts.mariadb was not there in 2.8.x. If I remove this directive, everything works fine again.

Can you please fix the error or otherwise explain how to use the new format?

Kind regards,
Roelof

@ariep
Copy link
Contributor

ariep commented Nov 2, 2021

What version of helm are you using? You need a very recent helm, at least 3.7, to provide the .Subcharts values.

@roelofjansen
Copy link
Author

roelofjansen commented Nov 2, 2021 via email

@eweinell
Copy link

eweinell commented Nov 3, 2021

unless it is really worthwile, I would favor not using features from Helm versions that young. I didn't come accross this variable, and tbh don't see why it is required here. (I'm also using argo and cannot upgrade helm easily)

@ariep
Copy link
Contributor

ariep commented Nov 4, 2021

Well, I'm obviously biased as the one who introduced this usage of .Subcharts to this chart, but I think it's really worthwhile.

To provide a little bit of context: nextcloud has mariadb as a dependency chart. The nextcloud chart itself needs to know the mariadb service name, so it can use that as the hostname of the database server to talk to. The mariadb service name is calculated by a helm template function inside the mariadb chart. So at the point of the nextcloud chart where you need to set the database host, you would like to call that template function but with all substitutions done from the mariadb chart, otherwise the two calculated names do not match up. Until the introduction of the .Subcharts variable, such a call with "subchart context" was not possible. What everyone did instead, was copying the definition of the mariadb service name template function into the nextcloud chart, and hope for the best. This is obviously brittle in the face of changes, but works most of the time.

On top of that, recently mariadb started using the bitnami common library chart to factor out parts that are common to many of the bitnami charts. This introduced a dependency of mariadb, which itself is already a dependency of nextcloud. As you can guess the service name template function is part of the common library chart. At this point it became even messier to copy and combine the relevant definitions from both mariadb and common, and I was very happy to be able to use the principled solution of the .Subcharts variable that's now available.

I understand the inconvenience of your tool not being updated to include a more recent helm version. I would hope and expect that it will be updated soon though. As comparison, we use fluxcd which already includes a new enough helm for some time.

@varac
Copy link
Contributor

varac commented Nov 4, 2021

The upgrade to helm 3.7.1 in argo-cd got merged 6 days ago, so it will be in the next release. I'd propose to describe the current situation at argo-cd, and ask them for a next release which profits from helm 3.7.

@mikeyGlitz
Copy link

What version of helm are you using? You need a very recent helm, at least 3.7, to provide the .Subcharts values.

I have helm v3.7.1 installed and am encountering this issue.

Is there a way to verify using the Terraform helm provider?

@sathieu
Copy link

sathieu commented Nov 5, 2021

You can try ghcr.io/argoproj/argocd:2.2.0-dc243800 or later which has helm 3.7.1.

@roelofjansen
Copy link
Author

Hi,

I added the following below the repoServer section of my argocd helm chart's values.yaml to update to Helm 3.7.1 and now the .Subcharts.mariadb part is handled correctly.

This is explained in more detail in: https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/custom_tools.md

  repoServer:
    name: repo-server

    volumes:
    - name: custom-tools
      emptyDir: {}

    initContainers:
    - name: download-helm3
      image: alpine:3.12
      command: [sh, -c]
      args:
        - wget -qO- https://get.helm.sh/helm-v3.7.1-linux-amd64.tar.gz | tar -xvzf - &&
          mv linux-amd64/helm /custom-tools/
      volumeMounts:
        - mountPath: /custom-tools
          name: custom-tools
    volumeMounts:
    - mountPath: /usr/local/bin/helm
      name: custom-tools
      subPath: helm

P.s. maybe you should note the Helm 3.7.x dependency somewhere in your Chart.yaml!

@ishioni
Copy link
Contributor

ishioni commented Nov 29, 2021

I just got hit with this while using newest fluxcd. According to flux devs they'll be stuck on 3.6.3 for a while

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants