Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upHelmChart CRD doesn't support objects in `spec.set` #276
Comments
This comment has been minimized.
This comment has been minimized.
I think it may support only key: value pairs instead of objects. |
This comment has been minimized.
This comment has been minimized.
Some more info, the set spec works as described, but if we try to flatten the keys for set using yaml and something like: apiVersion: k3s.cattle.io/v1
kind: HelmChart
metadata:
name: sql
namespace: kube-system
spec:
chart: stable/mssql-linux
targetNamespace: aperture-system
set:
acceptEula.value: y
edition.value: Express
collation: SQL_Latin1_General_CP1_CI_AS
lcid: 1033
hadr: 0
valuesContent: |-
image:
repository: microsoft/mssql-server-linux
tag: 2017-CU5
pullPolicy: IfNotPresent
service:
headless: false
type: ClusterIP
port: 1433 The above will never deploy because of If it is converted to json: {
"apiVersion": "k3s.cattle.io/v1",
"kind": "HelmChart",
"metadata": {
"name": "sql",
"namespace": "kube-system"
},
"spec": {
"chart": "stable/mssql-linux",
"targetNamespace": "aperture-system",
"set": {
"acceptEula.value": "y",
"edition.value": "Express",
"collation": "SQL_Latin1_General_CP1_CI_AS",
"lcid": 1033,
"hadr": 0
},
"valuesContent": "image:\n repository: microsoft/mssql-server-linux\n tag: 2017-CU5\n pullPolicy: IfNotPresent\nservice:\n headless: false\n type: ClusterIP\n port: 1433"
}
} Strangely enough that will deploy. It may be possible to use some escaping in the yaml to fix the behavior, but I am going to mark this is an enhancement to support nested keys for set, perhaps we can flatten the object before to generate the --set args. |
This comment has been minimized.
This comment has been minimized.
Ah, yeah, I missed that it didn't support nested keys, which would explain my results. Good to know for sure. :) |
This comment has been minimized.
This comment has been minimized.
I was able to get it to work using only set, but if the value isn't an int or string it needs to be quoted ("y" and "false"): apiVersion: k3s.cattle.io/v1
kind: HelmChart
metadata:
name: sql
namespace: kube-system
spec:
chart: stable/mssql-linux
targetNamespace: aperture-system
set:
acceptEula.value: "y"
edition.value: Express
collation: SQL_Latin1_General_CP1_CI_AS
lcid: 1033
hadr: 0
image.repository: microsoft/mssql-server-linux
image.tag: 2017-CU5
image.pullPolicy: IfNotPresent
service.headless: "false"
service.type: ClusterIP
service.port: 1433 |
This comment has been minimized.
This comment has been minimized.
I can confirm that this is an ongoing issue: I'm trying to deploy an Helm chart that checks on a boolean value to deploy a certain resource (here is the check) but since I cannot specify any boolean value without having it converted to string, I cannot go to the else branch of that control expression because
|
Describe the bug
With this manifest at `/var/lib/rancher/k3s/server/manifests/sql.yaml:
k3s does not deploy the chart. This manifest works:
To Reproduce
sql.yaml
from first manifest./usr/local/bin/k3s-uninstall.sh
curl -sfL https://get.k3s.io | sh -
kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml
kubectl patch storageclass local-path -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
cp sql.yaml /var/lib/rancher/k3s/server/manifests/
Expected behavior
I expect the HelmChart CRD to pick up the chart and deploy it.
Additional context
Looking at the spec, there's a
Set
field:And it is supported, but I'm not sure why it's not working as intended. Unfortunately I can't find the logs or I would share them.