Kubernetes

Prerequisites

Use the Kubernetes command-line tool, kubectl, to deploy and manage applications on Kubernetes. Using kubectl, you can inspect cluster resources; create, delete, and update components; look at your new cluster; and bring up apps.

For development and practice you can use a Minikube cluster, but it only intended for testing without pay for a cluster in a provider.

Useful commands

Deployments and status

Start deployment:

kubectl apply -f nginx-deployment.yaml

Check the status of a deployment:

kubectl rollout status deployments nginx-deployment
kubectl get deployments
kubectl describe deployments nginx-deployment
kubectl rollout history

Then check the status of pod:

kubectl get pods
kubectl describe pods nginx

Clean up cluster

You might need to clean up it when you work with it.

Delete all pods:

kubectl delete pods --all

Delete all services:

kubectl delete services --all

Delete all deployments:

kubectl delete deployments --all

Delete all replicasets:

kubectl delete replicasets --all

Delete all:

kubectl delete daemonsets,replicasets,services,deployments,pods,rc --all

Last updated