Docker and Kubernetes

Docker and Kubernetes #

Kubernetes supports a bunch of different containerization options besides Docker.

kubectl run --replicas=<number of replicas> <application>

Nodes #

One host

Cluster #

Multiple nodes (hosts). Ensures redundancy and resiliency.

Master #

A particular node that controls all the nodes in the cluster, responsible for orchestration of containers.

Components #

There are several pieces/servers to every instance of Kubernetes:

  • kubelet - agent that ensures containers are running as expected
  • etcd - distributed key-value store, for data used to manage cluster
  • API server - frontend of Kubernetes
  • scheduler - schedules and distributes work across containers and nodes
  • controller - monitors and responds to nodes or endpoints acting up
  • container runtime - underlying software to run containers (such as Docker)

Kube Control Tool - kubectl #

Run application on cluster:

kubectl run <application>

Get information on cluster:

kubectl cluster-info

List nodes in cluster:

kubectl get nodes