Master Server Role
– One server or a pod functions as the master server
– Master server role has these jobs/components:
-
- Gateway and control panel for the cluster via API
- Perform health checks on other nodes
- Schedule workloads and manage scaling
- Link all components and adjust networking
- Authenticate clients and nodes
– Declaration plan (JSON or YAML format)
-
- Start user-defined application or service
- Master server executes plan by examining current state of system
- etcd is a protocol to distribute configuration values within the cluster. Its methods allow applications to select, update, delete shits programmatically.
- Kubernetes uses etcd to allow nodes to reconfigure themselves.
– kube-apiserver provides RESTful interface for kubectl (clients)
– kube-scheduler assigns workloads
– kube-controller-manager regulates the cluster
– cloud-controller-manager connects to various cloud environments to provide a uniform dashboard
Node Server Components
– Container Runtime can be serviced by Docker, rkt, or runc
– kubelet authenticates to the cluster and receive manifest (work) and controls Container Runtime. Report state of node to Master server.
– kube-proxy: run on each node to ensure networking is streamlined
Objects
– Pod is a group of nodes that perform similar functions, share life cycle. These nodes share environment, volumes, and supernets
– Replication Controller defines pod template to scale replicas horizontally. It can perform updates on sets of pods without affecting availability.
– Replication Sets are the run-time copies of Replication Controller design. It’s meant to be selected by Deployments (workloads)
– Deployments are high-level objects accessible to the user. Similar to Replication Controller in functionality while differing in the easy of roll-back features.
– Stateful Sets is a specialized pod controller, often associated with persistent databases. It acts as a pod controller to guarantee stability in networking and storage. It does this by tracking IDs for each pod
– Daemon Sets is a type of pod controller, often associated with node services such as collecting metrics, gathering logs. These can bypass pod restrictions to ensure essential services are available to nodes.
– Jobs are one-off tasks. Kubernetes also has Cron Jobs that function just like the sub-system Cron.
– Service is a group of pods that performs the same functionality. There are Internal (SQL) and External Services (Apache/Nginx)
– NodePort maps the node’s external IP with the cluster IP service
– LoadBalancer creates external balancer route to Services
– Volumes are Kubernetes construct that allow all containers in a pod to share. These exist until the Pod is terminated
– Persistent Volumes are made to survive the pod’s life cycle as defined by their reclaimation policy
– Labels are tags on Controller-based objects and Services. Each unit can have multiple labels, but it can only have 1 key entry. Semantics such as DEV, QA, STAGE, PROD, VERSION-X, etc are good examples of usage
– Annotations are aggregates of Labels. They’re useful for metadata and expanded descriptions
Practical illustration is posted here.