Empty Address on Docker Desktop kubernates for Ingress

Viewed 3279

k8 ingress yaml which is used to deploy ingress in docker desktop k8 but not working address is always empty any one please help me on this

k8 ingress yaml which is used to deploy ingress in docker desktop k8 but not working address is always empty any one please help me on this

$ kubectl get ingress springboot-ingress
NAME                 HOSTS                  ADDRESS   PORTS   AGE
springboot-ingress   espark.com,localhost             80      12m
2 Answers

working code git url https://github.com/adarshkumarsingh83/kubernetes/tree/master/springboot-kubernetes-ingress-lb

i have used below url

$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.30.0/deploy/static/mandatory.yaml
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.30.0/deploy/static/provider/cloud-generic.yaml
$ kubectl apply -f $(pwd)/kubernates/ingress.yaml

and change the ingress yaml one line and it worked for me

  
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: springboot-ingress
spec:
  rules:
    - host: espark.com
      http:
        paths:
          - path: /v1/api/address
            backend:
              serviceName: espark-address-service
              servicePort: 8080
          - path: /v1/api/employee
            backend:
              serviceName: espark-employee-service
              servicePort: 8080
    - host: localhost
      http:
        paths:
          - path: /v1/api/address
            backend:
              serviceName: espark-address-service
              servicePort: 8080
          - path: /v1/api/employee
            backend:
              serviceName: espark-employee-service
              servicePort: 8080

Check if endpoint is generated for your service by kubectl get endpoints and verify it has IP. If not, check the selectors and port in your service resource, they should match at least one running pod, otherwise what you see above will happen.

Related