kubernetes series of tutorials (a) Preliminary kubernetes features and components

Introduction 1. kubernetes

Introduction 1.1 kubernetes

Kubernetes google open source is a set of micro-services, containerized orchestration engine, google internal container is more than ten years of actual combat precipitated crystals has overcome Swarm, Messo become the industry standard container choreography. kuberntes built a lot of excellent features enables developers to focus on the business itself, which contains the following functions:

  • Service discovery and load balancing, service discovery and load balancing, internal resolution through DNS, service load balancing
  • Storage orchestration, storage arrangement, in the form of multiple storage plungin support, such as local, nfs, ceph, public cloud fast storage,
  • Automated rollouts and rollbacks, automated publishing and rollback, unanimously adopted matches the current state and the target state, can be rolled back when the update fails
  • Automatic bin packing, automatic resource scheduling, scheduling can set the pod (Requests) resources and resource constraints (Limits)
  • Self-healing, built-in health check policies, auto-discovery and treatment of abnormalities in the cluster, the replacement, we need to restart the pod node
  • Secret and configuration management, key and configuration management for sensitive information such as passwords, account numbers that through secret storage, applications, configuration files configmap storage, to avoid profile fixed in the mirror, to increase the flexibility of the container arrangement
  • Batch execution, batch execution, provide an implementation of a single batch jobs and circulatory function by scheduled tasks and job cronjob
  • Horizontal scaling, lateral extensions, with HPA and the AS, CPU utilization-based elastically stretchable and elastically stretchable based platform level, such as automatic delete nodes and node i.e. node application.

1.2 kubernetes architecture

kubernetes overall architecture

kubernetes contains two roles: master nodes and node node, master node is the control and management node in the cluster as a whole brain k8s cluster.

  • 负责集群所有接入请求(kube-apiserver),在整个集群的入口;
  • 集群资源调度(kube-controller-scheduler),通过watch监视pod的创建,负责将pod调度到合适的node节点;
  • 集群状态的一致性(kube-controller-manager),通过多种控制器确保集群的一致性,包含有Node Controller,Replication Controller,Endpoints Controller等;
  • 元数据信息存储(etcd),数据持久存储化,存储集群中包括node,pod,rc,service等数据;

通常由3或5个节点组成高可用集群,其中etcd内置的集群组成,kube-apiserver由haproxy或nginx做负载分发,kube-scheduler和kube-controller-manager内置的选举机制保障,确保集群内同一个时刻只有一个leader节点,其他处于阻塞状态,防止脑裂。

node节点是实际的工作节点,负责集群负载的实际运行,即pod运行的载体,其通常包含三个组件:Container Runtime,kubelet和kube-proxy

  • Container Runtime是容器运行时,负责实现container生命周期管理,如docker,containerd,rktlet;
  • kubelet负责镜像和pod的管理,
  • kube-proxy是service服务实现的抽闲,负责维护和转发pod的路由,实现集群内部和外部网络的访问。

其他组件还包括

  • cloud-controller-manager,用于公有云的接入实现,提供节点管理(node),路由管理,服务管理(LoadBalancer和Ingress),存储管理(Volume,如云盘,NAS接入),需要由公有云厂商实现具体的细节,kubernetes提供实现接口的接入,如腾讯云目前提供CVM的node管理,节点的弹性伸缩(AS),负载均衡的接入(CLB),存储的管理(CBS和CFS)等产品的集成;
  • DNS is implemented by components kube-dns name of the cluster or coredns resolved;
  • kubernetes-dashboard graphical interface for management;
  • kubectl API command line tools to interact;
  • Monitoring system for acquiring data monitoring pod and the node, such as prometheus, heapster + influxdb + grafana;
  • Log collection system for collecting traffic data for the container, to achieve acquisition, storage and display of the log, there is achieved Fluentd + ELK (ElasticSearch + Logstash + Kiabana).

1.3 Reference Documents

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

  2. Introducing kuberneteshttps://kubernetes.io/docs/concepts/overview/components/


Return kubernetes series of tutorials directory

** If you think the article is helpful to you, please subscribe column to share it to a friend in need

Guess you like

Origin blog.51cto.com/happylab/2466828