Kubernetes Tutorials

Back to SIG Tooling & Set Up Tutorials

# Author: Alice Liquori

# Date: 2023-08-18

Kubernetes Resources

Minikube
Kubectl

In our workflow at SIG, our development stack has been composed of Docker, Minikube, and Kubectl.

Minikube

Minikube is a user-friendly tool that can be used to create local Kubernetes clusters on your development machine. It includes utilities for mounting directories, a dashboard, and much more.

Creating a Local Cluster

Creating a cluster with Minikube is as simple as running the command `minikube start`. After a short wait, it will create a Kubernetes cluster that you can begin to interact with immediately.

Deleting a Local Cluster

To clean up when you are done testing, you can delete all running Minikube clusters with `minikube delete --all`

Kubectl

Kubectl is a tool that can be used to interact with and examine Kubernetes clusters. It is expansive, and the documentation is very useful.

Create a deployment

To deploy an existing image, you can use the following command to start a deployment.

kubectl create deployment  --image=

Alternatively, a yaml file describing a deployment can be applied in a similar way.

kubectl apply -f .yml

Whichever method you choose, shortly after, your deployment will be running and available to inspect or modify with the various Kubectl commands documented in the `kubectl` manpage.

Delete a deployment

To delete a Kubernetes deployment, one can run `kubectl delete deployment `. To delete all Kubernetes deployments, instead run `kubectl delete deployments.apps --all`.

Aliases, Completion, and Bash Utilities

Kubernetes Bash Utilities
Kubernetes Cheatsheet

While working with Kubernetes I developed a set of bash aliases and one function to ease the workflow of typing long commands and frequently switching contexts. This file can be sourced by your `.bash_aliases` to be included in your shell. Shell completion for Kubernetes commands can be configured according to the Kubernetes Cheatsheet above.

Additional Ecosystem Resources

Kubeadm
Kind
K3s
Helm

Kubeadm

Kubeadm is a tool for creating production Kubernetes clusters, which is something we have not needed yet at SIG.

Kind

Kind is an alternative to Minikube that moves your cluster into Docker containers. It is considerably faster than Minikube.

K3s

K3s is a minified and altered version of Kubernetes, distributed as a single 60mb executable.

Helm

Helm is, among other things, a package manager for Kubernetes. It offers many utilities and a vibrant ecosystem.