Starting to Learn Kubernetes a Step Behind - 16. Components -
Story
- Starting to Learn Kubernetes a Step Behind - 01. Environment Selection -
- Starting to Learn Kubernetes a Step Behind - 02. Docker For Mac -
- Starting to Learn Kubernetes a Step Behind - 03. Raspberry Pi -
- Starting to Learn Kubernetes a Step Behind - 04. kubectl -
- Starting to Learn Kubernetes a Step Behind - 05. workloads Part 1 -
- Starting to Learn Kubernetes a Step Behind - 06. workloads Part 2 -
- Starting to Learn Kubernetes a Step Behind - 07. workloads Part 3 -
- Starting to Learn Kubernetes a Step Behind - 08. discovery&LB Part 1 -
- Starting to Learn Kubernetes a Step Behind - 09. discovery&LB Part 2 -
- Starting to Learn Kubernetes a Step Behind - 10. config&storage Part 1 -
- Starting to Learn Kubernetes a Step Behind - 11. config&storage Part 2 -
- Starting to Learn Kubernetes a Step Behind - 12. Resource Limitations -
- Starting to Learn Kubernetes a Step Behind - 13. Health Checks and Container Lifecycle -
- Starting to Learn Kubernetes a Step Behind - 14. Scheduling -
- Starting to Learn Kubernetes a Step Behind - 15. Security -
- Starting to Learn Kubernetes a Step Behind - 16. Components -
Last Time
In Starting to Learn Kubernetes a Step Behind - 15. Security -, we learned about permissions through RBAC. This time, we will finally learn about the components of Kubernetes.
Components
In Kubernetes, the configuration is as follows.
※ https://kubernetes.io/docs/concepts/architecture/cloud-controller/
We will learn about each component.
Current Status
pi@raspi001:~/tmp $ k get nodes
NAME STATUS ROLES AGE VERSION
raspi001 Ready master 42d v1.14.1
raspi002 Ready worker 42d v1.14.1
raspi003 Ready worker 42d v1.14.1
pi@raspi001:~/tmp $ k get pods -n kube-system -o=wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
coredns-fb8b8dccf-mtzvd 1/1 Running 34 37d 10.244.0.26 raspi001 <none> <none>
coredns-fb8b8dccf-nv6dj 1/1 Running 81 37d 10.244.2.151 raspi003 <none> <none>
etcd-raspi001 1/1 Running 31 42d 192.168.3.32 raspi001 <none> <none>
kube-apiserver-raspi001 1/1 Running 95 42d 192.168.3.32 raspi001 <none> <none>
kube-controller-manager-raspi001 1/1 Running 89 42d 192.168.3.32 raspi001 <none> <none>
kube-flannel-ds-arm-4s22p 1/1 Running 73 38d 192.168.3.34 raspi003 <none> <none>
kube-flannel-ds-arm-7nnbj 1/1 Running 88 38d 192.168.3.33 raspi002 <none> <none>
kube-flannel-ds-arm-ckwq5 1/1 Running 86 38d 192.168.3.32 raspi001 <none> <none>
kube-proxy-6fwl5 1/1 Running 31 42d 192.168.3.32 raspi001 <none> <none>
kube-proxy-wgjdq 1/1 Running 28 42d 192.168.3.33 raspi002 <none> <none>
kube-proxy-zvmqf 1/1 Running 28 42d 192.168.3.34 raspi003 <none> <none>
kube-scheduler-raspi001 1/1 Running 87 42d 192.168.3.32 raspi001 <none> <none>
The following are running on the MasterNode.
- etcd-raspi001
- kube-apiserver-raspi001
- kube-controller-manager-raspi001
- kube-scheduler-raspi001
The following are running on all Nodes.
- kube-flannel-ds
- kube-proxy
coredns is running on one Master and one Worker.
※ We set this up at this time.
etcd
This is a component that exists on the MasterNode. The distributed Key-ValueStore, etcd, stores all the information in the Kubernetes cluster. Therefore, it seems to be recommended to form a cluster so that it does not become a single point of failure. Access to the data here must be via the kube-apiserver. If you want to check directly, it would be good to use etcdctl.
kube-apiserver
This is a component that exists on the MasterNode. This is a component that provides the KubernetesAPI. It is called from kube-scheduler, kube-controller-manager, and kubelet. It only manages resources for etcd and does not start Pods.
kube-scheduler
This is a component that exists on the MasterNode. It detects unassigned Pods from Node information and sends a request to assign a Node to the Pod to the kube-apiserver. It only assigns, it does not start the Pod. When assigning a Node, it takes into account NodeAffinity and Taints.
kubelet
This is a component that operates on each Node. It detects that an unassigned Node has been assigned, and actually starts the Pod.
kube-controller-manager
This is a component that exists on the MasterNode. This is a component that runs various controllers. In Deployment or ControllerReplicaSetController, it monitors the state and looks at the expected number of Pods and the current number of Pods. It requests the kube-apiserver to adjust the excess or deficiency of Pods. After that, it becomes the flow of kube-scheduler and kubelet mentioned earlier.
kube-proxy
This is a component that operates on each Node. It forwards traffic to NodePort or ClusterIP.
kube-dns
This is a DNS server used for name resolution and service discovery within the kubernetes cluster. In my environment, I was using CoreDNS.
Others
CustomResourceDefinition(CRD) and Operator
CRD is a resource that allows you to define your own resources. This extensibility allows various developments to proceed. Since CRD is just a Kubernetes object, you need to create a custom controller called Operator as a set. It seems that it can be easily created with something called the Operator Framework.
Finally
Finally, we have been able to finish reading the contents of the Complete Guide to Kubernetes. Initially, I didn't intend to continue outputting articles to this extent. When I actually ran Kubernetes on a Raspberry Pi, I made various discoveries and got hooked.
However, from around Starting to learn Kubernetes a step behind - 12. Resource Limits -, for various reasons, I ended up using the content of the book almost as it was. (laughs)
From now on, I'm thinking of trying to develop applications using GKE.
Share
Related tags
- Cloud Native Days Tokyo 2019 - Participation Report for July 22-23, 2019
- Starting to Learn Kubernetes a Step Behind - 15. Security -
- Starting to Learn Kubernetes a Step Behind - 14. Scheduling -
- Osaka, Umeda - Participation Report for Kubernetes Meetup Tokyo 19 Osaka Satellite - May 31, 2019
- Starting to Learn Kubernetes a Step Behind - 13. Health Checks and Container Lifecycle -
- Starting to Learn Kubernetes a Step Behind - 12. Resource Limits -
- Starting to Learn Kubernetes a Step Behind - 11. config&storage Part 2 -
- Starting to Learn Kubernetes a Step Behind - 10. config&storage Part 1 -
- Osaka BMXUG Study Meeting -Kubernates Experience & Watson Discovery Introduction- Participation Report on March 27, 2019
- Starting to Learn Kubernetes a Step Behind - 09. discovery&LB Part 2 -
- Starting to Learn Kubernetes a Step Behind - 08. discovery&LB Part 1 -
- Starting to Learn Kubernetes a Step Behind - 07. Workloads Part 3 -
- Starting to Learn Kubernetes a Step Behind - 06. Workloads Part 2 -
- Starting to Learn Kubernetes a Step Behind - 05. workloads Part 1 -
- Starting to Learn Kubernetes a Step Behind - 04. kubectl -
- Starting to Learn Kubernetes a Step Behind - 03. Raspberry Pi -
- Starting to Learn Kubernetes a Step Behind - 02. Docker For Mac -
- Starting to Learn Kubernetes a Step Behind - 01. Choosing the Environment -