stale-nail-78326
07/07/2021, 7:00 PMk8s.helm.v3.Chart
values
parameter. I suspect it happens because one of the keys is datasources.yaml
which contains a .
and may be expanded to something the helm chart does not understand.
This YAML works when installing the chart not using Pulumi:
datasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: "Cinnamon Prometheus"
type: prometheus
access: proxy
url: <http://prometheus-server.default.svc.cluster.local>
editable: true
But it fails when using Pulumi (typescript api):
new k8s.helm.v3.Chart(
"grafana",
{
chart: "grafana",
fetchOpts: {
repo: "<https://grafana.github.io/helm-charts>",
},
values: {
datasources: {
"datasources.yaml": {
apiVersion: 1,
datasources: {
name: "Cinnamon Prometheus",
type: "prometheus",
access: "proxy",
url: "<http://prometheus-server.default.svc.cluster.local>",
editable: true,
},
},
},
},
},
{ provider: clusterProvider },
);
values
to replicate the YAML file?@pulumi/kubernetes
3.4.1
.bored-table-20691
07/07/2021, 7:21 PMdatasources.yaml: | ā¦
FWIW, I have a similar thign for a different Helm chart and it works fine - you just put it there as a string (so you can do JSON.stringify(ā¦) on your object)stale-nail-78326
07/07/2021, 7:23 PMhelm install ... -f values.yml
is:
datasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: "Cinnamon Prometheus"
type: prometheus
access: proxy
url: <http://prometheus-server.default.svc.cluster.local>
editable: true
JSON.stringfy
though.bored-table-20691
07/07/2021, 7:24 PM"extraConfigs": map[string]interface{}{
"datasources-init.yaml": pulumi.Sprintf(`
databases:
Where extraConfigs
is part of my values object"datasources.yaml": {
apiVersion: 1,
datasources: {
name: "Cinnamon Prometheus",
type: "prometheus",
access: "proxy",
url: "<http://prometheus-server.default.svc.cluster.local>",
editable: true,
},
},
Try:
"datasources.yaml": JSON.stringify({
apiVersion: 1,
datasources: {
name: "Cinnamon Prometheus",
type: "prometheus",
access: "proxy",
url: "<http://prometheus-server.default.svc.cluster.local>",
editable: true,
},
}),
stale-nail-78326
07/07/2021, 7:25 PMbored-table-20691
07/07/2021, 11:55 PMstale-nail-78326
07/07/2021, 11:57 PMdatasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: "Cinnamon Prometheus"
type: prometheus
access: proxy
url: <http://prometheus-server.default.svc.cluster.local>
editable: true
Translate to:
{
datasources: {
"datasources.yaml": {
datasources: [
{
name: "Cinnamon Prometheus",
type: "prometheus",
access: "proxy",
url: "<http://prometheus-server.default.svc.cluster.local>",
editable: true
}
]
}
}
}
datasources
was missing.