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

Migrate DNS manifests to kubernetes.core.k8s #10701

Closed

Conversation

VannTen
Copy link
Contributor

@VannTen VannTen commented Dec 7, 2023

What type of PR is this?
/kind cleanup

What this PR does / why we need it:
This converts coredns and nodelocaldns to use kubernetes.core.k8s

Along the way, some template modifications and ansible dark magic in variables to work the same way with --tags/--skip-tags.

Server-side apply with force-conflicts seems approriate for kubespray, as that what is recommended for controller. Happy to hear arguments on that though.

Which issue(s) this PR fixes:

Part of #10696
Should fix #7113
Fix #10860
This is also serve as a concrete example of what I'm thinking with the above issue.

Special notes for your reviewer:
Depend on #11158

Does this PR introduce a user-facing change?:

Coredns and nodelocaldns are applied in one go using server-side apply.

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 7, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @VannTen. 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 7, 2023
@VannTen VannTen force-pushed the cleanup/convert_coredns_core_k8s branch from 0191d66 to 27cd111 Compare December 7, 2023 20:11
@VannTen VannTen changed the title Migrate DNS manifest to kubernetes.core.k8s Migrate DNS manifests to kubernetes.core.k8s Dec 7, 2023
@VannTen VannTen changed the title Migrate DNS manifests to kubernetes.core.k8s WIP: Migrate DNS manifests to kubernetes.core.k8s Dec 7, 2023
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 7, 2023
@VannTen VannTen force-pushed the cleanup/convert_coredns_core_k8s branch 3 times, most recently from 9cb26f4 to 463d321 Compare December 8, 2023 10:39
@yankay
Copy link
Member

yankay commented Dec 11, 2023

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 11, 2023
@poblahblahblah
Copy link
Contributor

Does this PR need any help from outside contributors?

@VannTen
Copy link
Contributor Author

VannTen commented Apr 28, 2024 via email

@VannTen VannTen force-pushed the cleanup/convert_coredns_core_k8s branch from 463d321 to ae6c9d0 Compare May 3, 2024 09:07
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 3, 2024
VannTen added 5 commits May 13, 2024 13:25
Some of coredns templates depend on variables which are defined at the
`template` task level. The consequence is than using the template in
another way (in particular, we want to use the kubernetes.core.k8s
template list feature, see following commits) is difficult.

Loop inside the template rather than doing a separate task. This makes
the template more self-contained and has the added benefits of
deduplicating code.
Put intermediate templates vars in vars/ rather than in facts
Kubectl client-side apply breaks coredns on upgrade because the old and
the new version are not resolved correctly (see
kubernetes/kubernetes#39188 (comment))
TL;DR: the merge key for the port array is only the port number, not
port+protocol.
Server-side apply solves this issue, but our custom kube module is not
server-side apply ready.

While we could improve our custom kube module, it will be a lesser
maintenance load going forward to progressively drop it and switch to
kubernetes.core.k8s, which has more features and is maintained by
upstream.

Do that now for coredns manifests.
Add the python k8s client on the control plane (no need for it
elsewhere), and the python-venv on distributions which need it to create
a virtualenv.
CentOS 7 ships with python2 and does not handle well the infrastructure
introduced in 625ef33 (Add install infra for python_pkgs, 2024-05-02)

Include a workaround for this.

This is kept as a separate commit to be easily revertible, as CentOS 7
EOL is 30/06/2024 (= in less than two months)
Besides the problem with client-side apply explained in previous commit,
we reduce ansible overhead by using the template feature of
kubernetes.core.k8s, which let us supply a list of templates directly,
which are applied all at once.
This considerably reduces the ansible overhead (task scheduling)
@VannTen
Copy link
Contributor Author

VannTen commented May 13, 2024

/remove-kind cleanup
/kind design
/hold cancel

@k8s-ci-robot k8s-ci-robot added kind/design Categorizes issue or PR as related to design. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels May 13, 2024
@VannTen VannTen force-pushed the cleanup/convert_coredns_core_k8s branch from 4cf9c08 to 6913611 Compare May 13, 2024 11:30
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 13, 2024
@VannTen
Copy link
Contributor Author

VannTen commented May 13, 2024

So. Looks like python>=3.8 (or 3.7, not sure) on the host is mostly required for kubernetes.core.k8s (trying with 3.6 I'm going into endless battle with pip.
I'm wondering if we should just drop support for centos7 now

@mzaian @floryut @MrFreezeex @yankay thought ?

@MrFreezeex
Copy link
Member

MrFreezeex commented May 13, 2024

So. Looks like python>=3.8 (or 3.7, not sure) on the host is mostly required for kubernetes.core.k8s (trying with 3.6 I'm going into endless battle with pip. I'm wondering if we should just drop support for centos7 now

Do you want this to be included in the 2.25 release?

If the answer is no, I would say yes for sure since 2.26 will be released after CentOS 7 eol.

If we do want this in 2.25, I guess this could be more nuanced, but IMO it could still be fine to drop CentOS 7, although maybe we want to have more folks testing this before putting it in a release this close?

@VannTen
Copy link
Contributor Author

VannTen commented May 13, 2024 via email

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 13, 2024
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 17, 2024
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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-sigs/prow repository.

when:
- to_install | length != 0
ansible.builtin.pip:
requirements: "{{ kubespray_virtualenvs_base }}/{{ item }}/requirements.txt"
Copy link
Member

Choose a reason for hiding this comment

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

The task pulls and installs Python packages on the fly from the Internet. But what should we do to design for airgap env?
We have made efforts on offline. It now introduces a new resource. That would be nice if you could provide a solution.

Copy link
Contributor Author

@VannTen VannTen May 31, 2024

Choose a reason for hiding this comment

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

I thought to handle this with extra_args and passes --finds-links with either a server containing the necessary wheels in the local network, or a local folder copied over the machine.
I think adding the possibility to inject extra_args would be enough to make the first case possible, correct ? That + adding instructions in docs/operations/offline-environment.md.
Wdyt ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But first I need to make it work in the common case ^

Copy link
Contributor Author

@VannTen VannTen May 31, 2024

Choose a reason for hiding this comment

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

A Wheelhouse also looks like a solution.
The target design should ideally be implementable by only altering pip extra args, with no other changes (additional preparatory steps to make the resources available in the offline envs are ok, in my book)

@k8s-triage-robot
Copy link

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

This bot triages 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 PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this 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 Aug 29, 2024
@k8s-triage-robot
Copy link

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

This bot triages 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 PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle rotten
  • Close this 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 Sep 28, 2024
@k8s-triage-robot
Copy link

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

This bot triages 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 PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this 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 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 PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this 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-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/design Categorizes issue or PR as related to design. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. tide/merge-method-merge Denotes a PR that should use a standard merge by tide when it merges.
Projects
None yet
7 participants