Upgrading the MetalLB Operator
The Subscription custom resource (CR) for the MetalLB Operator is used to manage whether the Operator is upgraded automatically or manually.
By default, the Subscription CR assigns the namespace to metallb-system and automatically sets the installPlanApproval parameter to Automatic. This means that when Red Hat-provided Operator catalogs include a newer version of the MetalLB Operator, the MetalLB Operator is automatically upgraded.
If you need to manually control upgrading the MetalLB Operator, set the installPlanApproval parameter to Manual.
Manually upgrading the MetalLB Operator
To manually control when the MetalLB Operator upgrades in OpenShift Container Platform, you set installPlanApproval to Manual in the Subscription custom resource and approve the install plan. You then verify the upgrade by using the ClusterServiceVersion status.
-
You updated your cluster to the latest z-stream release.
-
You used the software catalog to install the MetalLB Operator.
-
Access the cluster as a user with the
cluster-adminrole.
-
Get the YAML definition of the
metallb-operatorsubscription in themetallb-systemnamespace by entering the following command:$ oc -n metallb-system get subscription metallb-operator -o yaml -
Edit the
SubscriptionCR by setting theinstallPlanApprovalparameter toManual:apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: metallb-operator namespace: metallb-system # ... spec: channel: stable installPlanApproval: Manual name: metallb-operator source: redhat-operators sourceNamespace: openshift-marketplace # ... -
Find the latest OpenShift Container Platform 4.19 version of the MetalLB Operator by entering the following command:
$ oc -n metallb-system get csv -
Check the install plan that exists in the namespace by entering the following command.
$ oc -n metallb-system get installplanExample output that shows install-tsz2g as a manual install planNAME CSV APPROVAL APPROVED install-shpmd metallb-operator.v4.19.0-202502261233 Automatic true install-tsz2g metallb-operator.v4.19.0-202503102139 Manual false -
Edit the install plan that exists in the namespace by entering the following command. Ensure that you replace
<name_of_installplan>with the name of the install plan, such asinstall-tsz2g.$ oc edit installplan <name_of_installplan> -n metallb-system-
With the install plan open in your editor, set the
spec.approvalparameter toManualand set thespec.approvedparameter totrue.Note
After you edit the install plan, the upgrade operation starts. If you enter the
oc -n metallb-system get csvcommand during the upgrade operation, the output might show theReplacingor thePendingstatus.
-
-
To verify that the Operator is upgraded, enter the following command and then check that output shows
Succeededfor the Operator:$ oc -n metallb-system get csv