Support Pod DNS Config and Policy for Kubernetes executor
What does this MR do?
Adds support for Pod DNS Config.
Why was this MR needed?
What's the best way to test this MR?
There are 2 new tests covering the parsing of the new options:
go test -count=1 -timeout=45s -v -run TestSetupBuildPod ./executors/kubernetes
Manual test
-
Register a kubernetes runner and then merge the following with the executor configuration (note that we disable the default DNS policy so that we can add our own config):
[[runners]] name = "kubernetes-runner" url = "https://gitlab.com/" executor = "kubernetes" [runners.kubernetes] dns_policy = "none" [runners.kubernetes.dns_config] nameservers = ["192.168.6.254"] options = [{ name = "single-request-reopen" }]
-
Start the runner.
-
Create a
.gitlab-ci.yml
file containing the following:start_evaluation: script: - cat /etc/resolv.conf tags: [kubernetes]
-
The output of the CI job should be the following:
Without this change, the output would be:
What are the relevant issue numbers?
Closes #6562 (closed)
Edited by Pedro Pombeiro