Over the last few weeks I have been learning Kubernetes. Here is how I got set up and started learning.
To experiment with Kubernetes I used minikube to run a local cluster. This has dependencies of virtualbox and kubectl.
On Arch Linux minkube and kubectl may be installed from the AUR. Virtualbox is available in the core Arch Linux repositories. Once installed a Kubernetes cluster can be started as follows.
minikube start Starting local Kubernetes cluster... Kubectl is now configured to use the cluster.
Note that this can take some time to complete. Once complete some information can be gathered about the cluster.
kubectl cluster-info Kubernetes master is running at https://192.168.99.101:8443 KubeDNS is running at https://192.168.99.101:8443/api/v1/proxy/namespaces/kube-system/services/kube-dns kubernetes-dashboard is running at https://192.168.99.101:8443/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard
Kubernetes ships with a dashboard that can be viewed as follows
Whilst it is possible to manage and deploy applications through the dashboard I prefer the command line! Nevertheless the dashboard is useful to visualise quickly what you have and it would be useful for teams to serve as a dashboard.
Now the cluster is running an image can be deployed into it. I used a Hello World web server written in Go that I had already created and pushed into the public registry.
kubectl run hello-go --image=shapeshed/hello-go --port=8080
kubectl expose deployment hello-go --type=NodePort
kubectl get pod NAME READY STATUS RESTARTS AGE hello-go-772128995-1x5wj 1/1 Running 0 12m
minikube service hello-go --url
Visiting the URL serves the application through Kubernetes.
Getting Kubernetes up and running on Arch Linux was really straightforward and I found the documentation to be fantastic. I now have an environment where I can experiment with exploring more of what Kubernetes can do.
Have an update or suggestion for this article? You can edit it here and send me a pull request.
Linux and Unix watch command tutorial with examples
Tutorial on using watch, a UNIX and Linux command for executing a program periodically and showing a fullscreen output. Examples of watching a file download, a network interface come up, and showing the five most CPU intensive processes.
Build your own Vim statusline
Statuslines in Vim are not hard to create. Making your own means one less dependency in your life.
Custom Vim Bindings in tmux 2.4
tmux 2.4 made a significant change to key bindings. Here is how to support custom keybindings for versions before and after tmux 2.4