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

Enable kube-proxy replacement if no kube-proxy is detected in a cluster #1039

Merged
merged 1 commit into from
Aug 25, 2022

Conversation

ksankeerth
Copy link
Contributor

Previously, Cilium-CLI won’t enable kube-proxy by default automatically if no kube-proxy has been installed in the cluster. This patch will detect kube-proxy installation in the cluster automatically and it’ll set the helm value kubeProxyReplacement=strict if there were no kube-proxy.

Fixes: #1004

@ksankeerth
Copy link
Contributor Author

Hi Team,
Please check the changes and let me know if any improvements to be done for this PR. Thanks

Copy link
Member

@brb brb left a comment

Choose a reason for hiding this comment

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

Thanks. Some comment re the kube-apiserver endpoint addr.

install/autodetect.go Outdated Show resolved Hide resolved
@ksankeerth ksankeerth temporarily deployed to ci August 23, 2022 02:06 Inactive
@ksankeerth ksankeerth requested a review from a team as a code owner August 23, 2022 02:52
@ksankeerth ksankeerth temporarily deployed to ci August 23, 2022 02:52 Inactive
k8s/client.go Show resolved Hide resolved
install/autodetect.go Outdated Show resolved Hide resolved
@maintainer-s-little-helper
Copy link

Commit 4bc875b does not contain "Signed-off-by".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

Previously, Cilium-CLI won’t enable kube-proxy by default automatically if no kube-proxy has been installed in the cluster. This patch will detect kube-proxy installation in the cluster automatically and it’ll set the helm values kubeProxyReplacement=strict, k8sServiceHost, and  k8sServicePort  if there were no kube-proxy.

Fixes: cilium#1004
Signed-off-by: shankeerthan-kasilingam <shankeerthan1995@gmail.com>
@ksankeerth ksankeerth temporarily deployed to ci August 25, 2022 02:17 Inactive
Copy link
Member

@tklauser tklauser left a comment

Choose a reason for hiding this comment

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

Thank you @ksankeerth!

@tklauser tklauser merged commit c62a3f6 into cilium:master Aug 25, 2022
@ksankeerth ksankeerth deleted the dev-1004 branch August 25, 2022 13:34
}

for _, ds := range dsList.Items {
if strings.Contains(ds.Name, "kube-proxy") {
Copy link

Choose a reason for hiding this comment

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

maybe we should use if ds.Nmae == "kube-proxy" instead of strings.Contains?

Copy link
Contributor Author

@ksankeerth ksankeerth Sep 3, 2022

Choose a reason for hiding this comment

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

@cmssczy thanks for the suggestion. Yes, the Kube-proxy auto-detection may take a different DaemonSet as Kube-Proxy if they also contain "kube-proxy". Just for curiosity, have you found such cases like that? @brb wdyt?

Copy link
Member

Choose a reason for hiding this comment

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

I've only seen "kube-proxy", so the suggested change makes sense to me.

Copy link
Contributor Author

@ksankeerth ksankeerth Sep 8, 2022

Choose a reason for hiding this comment

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

Thanks @brb. If you think it's to better to change now, I can create a git Issue for that since we already merged this branch? (I can fix that too)

Copy link
Member

Choose a reason for hiding this comment

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

I think it faster to create a PR than an issue, so I'd go with a fix. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable kube-proxy replacement if no kube-proxy is detected in a cluster
4 participants