Kubernetes (AKA K8s) is an open-source system for automating deployment, scaling, and management of Docker containerized applications. Its build for running production grade container systems, after being built by Google engineers with over 15 years of experience. While this system is very powerful and automates a lot of manual tasks, there are many layers of abstraction to grasp.
Below are a list of common terms and commands to get start using Kubernetes. We are not going to cover installing and setting up
kubectl in this article and it assumes you already have those installed.
Kubernetes coordinates a highly available cluster of computers and connects them together in order to do work as a single unit. This abstraction layer allows you to deploy applications to a cluster without specifying which machine to deploy too. In the case that a machine goes offline your application will still be running on the additional machines in the cluster
A configuration to instruct Kubernetes on how to create and / or update instances of an application on a specific Cluster. A Deployment Controller monitors the instances and if a Node on the Cluster goes down it will replace the instance with an instance on another Node.
An abstraction that represents a group of one or more application containers. A Pod can also contain shared resources such as shared storage Volumes, Networking, or container image and port information. Pods are the single atomic unit of the Kubernetes platform.
A worker machine in Kubernetes that is either physical or virtual and is apart of a Cluster. A Pod always runs on a Node. Each Node is managed by a Master Node which controls deployments and allocation.
An abstraction layer that defines a logical set of Pods and the policies that are used to access them. Services allow your application to receive traffic through a LoadBalancer.
Common Minikube Commands
minikube start --vm-driver="kvm"- Startup minikube with the kvm driver
minikube dashboard- Opens a local dashboard in the browser in order to have a graphical way of managing the instance
Common Kubectl Commands
kubectl create deployment <name> --image=<docker_image_name>- Create a Deployment that manages a Pod and deploys the specified Docker image to it
kubectl get deployments- View all the current deployments
kubectl get pods- View all the current pods and their status
kubectl config view- View the current
kubectl expose deployment <deployment_name> --type=LoadBalancer --port=8080- Expose the given deployment with a load balancer
kubectl get services- View services
Run the following commands to clean up the resources for a given cluster:
kubectl delete service <service_name> kubectl delete deployment <deployment_name> minikube stop minikube delete
This article details some of the common terms and commands used in the Kubernetes system. This is by no means an exhaustive list but tries to cover the common use cases for development.