I installed Kubernetes NGINX Ingress in kubernetes cluster. When i am trying to access the micro service end via Ingress Controller its not working as expected
I am deploying on AWS Instance, i followed the documentation from here
I have two Spring boot application which has context path as /customer running on port 9000 and /prac running on port 8000 and third one is nginx running on port 80
I have executed these commands to create ingress controller of Type LoadBalancer
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/aws/service-l4.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.30.0/deploy/static/provider/aws/patch-configmap-l4.yaml
Pods Running
NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
ingress-nginx nginx-ingress-controller-7f74f657bd-rh5fj 1/1 Running 0 23h 10.32.0.10 ip-172-31-11-145 <none> <none>
kube-system coredns-6955765f44-8wkwl 1/1 Running 0 2d23h 10.32.0.3 ip-172-31-11-145 <none> <none>
kube-system coredns-6955765f44-w79bh 1/1 Running 0 2d23h 10.32.0.2 ip-172-31-11-145 <none> <none>
kube-system etcd-ip-172-31-11-145 1/1 Running 0 2d23h 172.31.11.145 ip-172-31-11-145 <none> <none>
kube-system kube-apiserver-ip-172-31-11-145 1/1 Running 0 2d23h 172.31.11.145 ip-172-31-11-145 <none> <none>
kube-system kube-controller-manager-ip-172-31-11-145 1/1 Running 0 2d23h 172.31.11.145 ip-172-31-11-145 <none> <none>
kube-system kube-proxy-6ktz2 1/1 Running 0 2d23h 172.31.34.24 ip-172-31-34-24 <none> <none>
kube-system kube-proxy-mrlt6 1/1 Running 0 2d23h 172.31.11.145 ip-172-31-11-145 <none> <none>
kube-system kube-scheduler-ip-172-31-11-145 1/1 Running 0 2d23h 172.31.11.145 ip-172-31-11-145 <none> <none>
kube-system weave-net-5bmvb 2/2 Running 0 2d23h 172.31.11.145 ip-172-31-11-145 <none> <none>
kube-system weave-net-gl7xz 2/2 Running 1 2d23h 172.31.34.24 ip-172-31-34-24 <none> <none>
practice customer-6d467cbc57-q6l6h 1/1 Running 0 46h 10.32.0.8 ip-172-31-11-145 <none> <none>
practice customer-6d467cbc57-rx7zt 1/1 Running 0 46h 10.32.0.5 ip-172-31-11-145 <none> <none>
practice ngtest-6c5ff8c7df-lmbhz 1/1 Running 0 45h 10.44.0.1 ip-172-31-34-24 <none> <none>
practice ngtest-6c5ff8c7df-pvv4w 1/1 Running 0 45h 10.32.0.9 ip-172-31-11-145 <none> <none>
practice prac-865d49687b-q8hss 1/1 Running 0 23h 10.32.0.11 ip-172-31-11-145 <none> <none>
practice prac-865d49687b-wxkxr 1/1 Running 0 23h 10.44.0.2 ip-172-31-34-24 <none> <none>
practice some-mysql-7896cfbb4c-kgnxf 1/1 Running 0 46h 10.32.0.7 ip-172-31-11-145 <none> <none>
Service Running
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
default kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 2d23h
ingress-nginx ingress-nginx LoadBalancer 10.110.197.3 18.221.167.75 80:32414/TCP,443:31112/TCP 23h
kube-system kube-dns ClusterIP 10.96.0.10 <none> 53/UDP,53/TCP,9153/TCP 2d23h
practice customer-service ClusterIP 10.106.14.223 <none> 9090/TCP 46h
practice ngtest ClusterIP 10.109.249.63 <none> 80/TCP 45h
practice prac-service ClusterIP 10.110.96.199 <none> 8000/TCP 46h
practice some-mysql ClusterIP None <none> 3306/TCP 46h
After installing ingress nginx, I have created ingress controller which is of type Loadbalancer.
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: practice-ingress
namespace: practice
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: kdhut.com
http:
paths:
- backend:
serviceName: customer-service
servicePort: 9090
path: /customer
- backend:
serviceName: prac-service
servicePort: 8000
path: /prac
- backend:
serviceName: ngtest
servicePort: 80
path: /
I created Classic Load Balancer, but the load Balancer health check is not passing, health check i am pointing to port 80, but its showing out of service.
I tried to check with Cluster IP, but its show Empty response from the server, please help me on this.
root@ip-172-31-11-145:/home/ubuntu# kubectl get svc --all-namespaces
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
default kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 2d23h
ingress-nginx ingress-nginx LoadBalancer 10.110.197.3 18.221.167.75 80:32414/TCP,443:31112/TCP 23h
kube-system kube-dns ClusterIP 10.96.0.10 <none> 53/UDP,53/TCP,9153/TCP 2d23h
practice customer-service ClusterIP 10.106.14.223 <none> 9090/TCP 46h
practice ngtest ClusterIP 10.109.249.63 <none> 80/TCP 46h
practice prac-service ClusterIP 10.110.96.199 <none> 8000/TCP 46h
practice some-mysql ClusterIP None <none> 3306/TCP 46h
root@ip-172-31-11-145:/home/ubuntu#
root@ip-172-31-11-145:/home/ubuntu#
root@ip-172-31-11-145:/home/ubuntu#
root@ip-172-31-11-145:/home/ubuntu# curl http://10.110.197.3/
curl: (52) Empty reply from server
root@ip-172-31-11-145:/home/ubuntu# curl http://10.110.197.3/prac/
curl: (52) Empty reply from server
root@ip-172-31-11-145:/home/ubuntu#