K8S Concepts

Concepts study here:

https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/

kubeadm init

  1. Kubeadmin init pre-flight check

    Check the version of K8S/OS, user(root), host, port, tools etc.

  2. Genrate key and certification

    /etc/kubernetes/pki

  3. Generate kubeconfig file

    .kube/config /etc/kubernetes/*.conf KUBECONFIG

  4. Generate manifest file

    /etc/kubernetes/manifests

  5. Download the image, wait for starting

    Download from k8s.gcr.io

    kubeadmin waits for response from localhost:6443.healthz (liveessProde, config by manifests/kube-piserver.yaml)

  6. Save master configuration information

  7. Mark master sign on current node

  8. Config TLS

  9. Install DNS and kube-proxy

    deploy kube-proxy via daemonSet

    deploy kibe-dns

kubeadm join

add nodes to cluster

Disovery-token-ca-cert-hash: used by node to check master

token: used by master to check node

kubelet

Kubelet runs on all K8S nodes (including master), launched by OS init process(like systemd).

Node pod manager

config by /etc/systmd/system/kubelet.service.d/10 -kubeadm.conf

systemctl daemon-reload & systemctl estart kubelet

kube-apiserver

lauched by kubelet via static pod

Pod spec: /etc/kubernetes/manifests/kube-apiserver.yaml

Etcd

Lauched by kubelet via static pod

Communicate with api-server based on TLS

Runtime data saved in /var/lib/etcd

kube-controller-manager

Responsible for nodes/pod/namespace/service account/service endpoint/resource in cluster

/etc/kubernetes/manifests/kube-controller-manager.yaml

kube-scheduler

Scheduler for pod

Lauched by kubelet via static pod

kube-proxy

Config: /var/lib/kube-proxy/config.conf (pod)

  • Copyrights © 2019-2020 Rex