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

fix: resolve DNS hostnames from within pod in minikube #3609

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions content/en/blog/news/2022-04-22-k8s-122-tekton.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,23 @@ In the current version of Tekton used by Jenkins X, the resource `requests` are
To prepare for upgrade, you should create a PR applying the changes described above. We done some tests on applying the changes to the current version of Jenkins X/Tekton, and it seemed to work. But - that does not mean it will work on your machines or even pipelines!

So, please prepare for upgrade now! We want people to have a safe upgrade experience. If you have questions, you can find us on [Slack](https://kubernetes.slack.com/messages/C9MBGQJRH).

#### Cannot resolve DNS hostname outside of cluster
With the recent upgrade of base image of ghcr.io/jenkins-x/jx-boot:3.2.338 to alpine linux v3.15 in some of the local providers like minikube, the pod's DNS nameserver is not able to resolve DNS hostname outside k8s cluster like github.com.

To resolve this issue you need to add [custom dnspolicy](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy) on your local cluster repository in below files with this change
```yaml
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to change the dns settings in the minikube cluster itself?

Copy link
Author

Choose a reason for hiding this comment

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

yes it is possible and even I have raised a corresponding PR . But it will be specific to minikube and as you pointed out before, these changes cannot be merged to the jenkins-x versionStream repo.

Copy link
Member

Choose a reason for hiding this comment

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

I meant if you can change it when creating the minikube cluster (before running jx admin operator and running the boot job).

Copy link
Author

Choose a reason for hiding this comment

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

With further testing, I found some more bugs and above solution is not enough. I'll work upon it in my free time. As of now please do not merge this PR.

dnsPolicy: "None"
dnsConfig:
nameservers:
- 8.8.8.8
options:
- name: ndots
value: "1"
```

1. boot job yaml file which is generated from [cluster git repository](https://github.com/jx3-gitops-repositories/jx3-minikube/blob/main/versionStream/git-operator/job.yaml#L56) replacing `dnsPolicy: ClusterFirst`
2. [PR pipeline](https://github.com/jx3-gitops-repositories/jx3-minikube/blob/main/.lighthouse/jenkins-x/pullrequest.yaml#L31) under `podTemplate`
3. [Release pipeline](https://github.com/jx3-gitops-repositories/jx3-minikube/blob/main/.lighthouse/jenkins-x/release.yaml#L32) under `podTemplate`

To see examples of what changes you need to apply to your cluster git repository you may investigate this [PR](https://github.com/jx3-gitops-repositories/jx3-minikube/pull/7/files)