Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from May 13, 2024

Conversation

jmazzitelli
Copy link
Contributor

@jmazzitelli jmazzitelli commented May 7, 2024

part of kiali/kiali#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
Copy link
Contributor Author

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

Copy link

@jshaughn jshaughn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required a fresh env, adding some github remotes to your repos, various other things, but then it worked. lesson learned, faster to create a clean env than to try and re-use my current env.

@jmazzitelli jmazzitelli merged commit cb4aebc into kiali:master May 13, 2024
1 check passed
@jmazzitelli jmazzitelli deleted the 7150-dns-config branch May 13, 2024 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requires operator PR Requires changes to the operator
Projects
Status: Done
2 participants