Skip to content

Instantly share code, notes, and snippets.

@TheRealNoob
Created January 27, 2025 20:45
Show Gist options
  • Save TheRealNoob/1f77d8de4faaafd633d19fc7dd318a12 to your computer and use it in GitHub Desktop.
Save TheRealNoob/1f77d8de4faaafd633d19fc7dd318a12 to your computer and use it in GitHub Desktop.
## Deployment template
mike@HM90:~/git/therealnoob/therealnoob/prometheus-community-helm-charts/state-metrics-affinity/charts/kube-state-metrics$ grep -A 3 '{{- if .Values.affinity }}' templa
tes/deployment.yaml
{{- if .Values.affinity }}
affinity:
{{ tpl (toYaml .Values.affinity) $ | indent 8 }}
{{- end }}
############################
## values file
mike@HM90:~/git/therealnoob/therealnoob/prometheus-community-helm-charts/state-metrics-affinity/charts/kube-state-metrics$ grep -A 8 'affinity:' values.yaml
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/instance: state-metrics
topologyKey: kubernetes.io/hostname
############################
## helm template
mike@HM90:~/git/therealnoob/therealnoob/prometheus-community-helm-charts/state-metrics-affinity/charts/kube-state-metrics$ helm template state-metrics .
Error: YAML parse error on kube-state-metrics/templates/deployment.yaml: error converting YAML to JSON: yaml: line 85: did not find expected key
Use --debug flag to render out invalid YAML
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment