我正在尝试在Google Compute Engine上为我的Kubernetes群集创建一个Ingress。我在使用gke
控制器类时工作正常。但我不得不将其更改为nginx
控制器,以便能够指定后端超时。问题是我的Ingress没有提供外部IP地址。
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-router
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/proxy-connect-timeout: "1200"
nginx.ingress.kubernetes.io/proxy-read-timeout: "1200"
nginx.ingress.kubernetes.io/proxy-send-timeout: "1200"
nginx.ingress.kubernetes.io/upstream-fail-timeout: "1200"
kubernetes.io/ingress.global-static-ip-name: my-ip
spec:
tls:
- secretName: nginxsecret
rules:
- http:
paths:
- path: /*
backend:
serviceName: frontend
servicePort: 8000
- path: /cron/*
backend:
serviceName: esg
servicePort: 8000
- path: /task/*
backend:
serviceName: esg
servicePort: 8000
- path: /api/connections/update/*
backend:
serviceName: esg
servicePort: 8000
- path: /api/drive/scansheet/*
backend:
serviceName: esg
servicePort: 8000
是否缺少任何配置?
答案 0 :(得分:1)
发现了这个问题。这是因为我没有为Ingress配置Nginx控制器。