我正在遵循快速入门的指示。集群上还运行着其他LoadBalancer服务。它们暴露的是外部IP值,非常好。NGINX大会控制器似乎是唯一有此问题的人。
我执行了第一个命令:
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.0/deploy/static/provider/cloud/deploy.yaml
我的LoadBalancer服务似乎有问题。它已经超过了一个小时,但是外部IP仍然处于<pending>
状态:
kubectl get svc ingress-nginx-controller
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
ingress-nginx-controller LoadBalancer 10.106.240.88 <pending> 80:31352/TCP,443:31801/TCP 32m
从这里开始我该怎么做?这是我的提供者的问题吗?
发布于 2021-12-29 09:03:28
我的提供者Oktawave回答道,解释有两个端口的LoadBalancers需要额外的注释:
apiVersion: v1
kind: Service
metadata:
name: wordpress-lb
annotations:
k44sServiceType: HTTP
k44sSslEnabled: "True"
labels:
app: hello-wordpress
spec:
ports:
- port: 80
name: http
protocol: TCP
- port: 443
name: https
protocol: TCP
selector:
app: hello-wordpress
type: LoadBalancer
通过编辑包含以下注释的ingress-nginx-controller
,我能够获得分配给YAML的外部IP:
(...)
---
apiVersion: v1
kind: Service
metadata:
annotations:
k44sServiceType: HTTP
k44sSslEnabled: "True"
labels:
helm.sh/chart: ingress-nginx-4.0.10
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/instance: ingress-nginx
app.kubernetes.io/version: 1.1.0
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: controller
name: ingress-nginx-controller
namespace: ingress-nginx
spec:
type: LoadBalancer
externalTrafficPolicy: Local
ipFamilyPolicy: SingleStack
ipFamilies:
- IPv4
ports:
- name: http
port: 80
protocol: TCP
targetPort: http
appProtocol: http
- name: https
port: 443
protocol: TCP
targetPort: https
appProtocol: https
selector:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/instance: ingress-nginx
app.kubernetes.io/component: controller
---
(...)
https://stackoverflow.com/questions/70497416
复制相似问题