How to generate dev SSL cert for minikube?

5/20/2020

I have a dotnet core application that I want to ultimately deploy on kubernetes (on some cloud provider). For the dev flow, I want to be able to test this out on a local minikube setup first.

Right now, I can get the dev server running on https on my host machine, and also can get it running on https in a docker container. This works because the same SSL cert that works on my host machine, also works with docker (as the server running in the docker container is still accessed from localhost).

Now, I can't understand how to make it work within minikube, as minikube has it's own IP address and isn't accessible over localhost.

[Q1] How can I get this scenario to work?

Also, sometimes, mimikube's IP address changes, with an error message like this

E0520 20:13:05.462158    3212 kubeadm.go:331] Overriding stale ClientConfig host https://172.17.139.43:8443 with https://192.168.171.228:8443

From my understanding, this means I need to keep creating new certs each time minikube decides to change it's IP address.

[Q2] Is that correct? Is there a workaround for this?

-- agnivesh
kubernetes
minikube
ssl-certificate

0 Answers