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.
Rolling deployments with Kubernetes
How to deploy a new version of an image into a Kubernetes cluster
Getting started with Kubernetes
How to get started with using Kubernetes on a local machine using minikube
Listening to BBC Radio with mpv
The BBC publishes high quality 320 kbps HLS AAC streams that can be used to listen to radio from the command-line using mpv. Here are the URLs and some aliases to start listening quickly.