-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🌱 Cache Pods for KCP #11453
🌱 Cache Pods for KCP #11453
Conversation
@fabriziopandini: The
The following commands are available to trigger optional jobs:
Use
In response to this:
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. |
/test? |
@fabriziopandini: The following commands are available to trigger required jobs:
The following commands are available to trigger optional jobs:
Use
In response to this:
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. |
/test pull-cluster-api-e2e-main |
f784a78
to
4e9cb6f
Compare
controlplane/kubeadm/main.go
Outdated
req1, _ := labels.NewRequirement("tier", selection.Equals, []string{"control-plane"}) | ||
req2, _ := labels.NewRequirement("component", selection.In, []string{"kube-apiserver", "kube-controller-manager", "kube-scheduler", "etcd"}) | ||
podSelector := labels.NewSelector().Add(*req1, *req2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We did elsewhere:
req1, _ := labels.NewRequirement("tier", selection.Equals, []string{"control-plane"}) | |
req2, _ := labels.NewRequirement("component", selection.In, []string{"kube-apiserver", "kube-controller-manager", "kube-scheduler", "etcd"}) | |
podSelector := labels.NewSelector().Add(*req1, *req2) | |
must := func(r *labels.Requirement, err error) labels.Requirement { | |
if err != nil { | |
panic(err) | |
} | |
return *r | |
} | |
podSelector := labels.NewSelector().Add( | |
must(labels.NewRequirement("tier", selection.Equals, []string{"control-plane"})), | |
must(labels.NewRequirement("component", selection.In, []string{"kube-apiserver", "kube-controller-manager", "kube-scheduler", "etcd"})), | |
) |
So it also ensures on changes we keep it right :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed,
But we have still 4 places where we are using "req, _ := labels.NewRequirement", I will follow up
4e9cb6f
to
6e059a2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
LGTM label has been added. Git tree hash: b68b8ad8e833d3f737e76112ec301ed4bc762580
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chrischdi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
This PR enable caching for kubeadm static pods only in KCP.
The main reason while we identified this improvement was to improve KCP rollouts when temporary connection issue happens.
With the previous setup, pod where not cached, and thus every KCP reconcile a series of API calls where issues to gather status of the controlplane components in the workload cluster.
However, in case of temporary connection issues, kcp was "freezing" because stuck in a series of get pod--> wait 10s second timeout.
While looking at options to fix this issue, we figured out that by caching selectively the kubeadm Pods we can achieve a good trade off between:
/area provider/control-plane-kubeadm