So, I have Kubernetes installed on a private server with IP 192.168.9.150
(let's say it's 9.150
). And then I have a (long) single yaml file like this:
*(Make it simple, there's a deployment with 1 Express App (billing-api
), 1 React App (billing-web
) Redis (3 app in 1 pod) and another pod for curl. And then, there are some services that used for accessing external service, 2 ConfigMaps for billing-api
and billing-web
env, billing-service
service with 80 (billing-web
) and 1234 (billing-api
) ports and Ingress Nginx Installed.)
kubernetes.yaml *Sorry, cannot paste it here, marked as spam.
Then I run kubectl apply -f kubernetes.yaml
, also I already have Ingress Nginx running with:
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/cloud/deploy.yaml
For testing that each pods can communicate, I run kubectl exec -it pod/curl -- sh
and then run curl billing-service:1234
and curl billing-service
commands, and they return the right result from billing-service
service.
I also have edited the /etc/hosts
and add the following lines:
127.0.0.1 billing.meetaza.dev
127.0.0.1 api.meetaza.dev
But, the problem is, when I try to curl from 9.150
, it says:
curl: (7) Failed to connect to api.meetaza.dev port 80: Connection refused
And
curl: (7) Failed to connect to billing.meetaza.dev port 80: Connection refused
I thought that I miss a part of Kubernetes Deployment, but I have no idea about that (since I was following a tutorial in YT with Minikube installed instead of the real Kubernetes on a server).
I've trying to google it, but I was limited about what really happened here. Please tell me if there's an exact issue in StackOverflow.
This is my screenshot of kubectl get all
and kubectl get all --namespace ingress-nginx
:
kubectl get all