理解k8s容器编排系统

  • Kubuernets(k8s, kube, 官网)

    Kubuernets, 简称为k8s(因为k首尾s之间有8个字符),由来及作用参见《RedHat:Kubernetes是什么?》。

    摘要:Kubuernets前身是Google支撑每周>20亿容器的Borg平台。真正的生产型应用会涉及部署在多个主机上的多个多层容器,kube可以实现跨公有云、私有云、混合云的集群。

  • Kubuernets概念

    1. 主机(Master):用于控制Kubernets节点的计算机。
    2. 节点(Node):负责执行请求和所分配任务的计算机。
    3. 容器集(Pod):被部署在单个节点上,且包含一个或多个容器的容器组。同一容器集中的所有容器共享同一个IP地址、IPC、主机名称及其他容器。容器集会将网络和存储从底层容器中抽象出来,这样就可以更加轻松的在集群中移动容器。
    4. 复制控制器(Replication controller):用于控制应在集群某处运行的完全相同的容器集副本数量。
    5. 服务(Service):将工作内容与容器集分离。Kubernetes服务代理会自动将服务请求分发到正确的容器集–无论这个容器集会移到集群中的哪个位置,甚至可以被替换掉。
    6. Kubelet:运行在节点上的服务,可读取容器清单(container manifest),确保指定的容器启动并运行。
    7. kubectl:Kubernetes的命令行配置工具。
  • 官方Tutorials

    A Kubernetes cluster consists of two types of resources:

    • The Master coordinates(协调) the cluster
    • Nodes are the workers that run applications。Each node has a Kubelet, which is an agent for managing the node and communicating with the Kubernetes master.The node communicates with the master using the Kubernetes API.

    在这里插入图片描述

    ​ A Kubernetes cluster that handles production traffic should have a minimum of three nodes.

  • Minikube

    Minikube is a lightweifht Kubernetes implementation that creates a VM on your local machine and deploys a simple cluster containing only one node.

    minikube version # 查看版本
    minikube start # 启动一个cluter
    kubectl version # 查看kubectl版本
    kubectl cluster-info # 查看集群详情
    kubectl get nodes # 查看所有节点
    
  • Deployment

    The Deployment instructs Kubernetes how to create and update instaces of your applications.

    Once you’ve created a Deployment, the Kubernetes master schedules the application instances included in that Deployment to run on individual Nodes in the cluster.

    Once the appplication instances are created, a Kubernetes Deployment Controller continuously monitors those instances.

    If the Node hosting an instance goes down or is deleted, the Deployment controller replaces the instance with an instance on another Node in the cluster.

猜你喜欢

转载自blog.csdn.net/The_Time_Runner/article/details/105870318