helm-charts icon indicating copy to clipboard operation
helm-charts copied to clipboard

be able to set DNS policy and config on the Kiali pod

Open jmazzitelli opened this issue 9 months ago • 1 comments

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).

  1. 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)

  1. 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
  1. 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"
  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

jmazzitelli avatar May 07 '24 14:05 jmazzitelli

To test that the server can actually install:

  1. Make sure you have a minikube installed with Istio installed in namespace istio-system
  2. make build-helm-charts
  3. 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
  4. 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
  1. 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

jmazzitelli avatar May 07 '24 16:05 jmazzitelli