Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1903717

Summary: Handle different Pod selectors for metal3 Deployment
Product: OpenShift Container Platform Reporter: Zane Bitter <zbitter>
Component: Bare Metal Hardware ProvisioningAssignee: Beth White <beth.white>
Bare Metal Hardware Provisioning sub component: cluster-baremetal-operator QA Contact: Ori Michaeli <omichael>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: urgent CC: aos-bugs, dhellmann, rbartal
Version: 4.7   
Target Milestone: ---   
Target Release: 4.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-24 15:37:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1903700    

Description Zane Bitter 2020-12-02 17:08:34 UTC
According to https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#creating-a-deployment, kubernetes requires that each Deployment have a unique Pod selector:

> Do not overlap labels or selectors with other controllers (including other
> Deployments and StatefulSets). Kubernetes doesn't stop you from overlapping,
> and if multiple controllers have overlapping selectors those controllers might
> conflict and behave unexpectedly.

However, the metal3 Deployment managed by the cluster-baremetal-operator does *not* have a unique Pod selector. It only selects for the label "k8s-app=controller", which is also present on the machine-api-controllers Deployment managed by the machine-api-operator in the same namespace (openshift-machine-api).

Unfortunately the Pod selector for a Deployment is immutable, so there is no way to update it without deleting and recreating the Deployment.

We intend to update the selector in OpenShift 4.8 (it cannot be done in 4.7 because of reasons) - see bug 1903700. To handle downgrades from 4.8 to 4.7, cluster-baremetal-operator in 4.7 must be able to deal with finding a different selector from the current "k8s-app=controller" in the Deployment without trying to reset it (which will fail).

Ideally this would also enable us to create the Deployment with a unique selector when 4.7 is being installed from scratch rather than upgraded from 4.6.

Comment 5 errata-xmlrpc 2021-02-24 15:37:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:5633