This is my string in values.yaml
:
selectorLabels: { app.kubernetes.io/name: tinyurl }
Yaml file looks like below:
name: test-dj-service
environment: prod
namespace: test-service
labels: { app.kubernetes.io/name: test-dj-service, environment: prod }
replicaCount: 1
selectorLabels: { app.kubernetes.io/name: tinyurl } <---
I need to use tinyurl
in the below code under values.
Note:- tinyurl
is variable, it will keep changing with other names.
{?{ - if .Values.affinity.podAntiAffinity.preferred == true }}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values: {?{ ---------- }} # need to pull the selectorLabels values here.
topologyKey: "kubernetes.io/hostname"
{?{- end }}
So how I can pull this variable into values.
question from:
https://stackoverflow.com/questions/65918338/how-to-read-value-from-yaml-file-which-are-in-dictionary-and-need-to-use-in-helm 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…