- 快召唤伙伴们来围观吧
- 微博 QQ QQ空间 贴吧
- 文档嵌入链接
- 复制
- 微信扫一扫分享
- 已成功复制到剪贴板
通过腾讯案例研究深入了解 Cluster API
展开查看详情
1 .Cluster API Deep Dive With a Tencent Case Study
2 .闵峰 Feng Min 洪志国 Zhiguo Hong Staff Software Engineer at Google Software Architect at Tencent Cloud. Kubernetes team.
3 . Agenda • What’s Cluster API • Upgrade as example • Bootstrapping • How to deploy • Demo
4 .Where we are ● Cluster Management is a hard job. ● Fragmented tooling and ecosystem. ● Too many tools to choose from. ● Reinventing wheels.
5 .What’s Cluster API? ● Cluster Declarative API ● Machine ● Machine Set + Machine Deployment ● Machine Lifecycle (incl. Provisioning) Common Logic ● Machine Upgrade ● Infrastructure platform (vSphere, GCP, AWS, etc.) Pluggable Architecture ● Support for various Operating Systems ● Cluster Bootstrapping, Upgrade Tooling, Services ● Auto-scaling, Repair, Node Auto-provisioning
6 .What’s Cluster API Cluster Config with Declarative API
7 . What is configured? apiVersion: "cluster-api.k8s.io/v1alpha1" ● Cluster-level Configuration kind: Cluster ○ Network metadata: • Machine setup name: kubecon-demo • # of machines? spec: • Platform-specific clusterNetwork: configuration services: • GCP project, machine type cidrBlocks: ["10.96.0.0/12"] • Software on those machines pods: • Kubelet Version cidrBlocks: ["192.168.0.0/16"] • Control Plane serviceDomain: "cluster.local"
8 . What is configured? apiVersion: "cluster.k8s.io/v1alpha1" ● Cluster-level Configuration kind: MachineSet ○ Network metadata: • Machine setup name: my-first-machineset • # of machines? spec: • Platform-specific replicas: 3 configuration template: • GCP project, machine type metadata: • Software on those machines spec: • Kubelet Version ... • Control Plane roles: - Node
9 . What is configured? apiVersion: "cluster.k8s.io/v1alpha1" ● Cluster-level Configuration kind: Machine ○ Network metadata: • Machine setup name: gce-master-kubecon • # of machines? spec: • Platform-specific providerConfig: > configuration { • GCP project, machine type "project": "gke-kubecon", • Software on those machines "zone": "us-central1-f", • Kubelet Version "machineType": "n1-standard-2", • Control Plane "image": "/path/to/ubuntu-1604-lts" }
10 . What is configured? apiVersion: "cluster.k8s.io/v1alpha1" ● Cluster-level Configuration kind: Machine ○ Network metadata: • Machine setup name: gce-master-kubecon • # of machines? spec: • Platform-specific providerConfig: { configuration ... • GCP project, machine type } • Software on those versions: machines kubelet: 1.7.4 • Kubelet Version controlPlane: 1.7.4 • Control Plane
11 .What’s Cluster API Tooling, YAML, CRDs, Controllers
12 .Logical Flow - YAML to Objects
13 .Logical Flow - Objects to Machines
14 .Case Study: Upgrade How do we upgrade K8s Cluster using Cluster API?
15 .Upgrade MachineDeployment - replicas: 3 - nodes: MyNodes - maxSurge: 1 - maxUnavailable: 0 - version: v1.8.3
16 .Upgrade MachineDeployment - replicas: 3 - nodes: MyNodes - maxSurge: 1 - maxUnavailable: 0 - version: v1.9.3
17 . Upgrade MachineSet - replicas: 3 - version: v1.8.3 - selector: - nodes: MyNodes
18 . Upgrade MachineSet MachineSet - replicas: 3 - replicas: 0 - version: v1.8.3 - version: v1.9.3 - selector: - selector: - nodes: MyNodes - nodes: MyNodes
19 . Upgrade MachineSet MachineSet - replicas: 3 - replicas: 1 - version: v1.8.3 - version: v1.9.3 - selector: - selector: - nodes: MyNodes - nodes: MyNodes
20 . Upgrade MachineSet MachineSet - replicas: 2 - replicas: 2 - version: v1.8.3 - version: v1.9.3 - selector: - selector: - nodes: MyNodes - nodes: MyNodes
21 . Upgrade MachineSet MachineSet - replicas: 1 - replicas: 3 - version: v1.8.3 - version: v1.9.3 - selector: - selector: - nodes: MyNodes - nodes: MyNodes
22 . Upgrade MachineSet MachineSet - replicas: 0 - replicas: 3 - version: v1.8.3 - version: v1.9.3 - selector: - selector: - nodes: MyNodes - nodes: MyNodes
23 .Bootstrapping How to get cluster api components up and running?
24 .Bootstrapping - 10 km view CLI User Local Temporary Control External Cluster Plane
25 .Bootstrapping - 10 km view CLI User Local Temporary Control External Cluster Plane Machine Controller Cluster Controller
26 .Bootstrapping - 10 km view CLI User Local Temporary Control External Cluster Plane Machine Machine A Controller Cluster Cluster A Controller
27 .Bootstrapping - 10 km view Control CLI User Cluster Plane Local Temporary Control External Cluster Plane Machine Machine A Controller Cluster Cluster A Controller
28 .Bootstrapping - 10 km view Control CLI User Cluster Plane Machine A Local Temporary Control External Cluster Plane Cluster A Machine Machine A Controller Cluster Cluster A Controller
29 .Bootstrapping - 10 km view Control CLI User Cluster Plane Machine Machine A Controller Local Temporary Control External Cluster Plane Cluster Cluster A Machine Controller Machine A Controller Cluster Cluster A Controller