helm-charts
helm-charts copied to clipboard
be able to set DNS policy and config on the Kiali pod
part of https://github.com/kiali/kiali/issues/7150
To test, just run the helm template
command to see the different Deployment yaml that can be produced. First make sure you build the helm charts so the PR changes are picked up locally (i.e. make build-helm-charts
).
- Set both dns policy and dns config:
helm template --set deployment.dns.policy="ClusterFirst" --set deployment.dns.config.options[0].name="ndots" --set-string deployment.dns.config.options[0].value="1" --set deployment.dns.config.nameservers[0]="11.22.33.44" --show-only templates/deployment.yaml _output/charts/kiali-server-1.85.0-SNAPSHOT.tgz | yq '.spec.template.spec' | yq eval '. | (.dnsPolicy, .dnsConfig)'
results in:
ClusterFirst
nameservers:
- 11.22.33.44
options:
- name: ndots
value: "1"
(the first line is the value of the dnsPolicy - the lines after are the dnsConfig)
- Set dns policy
helm template --set deployment.dns.policy="ClusterFirst" --show-only templates/deployment.yaml _output/charts/kiali-server-1.85.0-SNAPSHOT.tgz | yq '.spec.template.spec' | yq eval '. | (.dnsPolicy, .dnsConfig)'
results in
ClusterFirst
null
- Set dns config:
helm template --set deployment.dns.config.options[0].name="ndots" --set-string deployment.dns.config.options[0].value="1" --set deployment.dns.config.nameservers[0]="11.22.33.44" --show-only templates/deployment.yaml _output/charts/kiali-server-1.85.0-SNAPSHOT.tgz | yq '.spec.template.spec' | yq eval '. | (.dnsPolicy, .dnsConfig)'
results in
null
nameservers:
- 11.22.33.44
options:
- name: ndots
value: "1"
- Set nothing:
helm template --show-only templates/deployment.yaml _output/charts/kiali-server-1.85.0-SNAPSHOT.tgz | yq '.spec.template.spec' | yq eval '. | (.dnsPolicy, .dnsConfig)'
results in
null
null
To test that the server can actually install:
- Make sure you have a minikube installed with Istio installed in namespace
istio-system
-
make build-helm-charts
-
helm install -n istio-system --set deployment.dns.policy="Default" --set deployment.dns.config.options[0].name="ndots" --set-string deployment.dns.config.options[0].value="1" --set deployment.image_version="latest" kiali-server _output/charts/kiali-server-1.85.0-SNAPSHOT.tgz
- See that the DNS policy setting is in place:
$ kubectl get pods -n istio-system -l app.kubernetes.io/name=kiali -o jsonpath='{..spec.dnsPolicy}{"\n"}'
Default
- See that the DNS config setting is in place:
$ kubectl get pods -n istio-system -l app.kubernetes.io/name=kiali -o jsonpath='{..spec.dnsConfig}{"\n"}'
{"options":[{"name":"ndots","value":"1"}]}
You can now uninstall: helm uninstall kiali-server -n istio-system