When learning a new language, DSL or technology in general, keeping track of all the new commands can be a pain. Recently I’ve been learning Kubernetes, which is an open source system for deploying containerized applications. Learning this technology is hard enough, so I thought I would compile a short list of the most commonly used commands while working with Kubernetes. Commands for MiniKube, which is a version of Kubernetes that can be used locally on your machine, are included as well. Using MiniKube is the best way of learning Kubernetes as it circumvents the need to do a ton of configuration work, and you get to learning Kubernetes right away.
To install MiniKube, you would run the following code on Linux:
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
And the following command to initialize your Minikube cluster:
The following is a list of the most commonly used commands that I have come across, so feel free to save this page for quick reference as you are learning Kubernetes.
kubectl get nodes
kubectl get pod
kubectl get services
kubectl create deployment [name] [optional parameters]
kubectl get deployment [name]
kubectl get replicaset
kubectl edit deployment [name]
kubectl create deployment [name] --image=name
kubectl describe pod [name]
kubectl logs [name]
kubectl exec -it [name] -- bin/bash
kubectl delete deployment [deployment name]
kubectl apply -f nginx-deployment.yaml
kubectl delete -f [filename]
© 2021 The Kubernetes Authors | Documentation Distributed under CC BY 4.0 Copyright © 2021 The Linux Foundation ®. All…
minikube is local Kubernetes, focusing on making it easy to learn and develop for Kubernetes. All you need is Docker…
The documentation for Kubernetes and MiniKube is great, and plenty more resources can be found online. Hopefully having a consolidated list of the most commonly used commands will be of help to those learning this increasingly ubiquitous technology.