All Articles

Kubernetes invalid certificate

I am currently reading through Marko Luksa’s Kubernetes in Action, first edition. As a lot of things changed since release of first edition, second edition of this book is on it’s way and it should be released sometime this year. So, it’s expected some things to be either different in newer versions of either Kubernetes or Minikube issues are expected.

I have setup Minikube with docker driver on Ubuntu 18.04. All fine and dandy, until I reached part where author proposes creating ReplicationController. More detailed explanation below:

kubectl run kubia --image=luksa/kubia --port=8080 --generator=run/v1
--------------------------------------------------------------------
Flag --generator has been deprecated, has no effect and will be removed in the future.
Unable to connect to the server: x509: certificate is valid for 172.17.0.2, 10.96.0.1, 127.0.0.1, 10.0.0.1, not 172.17.0.3

--generator parameter is deprecated. I suppose fun time is over. After a bit of googling I found a link to official documentation where they recommend using Deployment with configured ReplicaSet as preferred / recommended way of doing replication.

Solution: I might as well skip this, as I haven’t reached Deployment part of the book.

Next problem: invalid certificate. This one always ruins the mood.

Solution: minikube stop && minikube delete && minikube start.

If this doesn’t work for you, try removing minikube directory located in ~/.minikube, don’t forget to stop minikube before you delete this directory.