This guide presumes you are comfortable with docker containerization and explains how to get your images spinning on a k8s environment.
- Kubectl
- Minikube
- Virtualbox - This will supply the hypervisor to minikube to create vm on. Alternatives
Kubectl is a Kubernetes command-line tool that allows running commands against Kubernetes clusters. You can use kubectl to deploy applications, inspect and manage cluster resources, and view logs.
Minikube is a tool that makes it easy to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a Virtual Machine (VM) on a PC for users looking to try out Kubernetes or develop with it day-to-day. For more demanding usage, consinder running kubernetes on bare metal.
# pacman -S kubectl
# pacman -S minikube
# pacman -S virtualbox
- To launch a minikube cluster execute
$ minicube start
- To launch with custom hypervisor
$ minikube start --driver=docker
- To set default hypervisor
$ minikube config set driver docker
. Virtualbox is the default in a fresh setup - To delete cluster
$ minikube delete
- To open the k8s dashboard, run
$ minikube dashboard
Pods are the building blocks of a k8s system. Sort of like images to docker, well, or atoms to an element. A pod hosts and manages one or multiple containers.
Replication controllers manage behaviour of pods in terms of creating, deleting, healing, etc
A deployment is a special ( on steroids ) replication controller that allows updates and rollbacks of deployed pods more systematically.
A service exposes a pod, Replication controllers or deploymenent to the external world or to a different node within the cluster. Services have a static IP and communicate to pods using Labels.
- Apply the deployment to your cluster
kubectl apply -f /path/to/deployment.yml
- Create a service for the deployment
kubectl create -f /path/to/service.yml
- Run the application by visiting
https://<cluster-ip>:<nodePort>