MongoDB with express, on docker-desktop kubernetes (tested on Mac M1)
Kubernetes on Docker desktop does not come pre-installed with an ingress controller. Follow the steps below to set it up.
Apply the controller configs
kubectl config use-context docker-desktop
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.6.4/deploy/static/provider/cloud/deploy.yaml
Wait for the ingress controller pod to be running
kubectl -n ingress-nginx get pod
deepak@Deepaks-MBP-2 terraform-prototype-k8s-mongo % kubectl -n ingress-nginx get pod
NAME READY STATUS RESTARTS AGE
ingress-nginx-admission-create-56l8s 0/1 Completed 0 37s
ingress-nginx-admission-patch-ptsns 0/1 Completed 0 37s
ingress-nginx-controller-6f79748cff-hcwhq 1/1 Running 0 37s
Ingress is now ready.
terraform init
terraform plan
terraform apply
Express can be accessed through the ingress at http://mongodb.local, by adding the host entry
127.0.0.1 mongodb.local