fleet
fleet copied to clipboard
global.fleet.clusterLabels not rendered in plain list items
Is there an existing issue for this?
- [X] I have searched the existing issues
Current Behavior
I can use the Grafana labs Helm Chart as an example and I think this bug is related to #363 and #402
I defined a clusterlabel myproduct/hostname and in one particular case it doesn't get rendered
defaultNamespace: grafana
helm:
repo: https://grafana.github.io/helm-charts
chart: grafana
releaseName: grafana
version: 6.32.12
values:
serviceMonitor:
enabled: true
path: /metrics
ingress:
enabled: true
ingressClassName: nginx
annotations:
# cert-manager.io/cluster-issuer: generic-cluster-issuer
ingress.kubernetes.io/proxy-body-size: "0"
# ingress.kubernetes.io/ssl-redirect: "true"
labels: {}
path: /grafana
pathType: Prefix
hosts:
- global.fleet.clusterLabels.myproduct/hostname
# tls:
# - secretName: grafana-tls
# hosts:
# - global.fleet.clusterLabels.myproduct/hostname
persistence:
type: pvc
enabled: true
storageClassName: openebs-zfspv
accessModes:
- ReadWriteOnce
size: 1Gi
The cluster labels appear correctly in the rendered values, but not in the "hosts" list
> helm get values -n grafana grafana
USER-SUPPLIED VALUES:
global:
fleet:
clusterLabels:
brainkin-fleet: enabled
myproduct/hostname: myhostname.int.company.tld
management.cattle.io/cluster-display-name: myproduct-dev
management.cattle.io/cluster-name: c-m-xvxjw2sg
provider.cattle.io: k3s
ingress:
annotations:
ingress.kubernetes.io/proxy-body-size: "0"
enabled: true
hosts:
- global.fleet.clusterLabels.myproduct/hostname
ingressClassName: nginx
labels: {}
path: /grafana
pathType: Prefix
persistence:
accessModes:
- ReadWriteOnce
enabled: true
size: 1Gi
storageClassName: openebs-zfspv
type: pvc
serviceMonitor:
enabled: true
path: /metrics
Expected Behavior
I would expect it to correctly render the clusterlabels value of "myhostname.int.company.tld" as it happens with other charts
Steps To Reproduce
No response
Environment
- Architecture: amd64
- Fleet Version: 0.3.9
- Cluster:
- Provider: k3s (the the same happens with vanilla k8s or rke)
- Options: the cluster is joined to a rancher server running version 2.6.6
- Kubernetes Version: 1.23.8
Logs
No response
Anything else?
No response
I am experiencing the same issue. It also won't work with "${ .ClusterLabels.LABEL }"
like mentioned in the gitrepo structure or with "{{ .ClusterLabels }}"
like @gregsidelinger mentioned it here.