From Docker Containers to Kubernetes

Viewed 41

I've been stuck on this problem for a few weeks so i'm gonna try having advice here.

So we have an web app that works fine with docker-compose run on Rancher-Desktop, it has 4 containers: -reverse proxy -frontend -backend -sql-server

I have started by using Kompose on the docker-compose file and got 4 deployments, 4 pods: the reverse proxy pod was not running at the beginning but i have created a new deployment of nginx in a pod and copied the nginx.conf file in a ConfigMap, i also changed the addresses to the services as such "proxy_pass http://<service-name>.default.svc.cluster.local:<service-port>" and added the kube-dns resolver. I also created a service for the frontend because it wasn't created by kompose due to no port specified in the docker-compose file. and a service for my nginx deployment with type NodePort. all other services are ClusterIP when i try to access the frontend or any other service through the nginx reverse proxy with the cluster node address, the health check path works fine, but the path to the frontend returns 502 bad gateway error and Connection refused.

Am i doing the wrong thing by deploying the reverse proxy as a Pod inside my cluster?

What are the steps i should be doing to migrate from docker-compose to kubernetes in the case of nginx reverse proxy?

i've read that i should be deploying an ingress controller, does it work with my deployment of nginx reverse proxy or should i replace one by the other?

I've found an example that doesn't require any of these steps and works well for me, so i'm wondering if any of this is necessary and if i'm doing something wrong: https://github.com/jwsy/simplest-k8s

0 Answers
Related