设置ipvs

kubectl edit configmap -n kube-system kube-proxy

如下

apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
mode: "ipvs"
ipvs:
  strictARP: true

添加到kubeadm-config中

kubectl get configmap kube-proxy -n kube-system -o yaml | \
sed -e "s/strictARP: false/strictARP: true/" | \
kubectl diff -f - -n kube-system

# actually apply the changes, returns nonzero returncode on errors only
kubectl get configmap kube-proxy -n kube-system -o yaml | \
sed -e "s/strictARP: false/strictARP: true/" | \
kubectl apply -f - -n kube-system

开始安装

kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.9.5/manifests/namespace.yaml
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.9.5/manifests/metallb.yaml
# On first install only
kubectl create secret generic -n metallb-system memberlist --from-literal=secretkey="$(openssl rand -base64 128)"
[root@k8s-60 MetalLB]# kubectl get pods -n metallb-system 
NAME                          READY   STATUS    RESTARTS   AGE
controller-65db86ddc6-bj6q9   1/1     Running   0          75s
speaker-9dlgc                 1/1     Running   0          75s
speaker-qj2zw                 1/1     Running   0          75s
speaker-x46vj                 1/1     Running   0          75s

官方参考链接

https://metallb.universe.tf/installation/
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐