Repository navigation
Description
With chart version: 3.4.1 I can only get the parameters under image to work if I put them under nextcloud in my values.yaml. As an example, I would like to use the 25.0.3-fpm image.tag.
This is from the current values.yaml in this repo and if I use it, but just change the tag, it does not honor the tag I have specified:
image:
repository: nextcloud
tag: 25.0.3-fpm
pullPolicy: IfNotPresentand it produces this (with helm template nextcloud . from the directory where I have a Chart.yaml that just references the current nextcloud chart version and a values.yaml):
Wrong output rendered template
# Source: nextcloud/charts/nextcloud/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nextcloud
labels:
app.kubernetes.io/name: nextcloud
helm.sh/chart: nextcloud-3.4.1
app.kubernetes.io/instance: nextcloud
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: app
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app.kubernetes.io/name: nextcloud
app.kubernetes.io/instance: nextcloud
app.kubernetes.io/component: app
template:
metadata:
labels:
app.kubernetes.io/name: nextcloud
app.kubernetes.io/instance: nextcloud
app.kubernetes.io/component: app
annotations:
nextcloud-config-hash: a5aae02b1b8278a9c8a2dc143e82d3737fc295f62c34afd617207f37d1b2b438
php-config-hash: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
spec:
containers:
- name: nextcloud
image: nextcloud:25.0.3-apache
imagePullPolicy: IfNotPresent
...If I change my local values.yaml to put image.tag under nextcloud it succeeds in the way I would expect:
nextcloud:
image:
repository: nextcloud
tag: 25.0.3-fpm
pullPolicy: IfNotPresentAnd produces this when I run helm template:
Correct expected template rendered output
# Source: nextcloud/charts/nextcloud/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nextcloud
labels:
app.kubernetes.io/name: nextcloud
helm.sh/chart: nextcloud-3.4.1
app.kubernetes.io/instance: nextcloud
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: app
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app.kubernetes.io/name: nextcloud
app.kubernetes.io/instance: nextcloud
app.kubernetes.io/component: app
template:
metadata:
labels:
app.kubernetes.io/name: nextcloud
app.kubernetes.io/instance: nextcloud
app.kubernetes.io/component: app
annotations:
nextcloud-config-hash: a5aae02b1b8278a9c8a2dc143e82d3737fc295f62c34afd617207f37d1b2b438
php-config-hash: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
spec:
containers:
- name: nextcloud
image: nextcloud:25.0.3-fpm
imagePullPolicy: IfNotPresentThis could be because we're only looking for nextcloud.image in the deployment.yaml template:
helm/charts/nextcloud/templates/deployment.yaml
Lines 48 to 58 in 315313b
| spec: | |
| {{- if .Values.image.pullSecrets }} | |
| imagePullSecrets: | |
| {{- range .Values.image.pullSecrets }} | |
| - name: {{ . }} | |
| {{- end}} | |
| {{- end }} | |
| containers: | |
| - name: {{ .Chart.Name }} | |
| image: {{ include "nextcloud.image" . }} | |
| imagePullPolicy: {{ .Values.image.pullPolicy }} |
Perhaps something is not working here:
helm/charts/nextcloud/templates/_helpers.tpl
Lines 42 to 51 in 315313b
| {{/* | |
| Create image name that is used in the deployment | |
| */}} | |
| {{- define "nextcloud.image" -}} | |
| {{- if .Values.image.tag -}} | |
| {{- printf "%s:%s" .Values.image.repository .Values.image.tag -}} | |
| {{- else -}} | |
| {{- printf "%s:%s-%s" .Values.image.repository .Chart.AppVersion (default "apache" .Values.image.flavor) -}} | |
| {{- end -}} | |
| {{- end -}} |
If I clone this repo, and cd into charts/nexcloud, update the values.yaml parameter image.tag to 25.0.3-fpm, then run helm template nextcloud . from that directory, the resulting rendered manifests are correct, so I think the _helpers.tpl only applies to the base template and does not take into account additional values.yaml passed in by end users.
Activity
jessebot commentedon Jan 24, 2023
Not sure if this is related to #112 or not, but still refining the backlog to research if others are having this issue.
provokateurin commentedon Jan 25, 2023
I don't think it's related
jessebot commentedon Apr 10, 2023
I'm still having this problem with the latest version of the helm chart.
I think a solution could be to changed this line here:
helm/charts/nextcloud/templates/deployment.yaml
Line 57 in aa54644
to be something like this in
charts/nextcloud/templates/deployment.yaml:And then we remove the stuff about this in
_helpers.tpland updatevalues.yamlto actually specify theimage.flavorby default? Creating a draft PR, #375, to show what I mean.jessebot commentedon Apr 10, 2023
Closed the draft PR as I've just realized this is only happening through Argo CD for some reason 😨 This issue doesn't occur when I just use k3s with helm directly. I'll report in more as I figure out what the issue is!
[-]Values.image parameters not honored by helm chart[/-][+]Values.image parameters not honored by helm chart in ArgoCD[/+]jessebot commentedon Apr 15, 2023
So, this happens if you were using argocd the old way, before they introduced the beta multiple sources feature. Here's an example of how it was broken before. You could previously only use the values.yaml in the source helm chart repo, so the only way to use your own values.yaml was to have a repo where you created a helm chart like this:
Broken argocd setup causing this github issue
`Chart.yaml`: ```yaml --- apiVersion: v2 version: 0.1.0 name: nextcloud dependencies: - name: nextcloud repository: https://nextcloud.github.io/helm/ version: 3.4.1 ```With the above
Chart.yaml, the only way to get thevalues.yamlto work was to do this:This is the argo manifest I was using:
Now with the Argo CD app version
2.6.x, you can do the following to use a different source for yourvalues.yamlthan the source with the actual helm chart like this:This solves the problem entirely, but since this is a beta feature, it might break again 🙃 :

Closing as this is fixed in my testing with Argo CD helm chart version
5.28.1using the nextcloud helm chart version3.5.7though via an argo Application that uses two sources: 1 for this helm chart repo, 1 for my actual values.yaml :)