Well, I just spend another 5 hours getting crap to work on my laptop. It fucking hurts haha. Knowing that it aint gonna be a smooth ride is already a good prep.
Ok so lets start with some things that i’ve found out.
Kubens and kubectl
You’ll keep adding the namespace with almost every command you type. For instance:
kubectl get pods -n platform kubeclt get services -n platform
It get really tiresome if you’re working with it a lot in the same namespace. You can install
kubens to switch the namespace temporarily and it will be added to each command automatically.
Kubernetes on Docker for Mac is probably the way to go
I was working with minikube, and it was all fine and dandy and I was super happy that enabling ingress was just a
minikube addons enable ingress away.
But my joy really come to a halt when i had to add a bunch of vhosts to my dev cluster. I simply wanted to route a bunch
whatever.yolo.com to my ingress exposed loadbalancer and that’s where the fun began.
I could just change my
/etc/hosts on my mac, and this allowed it to be accessed from the outside towards my cluster. But this didn’t mean that the internal pods could access it. So me SSH’ing into minikube with
minikube ssh changing the
/etc/hosts to no avail. Nothing worked.
I ultimately tried to swap
kube-dns to fix custom entries with
coredns. But it was really a bunch of pain. Man. why can’t it be fucking easy. Easy things should be easy and complicated things possible.
I tried docker for mac, hoping that it would inherit my
/etc/hosts file. And yes. it did 🎉. Al my containers did now inherit the hosts in
I’ll come back in 3 weeks to see if i’m still happy :)
If you use pow, make sure to kill it before using the ingress on docker for mac
Another headache was me trying to get nginx-ingress working on docker for mac kubernetes. Since i had pow.cx installed, it had a firewall route to route port 80 and 443 to a different endpoint. Therefore all my systems said nginx was running, but yet my traffic didnt arrive at that port. It drove me crazy. I love pow, but this was a bit too much.
So make sure to uninstall before you go this route.
curl get.pow.cx/uninstall.sh | sh
To uninstall. What actually happens is that pow redirects your port 80 to a different port so it can run above port 80 and doesnt need sudo priviliges.
Sidenote: Kubernetes Developer Experience ain’t there yet
Kubernetes is still too clunky. It seems like it tries too much, it has a bunch of jargon an subtitlies and differences. Deamonsets, Replicasets, Jobs etc. Half lingering pods, not being able to just look at your deployment and get a complete trace until you the deployment is done.
Just like docker had its problems in the beginning, with not being able to set capilities, pid 1 issues and i dont know what, it became better over the years. Docker-compose is super fun to use, and i hope i’ll get such an experience in time with kubernetes too. Maybe i’m just dumb, but i think common usecases like deploying a set of pods, easy tracing their state and not having to
kubectl get pod -n my-apps and
kubectl describe pod -n my-apps continously to check how things are doing would be ace.
Want less hurt in your future 🙅♂️ Subscribe!
Would you like to stay up to date on upcoming learn-togethers or events? Subscribe here! I'll only use your email to keep u up to date on new learnings and coding tips. It wont be shared! Feel free to unsubscribe anytime!