KubeCon + CloudNativeCon North America 2018

Cluster API Kubecon 2018 on prem and public clouds

1. Using the Cluster API to Deploy Clusters On-Prem and in Public Clouds Kris Nova Loc Nguyen
2. Appendix j.hept.io/cluster-api-kubecon-2018 Loc Nguyen OSS Engineer at VMware focused on the container space github.com/sflxn Kris Nova Senior developer advocate at Heptio CNCF Ambassador github.com/kris-nova/me
3. Cluster API Today ● A management framework to handle day 1 and 2 operations for kubernetes cluster ○ ○ ○ ● Day 1) Bringing up a cluster ■ Solves from 0 to Kubernetes Day 2) Managing a cluster ■ Managing in an idiomatic kubernetes way ■ Upgrades ■ Scaling Standardizing a fragmented ecosystem ■ Many tools, all with varying scope and user experience Experimenting still!
4. Cluster API Today ● ● ● Core is in Alpha Many provider breakouts Thank you
5. Declared State of Cluster API ● ● ● Project was started in 2017 ○ History of cluster api blog found in Appendix (j.hept.io/cluster-api-kubecon-2018) Project Goals: ○ Atomic transactions of cluster management operations ○ Cluster automation ○ Resilient infrastructure ○ Improve user experience ○ Cluster upgrade ○ Create a community Additional goal - cross infrastructure deployment
6. Cluster API Basics ● ● ● ● clusterctl ○ Generic CLI tool for the project ○ Each cloud provider forks Deploys controller that reads cluster api CRD objects ○ Provider specific Deploys CRD objects to some kubernetes cluster ○ Cluster{} ○ Machine {} ○ MachineSet{}, MachineDeployment{} Controllers reconciles new cluster accordingly ○ Can create new cluster ○ Can mutate existing cluster
7. Controller Basics Cluster controller Provider’s cluster actuator Example Cluster Spec Cluster Spec ClusterNetwork ClusterNetwork ProviderSpec ProviderSpec Username raw Provider expanded Password vSphere spec expanded Server ProviderStatus raw ProviderStatus Provider expanded
8. Terms ● Target cluster ○ ● Bootstrap/Management cluster ○ ○ ● The cluster that manages the target cluster Possibly the same cluster clusterctl ○ ● The declared cluster we intend to create and manage Community CLI tool that favors a provider implementation for creating and managing a cluster Provider implementation ○ An implementation of the API specific to a cloud (Google, VMware, AWS, etc)
9. Usage Modes ● Self Service (original) ○ ○ ○ ● Kubernetes managing itself ■ Bootstrap problem ■ Bootstrap cluster Source of truth managing self Simpler Management Cluster ○ ○ ○ ○ Separation of concerns (admin vs cluster creators) Some secondary management cluster A little more complex Flexible
10. Usage Mode: Self-service ● When kubernetes manages itself ○ ○ ● Traits ○ ○ ● Have to solve original cluster problem ■ Using minikube requires a hypervisor Decentralized storage of cluster declaration Strength ○ ● Either by itself via solving the bootstrap problem or via a bootstrap cluster Clusterctl or some CLI drives the process Simple. User can deploy from desktop with little oversight. Weakness ○ ○ Decentralize nature makes central accounting of clusters harder May not be allowed in some enterprises
11. Usage Mode: Self-service (bootstrap) 1. Create bootstrap cluster clusterctl 2. Request target cluster 5. Destroy bootstrap Fusion or Virtualbox Minikube bootstrap cluster Target cluster cluster-api-controller cluster-api-controller vsphere-cluster-api-provider vsphere-cluster-api-provider 3. Provider create cluster 4. Cluster objects copied Cluster api objects for cluster
12. Usage Mode: Self-service (self) CRDs Controller Cluster Creation Target cluster cluster-api-controller Provider Cluster api objects for cluster
13. Cluster Lifecycle: Management Cluster ● ● ● Secondary design Solves the bootstrap problem of how to create the initial cluster Traits ○ ○ ● Strength ○ ○ ● Has two primary roles: admin and cluster creator Central storage of clusters declarations Central accounting of clusters declarations makes monitoring easier User do not need any extra software (e.g. minikube or desktop hypervisor) Weakness ○ ○ Requires admin to deploy the initial cluster Until these projects are mature, getting logs, tracing maybe difficult
14. Cluster Lifecycle: Management Cluster 1. Request target cluster clusterctl management cluster cluster-api-controller vsphere-cluster-api-provider Target cluster cluster-api-controller vsphere-cluster-api-provider Target cluster Cluster api objects for cluster
15. vSphere Provider ● ● Supports self-service and management cluster models Admin workflow ○ ○ ○ ○ ○ ● Deploys OVA to vSphere ■ OVA deploys initial management cluster SCP kubeconfig from the management cluster Deploys Cluster API to the management cluster (via clusterctl or kubectl) Creates a VM template from a cloud image OS ISO (e.g. Ubuntu) Provide kubeconfig to cluster creators Cluster creators workflow ○ Uses clusterctl to create target cluster using the kubeconfig
16. vSphere Provider ● Why a management cluster? ○ ○ ○ ○ Many users of vSphere are administrators and devops Visibility into resources used by the created clusters An OVA is a preferred deployment model for vSphere users ■ Server driven and not desktop driven ■ Removes requirements for additional software (minikube and hypervisor) ■ Less stack to debug if things go wrong (minikube and hypervisor) OVA can present UI wizard that can customize the management cluster ■ CNI (future) ■ Backup/restore (future)
17. AWS Provider ● ● ● History of AWS ○ Kops ○ Kubicorn ○ EKS ○ Therapy doc Usage Mode ○ Bootstrap cluster ○ Minikube Resellient ● ● ● ● Create a bootstrap cluster Generates secrets Creates AWS cluster(s) Controller manager ○ Multiple controllers
18. Q&A ● Does audience want to see demos? ○ Less time for Q&A if we do demos ○ Show of hands
19. Related Sessions ● Cluster API Deep Dive, Robert Bailey and David Watson ○ Thurs, 2:35-3:10
20. Thank You! j.hept.io/cluster-api-kubecon-2018 Please take the survey! https://goo.gl/forms/F82740R30ONnJzZB2