Search code examples
kubernetes-helmbitnami

Different name required to override value in Helm subchart


I have read the Helm docs and various StackOverflow questions - this is not (I hope!) a lazy question. I'm having an issue overriding a single particular value in a Helm chart, not having trouble with the concept in general.

I'm trying to install the Gitea helm chart on a k8s cluster on Raspberry Pis (that is - on arm64 architecture). Since the default memcached dependency chart is from Bitnami, who don't support arm64, I have overridden the image appropriately (to arm64v8/memcached, link).

However, this new image has a different entrypoint - /entrypoint.sh instead of /run.sh. Referencing the relevant part of the template, I believed I needed to override memcached.args, but that didn't work as expected:

$ cat values.yaml
memcached:
  image:
    repository: "arm64v8/memcached"
    tag: "1.6.17"
  args:
    - "/entrypoint.sh"
  diagnosticMode:
    enabled: false

$ helm template gitea-charts/gitea --values values.yaml
[...]
# Source: gitea/charts/memcached/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: release-name-memcached
  namespace: gitea
  labels: [...]
spec:
  selector:
    matchLabels: [...]
  replicas: 1
  template:
    metadata:
      labels: [...]
    spec:
      [...]
      serviceAccountName: release-name-memcached
      containers:
        - name: memcached
          image: docker.io/arm64v8/memcached:1.6.17
          imagePullPolicy: "IfNotPresent"
          args:
            - /run.sh #         <----- this should be `/entrypoint.sh`
          env:
            - name: BITNAMI_DEBUG
              value: "false"
          ports:
            - name: memcache
              containerPort: 11211
[...]

However, when I instead overrode memcached.arguments, the expected behaviour occurred - the contents of memcached.arguments rendered in the template's args (or, if memcached.arguments was empty, no args were rendered)

Where is this mapping from arguments to args taking place?

Note in particular that the Bitnami chart docs refer to args, so this is unexpected - though note also that the Bitnami chart's values.yaml refers to arguments in the comment (this is what prompted me to try this "obviously wrong" approach!). In the "Upgrade to 5.0.0 notes", we see "arguments has been renamed to args." - but the Gitea chart is using a >5.0.0 version of the Bitnami chart.


Solution

  • You're reasoning is correct. And the current parameter name is definitely called args (arguments is deprecated, someone just forgot to update the comment here).

    Now, why arguments work for you and args? I think you're just using the old version, before it was renamed. I checked it and:

    1. Gitea chart uses version 5.9.0 from the repo https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami

    2. This corresponds to the following Helm Chart: https://charts.bitnami.com/bitnami/memcached-5.9.0.tgz (you can check it here).

    3. When you extract this file chart, you see it's the old version of chart (with arguments not yet renamed to args).