metallb-operator icon indicating copy to clipboard operation
metallb-operator copied to clipboard

Deploying metallb components in a cluster via metallb-operator not works

Open roopeshsn opened this issue 1 year ago • 3 comments

The steps I followed are,

  1. Installed operator-lifecycle-manager through the below command,
curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.26.0/install.sh | bash -s v0.26.0
  1. Installed the operator itself,
kubectl create -f https://operatorhub.io/install/metallb-operator.yaml
  1. Created a namespace metallb-system
  2. Applied the custom resource manifest of kind MetalLB
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb-operator/main/config/samples/metallb.yaml

But after doing the above steps the operator didn't create controller deployment or speaker daemonset. I checked both metallb-system and operators namespaces.

roopesh@roopesh-mi-notebook-14:~/kind$ kubectl get all -n operators
NAME                                                      READY   STATUS    RESTARTS   AGE
pod/metallb-operator-controller-manager-8fc456569-2d7qh   1/1     Running   0          27m
pod/metallb-operator-webhook-server-6d7978fb9f-v6tr9      1/1     Running   0          27m

NAME                                                  TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE
service/metallb-operator-controller-manager-service   ClusterIP   10.96.238.122   <none>        443/TCP   27m
service/metallb-operator-webhook-server-service       ClusterIP   10.96.94.182    <none>        443/TCP   27m
service/metallb-operator-webhook-service              ClusterIP   10.96.178.56    <none>        443/TCP   27m
service/webhook-service                               ClusterIP   10.96.72.44     <none>        443/TCP   27m

NAME                                                  READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/metallb-operator-controller-manager   1/1     1            1           27m
deployment.apps/metallb-operator-webhook-server       1/1     1            1           27m

NAME                                                            DESIRED   CURRENT   READY   AGE
replicaset.apps/metallb-operator-controller-manager-8fc456569   1         1         1       27m
replicaset.apps/metallb-operator-webhook-server-6d7978fb9f      1         1         1       27m

roopesh@roopesh-mi-notebook-14:~/kind$ kubectl get all -n metallb-system
No resources found in metallb-system namespace

roopeshsn avatar Jan 17 '24 04:01 roopeshsn

@roopeshsn do you still have the issue? If so, can you provide the logs of the metallb-operator-controller-manager pod?

fedepaol avatar Apr 15 '24 09:04 fedepaol

Heya @fedepaol - I think I'm seeing the same issue setting up a test env - logs as requested

kubectl logs  metallb-operator-controller-manager-588bfc459c-pscjz -n operators
2024-04-28T10:18:13Z    INFO    setup   git commit:     {"id": "=dev"}
2024-04-28T10:18:13Z    INFO    controller-runtime.metrics      Metrics server is starting to listen    {"addr": ":0"}
2024-04-28T10:18:13Z    INFO    platform        detecting platform version...
2024-04-28T10:18:13Z    INFO    platform        PlatformInfo [Name: Kubernetes, K8SVersion: 1.25, OS: linux/amd64]
2024-04-28T10:18:13Z    INFO    setup   starting manager
2024-04-28T10:18:13Z    INFO    setup   waiting to create operator webhook for MetalLB CR
2024-04-28T10:18:13Z    INFO    setup   creating operator webhook for MetalLB CR
2024-04-28T10:18:13Z    INFO    controller-runtime.builder      skip registering a mutating webhook, object does not implement admission.Defaulter or WithDefaulter wasn't called       {"GVK": "metallb.io/v1beta1, Kind=MetalLB"}
2024-04-28T10:18:13Z    INFO    starting server {"path": "/metrics", "kind": "metrics", "addr": "[::]:38615"}
2024-04-28T10:18:13Z    INFO    controller-runtime.builder      Registering a validating webhook        {"GVK": "metallb.io/v1beta1, Kind=MetalLB", "path": "/validate-metallb-io-v1beta1-metallb"}
I0428 10:18:13.808377       1 leaderelection.go:245] attempting to acquire leader lease operators/metallb.io.metallboperator...
2024-04-28T10:18:13Z    INFO    controller-runtime.webhook.webhooks     Starting webhook server
2024-04-28T10:18:13Z    INFO    controller-runtime.webhook      Registering webhook     {"path": "/validate-metallb-io-v1beta1-metallb"}
2024-04-28T10:18:13Z    INFO    setup   operator webhook for MetalLB CR is created
2024-04-28T10:18:13Z    INFO    controller-runtime.certwatcher  Updated current TLS certificate
2024-04-28T10:18:13Z    INFO    controller-runtime.webhook      Serving webhook server  {"host": "", "port": 9443}
2024-04-28T10:18:13Z    INFO    controller-runtime.certwatcher  Starting certificate watcher
I0428 10:18:13.826734       1 leaderelection.go:255] successfully acquired lease operators/metallb.io.metallboperator
2024-04-28T10:18:13Z    DEBUG   events  metallb-operator-controller-manager-588bfc459c-pscjz_798b440b-a9ea-4882-b849-c5e518e943ab became leader {"type": "Normal", "object": {"kind":"Lease","namespace":"operators","name":"metallb.io.metallboperator","uid":"8c83120d-3897-4669-8656-18c93c045667","apiVersion":"coordination.k8s.io/v1","resourceVersion":"8590"}, "reason": "LeaderElection"}
2024-04-28T10:18:13Z    INFO    Starting EventSource    {"controller": "metallb", "controllerGroup": "metallb.io", "controllerKind": "MetalLB", "source": "kind source: *v1beta1.MetalLB"}
2024-04-28T10:18:13Z    INFO    Starting Controller     {"controller": "metallb", "controllerGroup": "metallb.io", "controllerKind": "MetalLB"}
2024-04-28T10:18:13Z    INFO    Starting workers        {"controller": "metallb", "controllerGroup": "metallb.io", "controllerKind": "MetalLB", "worker count": 1}

NS contents

[0.186s] ubuntu@bastion:~/setup/1-metallb$ kubectl get all -n operators
NAME                                                       READY   STATUS    RESTARTS   AGE
pod/metallb-operator-controller-manager-588bfc459c-pscjz   1/1     Running   0          34m
pod/metallb-operator-webhook-server-7cd898dc48-cxx6t       1/1     Running   0          34m

NAME                                                  TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE
service/metallb-operator-controller-manager-service   ClusterIP   10.43.56.208    <none>        443/TCP   34m
service/metallb-operator-webhook-server-service       ClusterIP   10.43.233.227   <none>        443/TCP   34m
service/metallb-operator-webhook-service              ClusterIP   10.43.181.140   <none>        443/TCP   34m
service/metallb-webhook-service                       ClusterIP   10.43.166.164   <none>        443/TCP   34m

NAME                                                  READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/metallb-operator-controller-manager   1/1     1            1           34m
deployment.apps/metallb-operator-webhook-server       1/1     1            1           34m

NAME                                                             DESIRED   CURRENT   READY   AGE
replicaset.apps/metallb-operator-controller-manager-588bfc459c   1         1         1       34m
replicaset.apps/metallb-operator-webhook-server-7cd898dc48       1         1         1       34m
[0.182s] ubuntu@bastion:~/setup/1-metallb$ kubectl get all -n metallb-system
No resources found in metallb-system namespace.
```

Running on v1.25.3+rke2r1

HTH

ianibo avatar Apr 28 '24 10:04 ianibo

For anyone else that lands here - reading https://github.com/metallb/metallb-operator/issues/226 and a few other issues helped a lot. It seems that the docs on operators are unhelpful to suggest creating a metallb-system ns.

Creating the MetalLB resource in the operators namespace

apiVersion: metallb.io/v1beta1
kind: MetalLB
metadata:
  name: metallb
  namespace: operators

Properly created all reources, then creating a pool also in the operators namespace has everything working as expected. GL!

ianibo avatar Apr 30 '24 09:04 ianibo