CodeBlanks Logo Icon CodeBlanks

Summary - What is Kubernetes

Combine cluster components to write an architecture description.

Summary: what Kubernetes is

In this group:

  • Kubernetes runs, scales and heals containers on a cluster according to the desired state.
  • Objects are defined declaratively in YAML and applied with kubectl apply.
  • Control plane: kube-apiserver, etcd, kube-scheduler, kube-controller-manager.
  • Worker node: kubelet, container runtime (containerd), kube-proxy.
  • kubectl get nodes/pods -o wide, describe, top and cluster-info are the basic commands for inspecting a cluster.
kubectl get nodes
kubectl get pods -A -o wide
kubectl top nodes

Practice A cluster tour

Write three commands: list the nodes; list the pods in all namespaces in wide format; scale the web deployment to 2 replicas.

Starter code

terminal
# buraya yaz

Sample solution

terminal
kubectl get nodes
kubectl get pods -A -o wide
kubectl scale deployment web --replicas=2

Expected output

NAME       STATUS   ROLES           AGE   VERSION
minikube   Ready    control-plane   2d    v1.31.2
NAMESPACE     NAME                  READY   STATUS    IP           NODE
default       web-7c5b9f6d8-abcde   1/1     Running   10.244.0.5   minikube
kube-system   etcd-minikube         1/1     Running   192.168.49.2 minikube
deployment.apps/web scaled

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 Which component picks the node for a new pod?

  • kube-scheduler Correct answer
  • kubelet
  • etcd
  • kube-proxy

Explanation: The kubelet then starts the pod on the chosen node.

2 List the pods in all namespaces.

Question
kubectl get pods ____
Answer
kubectl get pods -A

Explanation: -A (--all-namespaces) covers all namespaces.

3 Match.

Term Meaning
etcd Control plane
kubelet Worker node
kubectl apply Declarative
kubectl scale Replica count

All lessons in Intermediate