©2020 VMware, Inc.
Cluster API による Kubernetes 環境のラ
イフサイクル管理と
マルチクラウド環境での適用
Jul. 30, 2020
CTO, North Asia (Japan, Korea and Greater China)
Motonori Shindo / motonori_shindo
2©2020 VMware, Inc.
GNU
Photo by Charl Durand on Unsplash
GNU’s Not Unix
3©2020 VMware, Inc.
Cluster API とは
Kubernetes スタイルの API を使って Kubernetes の
クラスタのライフサイクルを管理するための仕組み
Kubernetes の Cluster Lifecycle SIG で仕様の制定
が行われている
2020 年 7 月時点での API version は “v1alpha3“
4©2020 VMware, Inc.
Kubernetes クラスタのライフサイクル管理
・・・
Day 0
オペレーシ
ョン
作成
設定
Day 2
オペレーシ
ョン
アップグレード
リサイズ
メンテナンス
5©2020 VMware, Inc.
Kubernetes Stack
API Driven Infrastructureインフラストラクチャ
kubeadm,etc.ブートストラップ
Kubernetesランタイム
6©2020 VMware, Inc.
Kubernetes Stack
API Driven Infrastructureインフラストラクチャ
kubeadm,etc.ブートストラップ
Kubernetesランタイム
ClusterAPIプロビジョンニング
7©2020 VMware, Inc.
Cluster API のアーキテクチャ
Management Cluster
Custom Resources
Cluster API Controller
Bootstrap Provider
Controller
Infrastructure
Provider Controller
Cluster
MachineDeployment
ControlPlane
Workload Clusters
Node
Node
Node
8©2020 VMware, Inc.
2020/7 時点でサポートされている Provider
Rael Garcia from go.rael.dev/kubecap19-eu
最新リスト: https://cluster-api.sigs.k8s.io/reference/providers.html
9©2020 VMware, Inc.
Cluster API Custom Resource Definitions (CRDs)
Pod
ReplicaSet
Deployment
Cluster
Machine
MachineSet
ControlPlane
MachineDeployment
Kubernetes Cluster API
10©2020 VMware, Inc.
Cluster API 処理の流れ
Management
Cluster
Operator
clusterctl config kubectl apply
clusterctl init
Workload
Cluster
clusterctl config kubectl apply
Workload
Cluster
11Confidential │ ©2020 VMware, Inc.
Cluster リソース
クラスタ全体の設定を規定
Pod の CIDR
controlPlane および
infrastructure へのリファレン
ス
apiVersion: cluster.x-k8s.io/v1alpha3
kind: Cluster
metadata:
name: aws-demo
namespace: default
spec:
clusterNetwork:
pods:
cidrBlocks:
- 192.168.0.0/16
controlPlaneRef:
apiVersion: controlplane.cluster.x-k8s.io/v1alpha3
kind: KubeadmControlPlane
name: aws-demo-control-plane
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
kind: AWSCluster
name: aws-demo
12Confidential │ ©2020 VMware, Inc.
InfrastructureCluster リソース
インフラストラクチャに固有の
情報
• AWS
– リージョン
– sshKey
• vSphere
– vCenter のアドレス
– データセンタ / リソースプール
/ フォルダ
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
kind: AWSCluster
metadata:
name: aws-demo
namespace: default
spec:
region: ap-northeast-1
sshKeyName: default
13Confidential │ ©2020 VMware, Inc.
ControlPlane リソース
InfrastrucutureTemplate へのリ
ファレンス
Control Plane をブートストラ
ップするのに必要となるパラメ
ータ
Master のノード数
K8S のバージョン
apiVersion: controlplane.cluster.x-k8s.io/v1alpha3
kind: KubeadmControlPlane
metadata:
name: aws-demo-control-plane
namespace: default
spec:
infrastructureTemplate:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
kind: AWSMachineTemplate
name: aws-demo-control-plane
kubeadmConfigSpec:
clusterConfiguration:
…
initConfiguration:
…
joinConfiguration:
…
replicas: 3
version: v1.17.3
14Confidential │ ©2020 VMware, Inc.
BootstrapConfigTemplate リソース
MachineDeployment から参照
される
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3
kind: KubeadmConfigTemplate
metadata:
name: aws-demo-md-0
namespace: default
spec:
template:
spec:
joinConfiguration:
nodeRegistration:
kubeletExtraArgs:
cloud-provider: aws
name: '{{ ds.meta_data.local_hostname }}'
15Confidential │ ©2020 VMware, Inc.
InfrastrucutreMachineTemplate リソース
インフラストラクチャに固有の
Machine に関する情報
• AWS
– インスタンスタイプ
• vSphere
– メモリ
– ディスクサイズ
– データセンタ / リソースプール
/ フォルダ
– テンプレート名
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
kind: AWSMachineTemplate
metadata:
name: aws-demo-control-plane
namespace: default
spec:
template:
spec:
iamInstanceProfile: control-plane.cluster-api-provider-aws.sigs.k8s.io
instanceType: t3.large
sshKeyName: default
16Confidential │ ©2020 VMware, Inc.
MachineDeployment リソース
Machine、MachineSet を宣言
的にアップデートするために必
要となる情報
Workload Cluster のノード数
ブートストラップへのリファン
レス
K8S バージョン
apiVersion: cluster.x-k8s.io/v1alpha3
kind: MachineDeployment
metadata:
name: aws-demo-md-0
namespace: default
spec:
clusterName: aws-demo
replicas: 3
selector:
matchLabels: null
template:
spec:
bootstrap:
…
clusterName: aws-demo
infrastructureRef:
…
version: v1.17.3
‹#› 17Confidential │ ©2020 VMware, Inc.
Demo: Cluster Bootstrap
18©2020 VMware, Inc.
19©2020 VMware, Inc.
‹#›Confidential │ ©2020 VMware, Inc.
Kubernetes is yet another
application managed by
Kubernetes
Photo by Josh Rocklage on Unsplash
21©2020 VMware, Inc.
GitOps by ArgoCD
Management
Cluster
Operator
git commit
git push
Workload
Cluster
Workload
Cluster
Webhook
‹#› 22Confidential │ ©2020 VMware, Inc.
Demo: GitOps
23©2020 VMware, Inc.
24©2020 VMware, Inc.
課題: 複数の異なるテクノロジー製品、手法、プロセス、チーム、専門知識
マルチクラウドは時代の流れ
‹#› 25Confidential │ ©2020 VMware, Inc.
Demo: Multi Cloud Management with Cluster
API
26©2020 VMware, Inc.
VMware Tanzu Mission Control
新規クラスタ
作成
既存クラスタ
のアッタチ
TanzuMission Control
認証とアクセス
セキュリティと
コンプライアン
ス
設定と監査 データ保全
クラスタ
ライフサイクル
管理
アプリ&サービス
管理
可視化と分析 最適化
接続性と
トラフィック管理
Tanzu Application
Catalog
Tanzu Observability
by Wavefront
Tanzu Service Mesh
Tanzu
Kubernetes
Grid
複数クラウドにまたがる複数の Kubernetes 環境を一元管理
* vSphere と Azure サポートは近日対応予定
*
*
‹#› 27Confidential │ ©2020 VMware, Inc.
Demo: Tanzu Mission Control
28©2020 VMware, Inc.
29©2020 VMware, Inc.
Cluster API 主要ロードマップ
https://cluster-api.sigs.k8s.io/roadmap.html
V0.4
v1alpha
4
Pluggable LB0.3.7
v1alpha
3
Template Engine
ClusterResourceSet
Spot Instance
Cluster Autoscaler
June/July 2020 Q4 2020 TBD
API Maturityv1beta1
30©2020 VMware, Inc.
まとめ
Cluster API は Kubernetes クラスタのライフサイク
ル管理を Kubernetes 自身を使って行うための仕組
み
宣言的な特徴を活かし、Kubernetes のエコシステ
ムを最大限に活用することが可能
幅広いプラットフォームをサポートしており、マル
チクラウドを実現することができる
比較的新しいプロジェクトであるため、今後大きな
機能追加や仕様変更が発生することを許容する「覚
悟」が必要
31©2020 VMware, Inc.
https://github.com/kubernetes-sigs/cluster-api
https://github.com/kubernetes-sigs/cluster-api-provider-aws
https://github.com/kubernetes-sigs/cluster-api-provider-vsphere
https://blog.shin.do/2019/09/kubernetes-cluster-api-part1/
https://blog.pfs.nifcloud.com/20200603_cluster-api-for-nifcloud
References
©2020 VMware, Inc.
Thank You

Cluster API によるKubernetes環境のライフサイクル管理とマルチクラウド環境での適用

  • 1.
    ©2020 VMware, Inc. ClusterAPI による Kubernetes 環境のラ イフサイクル管理と マルチクラウド環境での適用 Jul. 30, 2020 CTO, North Asia (Japan, Korea and Greater China) Motonori Shindo / motonori_shindo
  • 2.
    2©2020 VMware, Inc. GNU Photoby Charl Durand on Unsplash GNU’s Not Unix
  • 3.
    3©2020 VMware, Inc. ClusterAPI とは Kubernetes スタイルの API を使って Kubernetes の クラスタのライフサイクルを管理するための仕組み Kubernetes の Cluster Lifecycle SIG で仕様の制定 が行われている 2020 年 7 月時点での API version は “v1alpha3“
  • 4.
    4©2020 VMware, Inc. Kubernetesクラスタのライフサイクル管理 ・・・ Day 0 オペレーシ ョン 作成 設定 Day 2 オペレーシ ョン アップグレード リサイズ メンテナンス
  • 5.
    5©2020 VMware, Inc. KubernetesStack API Driven Infrastructureインフラストラクチャ kubeadm,etc.ブートストラップ Kubernetesランタイム
  • 6.
    6©2020 VMware, Inc. KubernetesStack API Driven Infrastructureインフラストラクチャ kubeadm,etc.ブートストラップ Kubernetesランタイム ClusterAPIプロビジョンニング
  • 7.
    7©2020 VMware, Inc. ClusterAPI のアーキテクチャ Management Cluster Custom Resources Cluster API Controller Bootstrap Provider Controller Infrastructure Provider Controller Cluster MachineDeployment ControlPlane Workload Clusters Node Node Node
  • 8.
    8©2020 VMware, Inc. 2020/7時点でサポートされている Provider Rael Garcia from go.rael.dev/kubecap19-eu 最新リスト: https://cluster-api.sigs.k8s.io/reference/providers.html
  • 9.
    9©2020 VMware, Inc. ClusterAPI Custom Resource Definitions (CRDs) Pod ReplicaSet Deployment Cluster Machine MachineSet ControlPlane MachineDeployment Kubernetes Cluster API
  • 10.
    10©2020 VMware, Inc. ClusterAPI 処理の流れ Management Cluster Operator clusterctl config kubectl apply clusterctl init Workload Cluster clusterctl config kubectl apply Workload Cluster
  • 11.
    11Confidential │ ©2020VMware, Inc. Cluster リソース クラスタ全体の設定を規定 Pod の CIDR controlPlane および infrastructure へのリファレン ス apiVersion: cluster.x-k8s.io/v1alpha3 kind: Cluster metadata: name: aws-demo namespace: default spec: clusterNetwork: pods: cidrBlocks: - 192.168.0.0/16 controlPlaneRef: apiVersion: controlplane.cluster.x-k8s.io/v1alpha3 kind: KubeadmControlPlane name: aws-demo-control-plane infrastructureRef: apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 kind: AWSCluster name: aws-demo
  • 12.
    12Confidential │ ©2020VMware, Inc. InfrastructureCluster リソース インフラストラクチャに固有の 情報 • AWS – リージョン – sshKey • vSphere – vCenter のアドレス – データセンタ / リソースプール / フォルダ apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 kind: AWSCluster metadata: name: aws-demo namespace: default spec: region: ap-northeast-1 sshKeyName: default
  • 13.
    13Confidential │ ©2020VMware, Inc. ControlPlane リソース InfrastrucutureTemplate へのリ ファレンス Control Plane をブートストラ ップするのに必要となるパラメ ータ Master のノード数 K8S のバージョン apiVersion: controlplane.cluster.x-k8s.io/v1alpha3 kind: KubeadmControlPlane metadata: name: aws-demo-control-plane namespace: default spec: infrastructureTemplate: apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 kind: AWSMachineTemplate name: aws-demo-control-plane kubeadmConfigSpec: clusterConfiguration: … initConfiguration: … joinConfiguration: … replicas: 3 version: v1.17.3
  • 14.
    14Confidential │ ©2020VMware, Inc. BootstrapConfigTemplate リソース MachineDeployment から参照 される apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3 kind: KubeadmConfigTemplate metadata: name: aws-demo-md-0 namespace: default spec: template: spec: joinConfiguration: nodeRegistration: kubeletExtraArgs: cloud-provider: aws name: '{{ ds.meta_data.local_hostname }}'
  • 15.
    15Confidential │ ©2020VMware, Inc. InfrastrucutreMachineTemplate リソース インフラストラクチャに固有の Machine に関する情報 • AWS – インスタンスタイプ • vSphere – メモリ – ディスクサイズ – データセンタ / リソースプール / フォルダ – テンプレート名 apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 kind: AWSMachineTemplate metadata: name: aws-demo-control-plane namespace: default spec: template: spec: iamInstanceProfile: control-plane.cluster-api-provider-aws.sigs.k8s.io instanceType: t3.large sshKeyName: default
  • 16.
    16Confidential │ ©2020VMware, Inc. MachineDeployment リソース Machine、MachineSet を宣言 的にアップデートするために必 要となる情報 Workload Cluster のノード数 ブートストラップへのリファン レス K8S バージョン apiVersion: cluster.x-k8s.io/v1alpha3 kind: MachineDeployment metadata: name: aws-demo-md-0 namespace: default spec: clusterName: aws-demo replicas: 3 selector: matchLabels: null template: spec: bootstrap: … clusterName: aws-demo infrastructureRef: … version: v1.17.3
  • 17.
    ‹#› 17Confidential │©2020 VMware, Inc. Demo: Cluster Bootstrap
  • 18.
  • 19.
  • 20.
    ‹#›Confidential │ ©2020VMware, Inc. Kubernetes is yet another application managed by Kubernetes Photo by Josh Rocklage on Unsplash
  • 21.
    21©2020 VMware, Inc. GitOpsby ArgoCD Management Cluster Operator git commit git push Workload Cluster Workload Cluster Webhook
  • 22.
    ‹#› 22Confidential │©2020 VMware, Inc. Demo: GitOps
  • 23.
  • 24.
    24©2020 VMware, Inc. 課題:複数の異なるテクノロジー製品、手法、プロセス、チーム、専門知識 マルチクラウドは時代の流れ
  • 25.
    ‹#› 25Confidential │©2020 VMware, Inc. Demo: Multi Cloud Management with Cluster API
  • 26.
    26©2020 VMware, Inc. VMwareTanzu Mission Control 新規クラスタ 作成 既存クラスタ のアッタチ TanzuMission Control 認証とアクセス セキュリティと コンプライアン ス 設定と監査 データ保全 クラスタ ライフサイクル 管理 アプリ&サービス 管理 可視化と分析 最適化 接続性と トラフィック管理 Tanzu Application Catalog Tanzu Observability by Wavefront Tanzu Service Mesh Tanzu Kubernetes Grid 複数クラウドにまたがる複数の Kubernetes 環境を一元管理 * vSphere と Azure サポートは近日対応予定 * *
  • 27.
    ‹#› 27Confidential │©2020 VMware, Inc. Demo: Tanzu Mission Control
  • 28.
  • 29.
    29©2020 VMware, Inc. ClusterAPI 主要ロードマップ https://cluster-api.sigs.k8s.io/roadmap.html V0.4 v1alpha 4 Pluggable LB0.3.7 v1alpha 3 Template Engine ClusterResourceSet Spot Instance Cluster Autoscaler June/July 2020 Q4 2020 TBD API Maturityv1beta1
  • 30.
    30©2020 VMware, Inc. まとめ ClusterAPI は Kubernetes クラスタのライフサイク ル管理を Kubernetes 自身を使って行うための仕組 み 宣言的な特徴を活かし、Kubernetes のエコシステ ムを最大限に活用することが可能 幅広いプラットフォームをサポートしており、マル チクラウドを実現することができる 比較的新しいプロジェクトであるため、今後大きな 機能追加や仕様変更が発生することを許容する「覚 悟」が必要
  • 31.
  • 32.

Editor's Notes