$ kubectl apply -f deployment.yaml deployment.apps/test-k8s created service/test-k8s created
# service 的 EXTERNAL-IP一直是pending状态 $ kubectl get all NAME READY STATUS RESTARTS AGE pod/test-k8s-7f8b7548fc-289cv 1/1 Running 0 14s pod/test-k8s-7f8b7548fc-qxjgd 1/1 Running 0 14s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 6d7h service/test-k8s LoadBalancer 10.111.43.66 <pending> 8080:31000/TCP 14s
NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/test-k8s 2/2 2 2 14s
NAME DESIRED CURRENT READY AGE replicaset.apps/test-k8s-7f8b7548fc 2 2 2 14s
# 直接运行 yaml 文件 # 后续想要卸载的话,可以执行 # kubectl delete -f https://raw.githubusercontent.com/metallb/metallb/v0.11.0/manifests/metallb.yaml $ kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.11.0/manifests/metallb.yaml Warning: policy/v1beta1 PodSecurityPolicy is deprecated in v1.21+, unavailable in v1.25+ podsecuritypolicy.policy/controller created podsecuritypolicy.policy/speaker created serviceaccount/controller created serviceaccount/speaker created clusterrole.rbac.authorization.k8s.io/metallb-system:controller created clusterrole.rbac.authorization.k8s.io/metallb-system:speaker created role.rbac.authorization.k8s.io/config-watcher created role.rbac.authorization.k8s.io/pod-lister created role.rbac.authorization.k8s.io/controller created clusterrolebinding.rbac.authorization.k8s.io/metallb-system:controller created clusterrolebinding.rbac.authorization.k8s.io/metallb-system:speaker created rolebinding.rbac.authorization.k8s.io/config-watcher created rolebinding.rbac.authorization.k8s.io/pod-lister created rolebinding.rbac.authorization.k8s.io/controller created daemonset.apps/speaker created deployment.apps/controller created
# 会生成一个 namespace metallb-system $ kubectl get ns NAME STATUS AGE default Active 6d7h kube-node-lease Active 6d7h kube-public Active 6d7h kube-system Active 6d7h metallb-system Active 39m
# 查看所有 $ kubectl get all -n metallb-system NAME READY STATUS RESTARTS AGE # 负责IP地址的分配,以及service和endpoint的监听 pod/controller-7dcc8764f4-58fs4 1/1 Running 0 119s # 负责保证service地址可达 pod/speaker-jfb7w 1/1 Running 0 119s
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE daemonset.apps/speaker 1 1 1 1 1 kubernetes.io/os=linux 119s
NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/controller 1/1 1 1 119s
NAME DESIRED CURRENT READY AGE replicaset.apps/controller-7dcc8764f4 1 1 1 119s
$ helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx "ingress-nginx" has been added to your repositories
$ helm repo update Hang tight while we grab the latest from your chart repositories... ...Successfully got an update from the "ingress-nginx" chart repository ...Successfully got an update from the "bitnami" chart repository Update Complete. ⎈Happy Helming!⎈