Kubernetes Nginx Ingress not finding service endpoint

前端 未结 2 1462
渐次进展
渐次进展 2021-02-19 21:58

I\'m having some trouble getting the Nginx ingress controller working in my Kubernetes cluster. I have created the nginx-ingress deployments, services, roles, etc., according to

2条回答
  •  后悔当初
    2021-02-19 22:30

    I discovered what I was doing wrong. In my application definition I was using name as my selector

      selector:
        matchLabels:
          name: hello-world
      template:
        metadata:
          labels:
            name: hello-world
    

    Whereas in my service I was using app

      selector:
        app: hello-world
    

    After updating my service to use app, it worked

      selector:
        matchLabels:
          app: hello-world
      template:
        metadata:
          labels:
            app: hello-world
    

提交回复
热议问题