理解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.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章