请问是否有rke2集群使用MetalLB的教程

环境信息:
RKE2 版本: 1.24.11

集群配置:
虚拟化平台:VMware 7.0
操作系统:Ubuntu 22.04
3 servers, 4 agents

问题描述:
我是用应用中心安装了metallb 0.13.10,但我尝试创建一个LoadBalancer时,一直处于pending状态。
服务的描述信息如图:


请问是否有相关的更详细的教程?

rke2 安装 metallb 参考 metallb 官网文档安装即可:

rke2 基础信息
root@rke2-1:~# rke2 --version
rke2 version v1.25.10+rke2r1 (e0c376c606754f1ae6a1c2401f4f6e9146bda0f3)
go version go1.19.9 X:boringcrypto
root@rke2-1:~#
root@rke2-1:~# kubectl get nodes
NAME     STATUS   ROLES                       AGE   VERSION
rke2-1   Ready    control-plane,etcd,master   46m   v1.25.10+rke2r1
安装 metallb
root@rke2-1:~# kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.13.10/config/manifests/metallb-native.yaml

root@rke2-1:~# kubectl apply -f - <<EOF
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
  name: first-pool
  namespace: metallb-system
spec:
  addresses:
  - 192.168.205.240-192.168.205.250
EOF

root@rke2-1:~# kubectl apply -f - <<EOF
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
  name: example
  namespace: metallb-system
EOF
验证
root@rke2-1:~# kubectl apply -f - <<EOF
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: nginx
spec:
  type: LoadBalancer
  selector:
    app: nginx
  ports:
    - port: 80
      targetPort: 80
EOF
root@rke2-1:~# kubectl get svc
NAME         TYPE           CLUSTER-IP    EXTERNAL-IP       PORT(S)        AGE
kubernetes   ClusterIP      10.43.0.1     <none>            443/TCP        49m
nginx        LoadBalancer   10.43.228.4   192.168.205.240   80:32450/TCP   14m
root@rke2-1:~#
root@rke2-1:~# curl http://192.168.205.240
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>

谢谢了,配置成功了。