是否有一种方法可以看到为什么当我尝试使用GKE的入口时我没有看到任何事件?



我有以下入口…

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: core-ingress
namespace: earth
annotations:
kubernetes.io/ingress.global-static-ip-name: "core-proxy-static-ip"
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
ingressClassName: core-ingress
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: core-proxy-service
port:
number: 80

我使用kubectl exec来确保服务本身正在运行并在端口80上侦听,因此我知道core-proxy-service正在工作。当我尝试安装入口时,它永远不会得到IP和事件显示什么…

Name:             core-ingress
Namespace:        earth
Address:          
Default backend:  default-http-backend:80 (10.109.128.78:8080)
Rules:
Host        Path  Backends
----        ----  --------
*           
/   core-proxy-service:80 (10.109.128.132:80)
Annotations:  kubernetes.io/ingress.global-static-ip-name: core-proxy-static-ip
nginx.ingress.kubernetes.io/rewrite-target: /
Events:       <none>

由于没有事件,我认为一定发生了什么,这就是为什么我没有得到一个IP,但我如何能够调试找出什么?

NAMESPACE   NAME           CLASS          HOSTS   ADDRESS   PORTS   AGE
earth       core-ingress   core-ingress   *                 80      3m33s

更新如果我回到

defaultBackend:
service:
name: core-proxy-service
port:
number: 80

一切正常,我错过了什么?

试试这样写:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-myservicea
annotations:
kubernetes.io/ingress.global-static-ip-name: "core-proxy-static-ip"
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
ingressClassName: nginx
rules:
- http:
paths:
- path: /
backend:
serviceName: core-proxy-service
servicePort: 80

Ref doc: https://kubernetes.github.io/ingress-nginx/user-guide/basic-usage/

相关内容

  • 没有找到相关文章

最新更新