Skip to content

Comments

bug 2005901: staticpod builder: initialize operand label selector separately#1281

Merged
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
ingvagabund:staticpod-with-operand-label-selector
Jan 11, 2022
Merged

bug 2005901: staticpod builder: initialize operand label selector separately#1281
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
ingvagabund:staticpod-with-operand-label-selector

Conversation

@ingvagabund
Copy link
Member

@ingvagabund ingvagabund commented Jan 10, 2022

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.

Required by openshift/cluster-kube-apiserver-operator#1275.

@openshift-ci openshift-ci bot added bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Jan 10, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 10, 2022

@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
  • bug is open, matching expected state (open)
  • bug target release (4.10.0) matches configured target release for branch (4.10.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @kasturinarra

Details

In response to this:

bug 2005901: staticpod builder: initialize operand label selector separately

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.

@openshift-ci openshift-ci bot requested a review from kasturinarra January 10, 2022 14:52
@ingvagabund
Copy link
Member Author

/hold
waiting until tests in openshift/cluster-kube-apiserver-operator#1275 go green

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 10, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 10, 2022

@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 /bugzilla refresh.

Details

In response to this:

bug 2005901: staticpod builder: initialize operand label selector separately

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.

@openshift-ci openshift-ci bot requested review from p0lyn0mial and sttts January 10, 2022 14:55
WithInstaller(command []string) Builder
WithMinReadyDuration(minReadyDuration time.Duration) Builder
WithStartupMonitor(enabledStartupMonitor func() (bool, error), operandPodLabelSelector labels.Selector) Builder
WithStartupMonitor(enabledStartupMonitor func() (bool, error)) Builder
Copy link
Contributor

Choose a reason for hiding this comment

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

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())

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes.

b.eventRecorder,
), 1)
if b.operandPodLabelSelector.Empty() {
eventRecorder.Warning("OperandPodLabelMissing", "not enough information provided, not all functionality is present")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should return an error since we need a way to find the operand.

Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

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).

Copy link
Member Author

Choose a reason for hiding this comment

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

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.

@ingvagabund
Copy link
Member Author

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 11, 2022
@ingvagabund
Copy link
Member Author

@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 staticPodFallbackConditionController as I am not fully familiar with the expected functionality and whether the restriction can be relaxed or replaced by what is already wired to the controller. Nevertheless, the guard controller is mirroring the operand pods and it needs to know exactly the difference as each operand pod can have any combination of labels.

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.
@ingvagabund ingvagabund force-pushed the staticpod-with-operand-label-selector branch from c911d23 to 4c466c2 Compare January 11, 2022 12:49
@p0lyn0mial
Copy link
Contributor

/lgtm
/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 11, 2022

[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

Details 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

@openshift-ci openshift-ci bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 11, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 11, 2022

@ingvagabund: all tests passed!

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit 7f25b9c into openshift:master Jan 11, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 11, 2022

@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 refresh.

Bugzilla bug 2005901 has not been moved to the MODIFIED state.

Details

In response to this:

bug 2005901: staticpod builder: initialize operand label selector separately

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants