-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Using leader election with webhook manager #356
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
Comments
So, we shouldn't do that, since webhooks support active-active HA quite easily. It should be possible to start the webhook server without starting the controllers. For that we probably need the concept of things which are active-passive vs active-active. @mengqiy FYI |
/kind bug This is something we intended to work properly, but doesn't, so I'm treating it as a bug here. |
@DirectXMan12 I have the problem similar to @SchSeba said, but i use name: manager
readinessProbe:
tcpSocket:
port: 9876
initialDelaySeconds: 5
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
timeoutSeconds: 2 This's works ok for me, but i see manager have the Can we add a health check api in webhook, and user can add |
that's a different issue, but yeah, we definitely want to support registering generic health checks, etc. |
@DirectXMan12 If use leader election with manager, the That's good If it support health checks, but before support health checks, i maybe needs above method, otherwise the service connection refused. If you know other ways to solve it, hope you can tell me, thanks. Are there any related documents or links about health checks? |
@DirectXMan12 So we want to start the webhooks and managers everywhere, and not let the leader election block it. But let the non-leader ones be passive. IIUC? |
maybe we can implement it in a different way. if we want only the leader to be active for the webhook we can create the service with a special label and when we took the leader it will update the pod with the relevant label? |
Basically: Start the manager everywhere. For most (I'd hazard all, but you never know) you want the webhook to be active on every replica (webhooks are almost always stateless), but you want the controllers to only be active on the leader replica. |
Closing by #424 |
When we create a manager with leader election and a webhook only one manager start but looking into the service the manger creates for the webhook he add all the pod.
Proposed solution:
Use the label statefulset.kubernetes.io/pod-name= for the webhook service and when the election change update the service label(or recreate the service)
More general solution can be to have a general label like
controller-leader
and just update the leader pod with this label.The text was updated successfully, but these errors were encountered: