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

[2.17] fix imageRepository path for CoreDNS v1.8.0 #8182 #8183

Conversation

sebfere
Copy link

@sebfere sebfere commented Nov 10, 2021

Thanks to the fix, I can now deploy the Kubernetes cluster as kubeadm can download the coredns image.
Resulting /etc/kubernetes/kubeadm-images.yaml:

apiVersion: kubeadm.k8s.io/v1beta2
kind: InitConfiguration
nodeRegistration:
  criSocket: /var/run/containerd/containerd.sock
---
apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
imageRepository: k8s.gcr.io
kubernetesVersion: v1.21.6
etcd:
  local:
    imageRepository: "quay.io/coreos"
    imageTag: "v3.4.13"
dns:
  type: CoreDNS
  imageRepository: k8s.gcr.io/coredns
  imageTag: v1.8.0

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please sign in with your organization's credentials at https://identity.linuxfoundation.org/projects/cncf to be authorized.
  • If you have done the above and are still having issues with the CLA being reported as unsigned, please log a ticket with the Linux Foundation Helpdesk: https://support.linuxfoundation.org/
  • Should you encounter any issues with the Linux Foundation Helpdesk, send a message to the backup e-mail support address at: [email protected]

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 10, 2021
@k8s-ci-robot
Copy link
Contributor

Welcome @sebfere!

It looks like this is your first PR to kubernetes-sigs/kubespray 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kubespray has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @sebfere. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 10, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sebfere
To complete the pull request process, please assign chadswen after the PR has been reviewed.
You can assign the PR to them by writing /assign @chadswen in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sebfere
Copy link
Author

sebfere commented Nov 10, 2021

CLA done.

@floryut
Copy link
Member

floryut commented Nov 12, 2021

I'll review this next week but I don't see why would this be needed as coredns 1.8.0 is set for a long time in master without any issue 🤔

Copy link
Contributor

@oomichi oomichi left a comment

Choose a reason for hiding this comment

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

@MRoci Please take a look at this if possible.

@@ -21,5 +21,5 @@ etcd:
{% endif %}
dns:
type: CoreDNS
imageRepository: {{ coredns_image_repo | regex_replace('/coredns.*$','') }}
imageRepository: {{ coredns_image_repo | regex_replace('/coredns$','') }}
Copy link
Contributor

@oomichi oomichi Nov 15, 2021

Choose a reason for hiding this comment

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

The above has been updated since #7570 for coredns versions <=1.7.0.
It would be safer to have some condition for switching the above for versions.

@oomichi
Copy link
Contributor

oomichi commented Nov 15, 2021

/check-cla

Copy link
Contributor

@MRoci MRoci left a comment

Choose a reason for hiding this comment

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

with kubernetes/kubernetes@38a41e1 and kubernetes release 1.21.2 kubeadm's constant CoreDNSImageName has been changed from coredns/coredns to coredns.

Because of that setting imageRepository to k8s.gcr.io/coredns to pull k8s.gcr.io/coredns/coredns:v1.8.0 makes sense to me, but from what i see this should be handled automatically by kubeadm itself and this change should not be necessary

@floryut floryut changed the title fix imageRepository path for CoreDNS v1.8.0 #8182 [2.17] fix imageRepository path for CoreDNS v1.8.0 #8182 Nov 18, 2021
@floryut
Copy link
Member

floryut commented Nov 18, 2021

Anyway, this won't be merged as long as it's not done in master prior to release branch
/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 18, 2021
@kien-truong
Copy link

kien-truong commented Jan 4, 2022

@MRoci

Because of that setting imageRepository to k8s.gcr.io/coredns to pull k8s.gcr.io/coredns/coredns:v1.8.0 makes sense to me, but from what i see this should be handled automatically by kubeadm itself and this change should not be necessary

It's in the commit you mentioned: kubeadm will only prepend the namespace automatically when using the default repository.
So k8s.gcr.io will be transformed into k8s.gcr.io/coredns, but abc.xyz will NOT be converted to abc.xyz/coredns.
If the user wants to use a custom repository like abc.xyz, then the generated kubeadm config file should say abc.xyz/coredns

@sebfere
Would you mind opening a pull request against master branch ? 2.18 is about to be released and should contain this fix.

@MRoci
Copy link
Contributor

MRoci commented Jan 11, 2022

@kien-truong

It's in the commit you mentioned: kubeadm will only prepend the namespace automatically when using the default repository. So k8s.gcr.io will be transformed into k8s.gcr.io/coredns, but abc.xyz will NOT be converted to abc.xyz/coredns. If the user wants to use a custom repository like abc.xyz, then the generated kubeadm config file should say abc.xyz/coredns

for custom repositories for sure but as per #8182 this problem affects also users that have the default imageRepository setting (k8s.gcr.io) which should not be the case since it should be handled by kubeadm.

I think that it can be caused when trying to pull coredns:v1.8 with kubeadm<=1.20 which stil expects the old k8s.gcr.io./coredns:1.xx format and also by default ships coredns:v1.7

WIth this fix imageRepository will be set to k8s.gcr.io/coredns being unable to use CoreDNS versions previous than 1.7 and breaking with kubeadm 1.21.0 and 1.21.1 since they have hardcoded the image name as coredns/coredns

@kien-truong
Copy link

I think that it can be caused when trying to pull coredns:v1.8 with kubeadm<=1.20 which stil expects the old k8s.gcr.io./coredns:1.xx format and also by default ships coredns:v1.7

Doesn't Kupespray automatically update Kubeadm to the correct version of Kubeadm during deployment ?
Unless the users have a different kubeadm in PATH that shadow Kubespray's , in which case maybe Kubespray should give a warning.

WIth this fix imageRepository will be set to k8s.gcr.io/coredns being unable to use CoreDNS versions previous than 1.7 and breaking with kubeadm 1.21.0 and 1.21.1 since they have hardcoded the image name as coredns/coredns

CoreDNS <= 1.7 is already handled per the existing code, and I think Kubeadm 1.21.0 and 1.21.1 can be checked similarly.

coredns_image_is_namespaced: "{{ (kube_version is version('v1.21.0','>=')) or (coredns_version is version('v1.7.1','>=')) }}"
coredns_image_repo: "{{ kube_image_repo }}{{'/coredns/coredns' if (coredns_image_is_namespaced | bool) else '/coredns' }}"

@MRoci
Copy link
Contributor

MRoci commented Jan 11, 2022

@kien-truong
given the fact that for newer versions of kubeadm and coredns it should work either if imageRepository is set to k8s.gcr.io or k8s.gcr.io/coredns maybe in order to use the default k8s.gcr.io, k8s.gcr.io/coredns can be set when kube_version<=1.20 and coredns>=1.8

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 11, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 11, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closed this PR.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants