Install MetalLB Operator
-
Create the
MetalLB
Operator namespace:cat << EOF | oc apply -f - apiVersion: v1 kind: Namespace metadata: name: metallb-system EOF
-
Verify the namespace is created:
oc get ns metallb-system -o custom-columns=Name:.metadata.name,Status:.status.phase
Sample outputName Status metallb-system Active
-
Create the OperatorGroup:
cat << EOF | oc apply -f - apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: metallb-operator namespace: metallb-system EOF
-
Confirm the OperatorGroup is installed in the namespace:
oc get operatorgroup -n metallb-system
Sample OutputNAME AGE metallb-operator 5s
-
Subscribe to the metallb Operator:
cat << EOF| oc apply -f - apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: metallb-operator-sub namespace: metallb-system spec: channel: stable name: metallb-operator source: redhat-operators sourceNamespace: openshift-marketplace EOF
-
Confirm the metallb installplan is in the namespace:
oc get installplan -n metallb-system
-
Confirm the metallb operator is installed:
oc get clusterserviceversion -n metallb-system -o custom-columns=Name:.metadata.name,Phase:.status.phase
-
Repeat the query until the Phase is Succeeded.
Sample OutputName Phase metallb-operator.v4.13.0-202404030309 Succeeded
Track the progress using below command:
while ! (oc get clusterserviceversion -n metallb-system -o custom-columns=Name:.metadata.name,Phase:.status.phase | grep metallb-operator | grep Succeeded); do oc get clusterserviceversion -n metallb-system; sleep 5; done
-
Create a single instance of a metallb resource:
cat << EOF | oc apply -f - apiVersion: metallb.io/v1beta1 kind: MetalLB metadata: name: metallb namespace: metallb-system EOF
-
Verify that the deployment for the controller is running:
oc get deployment -n metallb-system controller
-
Repeat the command until AVAILABLE is 1
Sample OutputNAME READY UP-TO-DATE AVAILABLE AGE controller 1/1 1 1 21s
-
Verify that the daemon set for the speaker is running:
oc get daemonset -n metallb-system speaker
Sample Outputoc get daemonset -n metallb-system speaker NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE speaker 6 6 6 6 6 kubernetes.io/os=linux 55s
Reference: see Installing the MetalLB Operator in the RHOCP Networking guide