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

Add preflight network resource support for custom_cni #11432

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HoKim98
Copy link
Contributor

@HoKim98 HoKim98 commented Aug 8, 2024

PR Type

/kind feature

What this PR Does / Why We Need It

  • Enables the deployment of network resources such as CRDs prior to CNI

Which Issue(s) this PR Fixes

Fixes #

Special Notes for Your Reviewer

I want to enable the serviceMonitor option when installing Cilium CNI as custom_cni. However, I couldn't find a way to deploy the ServiceMonitor CRD prior to CNI installation. So I want to add a feature to deploy the prerequisite resources that should be deployed before the CNI during the custom_cni deployment process.

Additionally, I have prepared a new PR to enable pre-deployment of Ansible Roles if the pre-deployment feature for resources is merged in any form (custom_cni, generic, ...). This was necessary because while deploying Cilium CNI, I encountered an issue where the deployment of hubble-relay failed due to CoreDNS not being active when the peer service was enabled on cilium-agent. This PR aims to address that problem.

Does this PR Introduce a User-Facing Change?

No, this new method is managed by new variable custom_cni_preflight_templates.

Add preflight network resource support for custom_cni: `custom_cni_preflight_templates`

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 8, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: HoKim98
Once this PR has been reviewed and has the lgtm label, please assign oomichi for approval. For more information see the Kubernetes Code Review Process.

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

@HoKim98 HoKim98 changed the title feat(cni): add preflight network resource support for custom_cni Add preflight network resource support for custom_cni Aug 8, 2024
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 8, 2024
@k8s-ci-robot
Copy link
Contributor

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

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 8, 2024
---
- name: Custom CNI | Preflight | Start Resources
kube:
namespace: "kube-system"
Copy link
Contributor

Choose a reason for hiding this comment

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

is the namespace also set to kube-system in other cni/network plugin deployments?

Copy link
Contributor Author

@HoKim98 HoKim98 Aug 8, 2024

Choose a reason for hiding this comment

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

Hardcoding the namespace is definitely not appropriate. Therefore, I have modified and rebased the code to allow setting the namespace in the ".namespace" format! However, generally, CNIs are deployed in the kube-system namespace. Thus, if the namespace is not specified, I have adjusted it to use kube-system as the default.

@ant31
Copy link
Contributor

ant31 commented Aug 8, 2024

/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. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 8, 2024
@tico88612
Copy link
Member

I think it's a nice feature, but I don't think it needs to be limited to custom_cni?

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 8, 2024
@HoKim98 HoKim98 changed the title Add preflight network resource support for custom_cni Add preflight tasks support for custom_cni Aug 8, 2024
@HoKim98 HoKim98 force-pushed the feat/add-preflight-network-resource-support-for-custom_cni branch from d3d38c8 to 155fb83 Compare August 8, 2024 15:29
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 8, 2024
@HoKim98 HoKim98 changed the title Add preflight tasks support for custom_cni Add preflight network resource support for custom_cni Aug 8, 2024
@HoKim98
Copy link
Contributor Author

HoKim98 commented Aug 8, 2024

I agree that using the CNI deployment method managed by Kubespray, as in the case of custom_cni, would be convenient for users. However, I am concerned that this might prevent the development of pre-deployment features that many might need, by providing a new workaround for users to solve issues themselves instead of reporting them to the community. If this concern of mine is unfounded (or not something I should worry about), I am willing to modify the code to apply it to all CNIs!

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/feature Categorizes issue or PR as related to a new feature. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants