Kubernetes local testing setup
You can use docker-compose, but using minikube is also very easy to test things.
So for my testing I do following steps:
- Create new Kubernetes
Namespace
- Deploy artifacts(here you deploy the
deployment
) - Expose that
deployment
with aservice
of typeNodePort
- Now all you need is to find out what random port was chosen as nodePort and curl on that port with
minikube ip:nodePort
- If you want logs of the pod you can get that as well
- Once you see all the things you wanna see, just delete the
Namespace
.
I have done similar things while doing end to end testing of the tool called kedge which generates Kubernetes artifacts, so we deploy all generated artifacts on a running cluster in similar way I have mentioned above, ref: here.