bug 2005901: staticpod builder: initialize operand label selector separately#1281
Conversation
|
@ingvagabund: This pull request references Bugzilla bug 2005901, which is valid. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn 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/test-infra repository. |
|
/hold |
|
@ingvagabund: An error was encountered querying GitHub for users with public email (knarra@redhat.com) for bug 2005901 on the Bugzilla server at https://bugzilla.redhat.com. No known errors were detected, please see the full error message for details. Full error message.
non-200 OK status code: 403 Forbidden body: "{\n \"documentation_url\": \"https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits\",\n \"message\": \"You have exceeded a secondary rate limit. Please wait a few minutes before you try again.\"\n}\n"
Please contact an administrator to resolve this issue, then request a bug refresh with DetailsIn 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/test-infra repository. |
| WithInstaller(command []string) Builder | ||
| WithMinReadyDuration(minReadyDuration time.Duration) Builder | ||
| WithStartupMonitor(enabledStartupMonitor func() (bool, error), operandPodLabelSelector labels.Selector) Builder | ||
| WithStartupMonitor(enabledStartupMonitor func() (bool, error)) Builder |
There was a problem hiding this comment.
so it will become:
staticPodControllers, err := staticpod.NewBuilder(operatorClient, kubeClient, kubeInformersForNamespaces).
...
WithStartupMonitor(startupmonitorreadiness.IsStartupMonitorEnabledFunction(configInformers.Config().V1().Infrastructures().Lister(), operatorClient)).
WithOperandPodLabelSelector(labels.Set{"apiserver": "true"}.AsSelector())
| b.eventRecorder, | ||
| ), 1) | ||
| if b.operandPodLabelSelector.Empty() { | ||
| eventRecorder.Warning("OperandPodLabelMissing", "not enough information provided, not all functionality is present") |
There was a problem hiding this comment.
I think we should return an error since we need a way to find the operand.
There was a problem hiding this comment.
actually, we could do without the selector. At the moment it is used only in the staticPodFallbackConditionController. In the worst-case scenario, we would loop over all pods in a given namespace.
There was a problem hiding this comment.
As I understand the staticPodFallbackConditionController is narrowly focused on the static pods/operands. So it needs to ignore any other pod. It could incorrectly set the degraded condition otherwise.
There was a problem hiding this comment.
not sure why do we want to fire an event in that case? It will make troubleshooting harder. We should either return an error or let it fall through (previous behavior).
There was a problem hiding this comment.
I do not consider the controller to be crucial. I'd rather set no condition than set it incorrectly. Though, I might be wrong here.
|
/hold cancel |
|
@p0lyn0mial I like the idea of removing the code. Unfortunately, the guard controller needs to target only the operands and ignore everything else. I will not oppose removing the pod label selector from the I might rely on the operand prefix and match the pods based on the prefix. However, using a pod label selector is more intuitive. |
Not every controller consumes operand pod label selector when the StartMonitor is enabled. Also, the operand pod label selector is now required by the guard controller since not every operator has the static pod name equal to the app label. E.g. | operand | label | static pod name | | ------- | ----- | --------------- | | kube-scheduler | app=openshift-kube-scheduler | openshift-kube-scheduler | | kube-controller-manager | app=kube-controller-manager | kube-controller-manager | | kube-apiserver | app=openshift-kube-apiserver | kube-apiserver | In case of KS and KCM both app label and the static pod name are equal. Whereas in the case of KA, the app label differs from the static pod name. Thus, it is more practical to provide the operand pod label selector rather than rely on a specific label.
c911d23 to
4c466c2
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ingvagabund, p0lyn0mial The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@ingvagabund: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. I understand the commands that are listed here. |
|
@ingvagabund: Some pull requests linked via external trackers have merged: The following pull requests linked via external trackers have not merged: These pull request must merge or be unlinked from the Bugzilla bug in order for it to move to the next state. Once unlinked, request a bug refresh with Bugzilla bug 2005901 has not been moved to the MODIFIED state. DetailsIn 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/test-infra repository. |
Not every controller consumes operand pod label selector when the StartMonitor is enabled.
Also, the operand pod label selector is now required by the guard
controller since not every operator has the static pod name
equal to the app label. E.g.
In case of KS and KCM both app label and the static pod name are equal.
Whereas in the case of KA, the app label differs from the static pod
name. Thus, it is more practical to provide the operand pod label selector rather than rely on a specific label.
Required by openshift/cluster-kube-apiserver-operator#1275.