简体   繁体   中英

Kubernetes Ingress NGINX Controller EXTERNAL-IP <pending>

I am following the Quick start instructions. I have other LoadBalancer services running on my cluster. They are exposing EXTERNAL-IP values just fine. NGINX Ingress Controller seems to be the only one having this issue.

I executed the first command:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.0/deploy/static/provider/cloud/deploy.yaml

There seems to be an issue with my LoadBalancer service. It has already been more than 1h, but EXTERNAL-IP remains in <pending> state:

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

How do I progress from here? Is this an issue with my provider?

My provider Oktawave replied, explaining additional annotations are necessary for LoadBalancers with 2 ports:

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

I was able to get EXTERNAL-IP assigned to ingress-nginx-controller by editing the YAML to include these annotations:

(...)
---
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
---
(...)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM