K8S Apiserver

Kube Apiserver is the primary component of a KubernetesKubernetes
Kubernetes is a container orchestration platform. This note serves as a Map of Content for this topic. Start your exploration on one of these notes:

[[K8S Node]]
[[K8S Object]]
[[What happen...
cluster. It runs on a K8S Master NodeK8S Master Node
[[Kubernetes]] Master nodes (also known as k8s controlplane) are [[K8S Node]]s responsible for managing the cluster. No user processes normally run on master node, this is the job of the [[K8S Work...
, and is the only component which is talking directly to the etcd clusteretcd cluster
Etcd is a reliable key-value [[Database]]. It is one of the most important parts of a [[Kubernetes]] cluster used to store the data of the [[K8S Apiserver]]. It uses [[Raft Protocol]] to establish ...
. It exposes a REST API through which all K8S components interact with the cluster / with each other.

Whenever you execute a kubectl command, your client is sending a request to the Kube Apiserver.

If a kubectl GET request is sent, kube apiserver:

  • authenticates and validates the request
  • retrieves the data from etcd cluster
  • responds back with the requested information

Instead of using kubectl it would be possible to invoke the APIs directly. For example, making a POST request to create a pod in the lines of curl -X POST /api/v1/namespaces/default/pods.... will trigger the following actions:

  • authenticate user (see K8S RBAC)
  • validate request
  • update etcd
  • inform the user that the K8S PodK8S Pod
    Pod is a [[K8S Object]] used to run one or more tightly coupled containers and is rarely used directly, especially in production because of the limitations on the number of properties that can be u...
    has been created

From here, other components start acting to make sure pod starts running. This process is described in more detail in What happens when you create a Pod in KubernetesWhat happens when you create a Pod in Kubernetes
Once you run kubectl run busybox --image busybox on your [[Kubernetes]] cluster, what has to happen before your [[K8S Pod]] is running successfully?

The [[K8S Apiserver]] is the component which re...
.


Status: #🌲