SlideShare a Scribd company logo
1 of 30
Download to read offline
K8s ClusterAPIManaging the infrastructure of
Kubernetes Cluster
Rhein-Neckar
K8s Cluster API Folie 2
Who I am? Tobi
Who are we working for? Loodse GmbH
Kubernetes?! Short recap
Kubermatic?! What’s that?
Node Deployment Solutions The old way
Cluster API! Make K8s even greater
Hetzner Machine! Implementation of Machine Provider
Demo time! Praise the demo gods!
Review! State, Pro and Cons
Agenda
toschneck
@toschneck
Tobias Schneck
Sebastian Scheele
Headquarter in
in Hamburg, Germany
Founders
Awarded by
> 25 employees
world wide
Founded in 2016
Julian Hansert
Cloud native
and container
technologies
Software
development
K8s certified
Multi & Hybrid Cloud
Container Engine Partners
Silver Member
& Training Partner
GCP & Training
Partner
K8s Cluster API Folie 5
Kubernetes
K8s Cluster API Folie 6
Kubernetes - a short recap
K8s Cluster API Folie 7
Kubernetes SIG - Cluster API
● Subproject of sig-cluster-lifecycle
○ Focus cluster deployment and upgrades
○ Other Projects: kops, kubeadm, minikube
● Repos
○ (old, in migration) https://github.com/kubernetes/kube-deploy
○ (new) https://github.com/kubernetes-sigs/cluster-api
● Main participants:
○ Google, Redhat, Heptio, VMware, Loodse …
● Open Development: Get involved!
K8s Cluster API Folie 8
K8s Cluster API Folie 9
Currently Supported Providers
Bare Metal
Node Deployment Solution
Why we
implemented
Cluster API?
K8s Cluster API Folie 12
• Need Ops to scale the cluster
• No generic approach
• Each implementation needs
specific knowledge
• Scaling of new nodes requires
external dependencies
• No generic node auto scaling
• Huge effort to deploy k8s on a
different platform
Node Node Node
Master
Node
Current Approach
K8s Cluster API Folie 13
Kubernetes Cluster BKubernetes Cluster B
Kubernetes Cluster A
Cluster API
Infrastructure Providers
Cloud, On-Prem, Bare Metal
Potential Providers =>
bootstraping CLI
upgrade trigger
Provider Specifc Config
autoscaling
Bootstrapping Machine/Cluster
etcd
Cluster
Machine
MachineSet
Cluster API Server
(ext-apiserver)
group: cluster.,k8s.io
Controller Manager
Machine Controler
Prov. Config
Provider Machine
Actuator
Master Machine(s) NodeMachine(s)
kubeadm kubeadm
API
Server etcd
Kubernetes Cluster B
Master Machine(s) NodeMachine(s)
Provisions
Manage Cluster
and Machines
- Creates Machines
- Bootstraps Cluster
- Upgrades Cluster
API Server + Controllers can be
provided after bootstrapping
Kubermatic
Machine Controller
K8s Cluster API Folie 14
kubectl create machines
• Generic cluster scaling
• Pets vs cattle for nodes
• Implementation of generic auto
scaling possible
• Very similar setup for different
provider
Node Node Node
Master
Node
Kubernetes Native Integration
Cluster API
K8s Cluster API Folie 15
• A "Machine" is the declarative spec for a Node,
as represented in Kubernetes core.
• After provisioning a new Node matching the
Machine spec is registered.
Machines/Nodes
Let’s take a look
at the Code!
K8s Cluster API Folie 17
How does a machine look like?
apiVersion: "machine.k8s.io/v1alpha1"
kind: Machine
metadata:
name: machine1
spec:
metadata:
name: node1
providerConfig:
sshPublicKeys: []
cloudProvider: "hetzner"
cloudProviderSpec:
token: MY-HZ-TOKEN
serverType: "cx11"
datacenter: ""
location: "fsn1"
operatingSystem: "ubuntu"
K8s Cluster API Folie 18
MachineController
Watches for new Machine resources
Provision the machine using provider-specific drivers
• Machine joins the cluster
• Kubelet creates the Node resource
Machine
Resources
K8s Cluster API Folie 19
How does it work?
K8s Cluster API Folie 20
How does it work?
● Render Userdata
○ CoreOS, Ubuntu & CentOS
● Create instance at Cloudprovider
○ Install Container Runtime, Kubelet, Kubeadm
○ Use Kubeadm + Token to join node
● Match Node to Machine, set ownerRef
K8s Cluster API Folie 21
How to implement a new provider?
// Provider exposed all required functions to interact with a cloud provider
type Provider interface {
AddDefaults(spec v1alpha1.MachineSpec) (v1alpha1.MachineSpec, bool, error)
// Validate validates the given machine's specification.
//
// In case of any error a "terminal" error should be set,
// See v1alpha1.MachineStatus for more info
Validate(machinespec v1alpha1.MachineSpec) error
// Get gets a node that is associated with the given machine.
//
// Note that this method can return what we call a "terminal" error,
// which indicates that a manual interaction is required to recover from this state.
// See v1alpha1.MachineStatus for more info and TerminalError type
Get(machine *v1alpha1.Machine) (instance.Instance, error)
GetCloudConfig(spec v1alpha1.MachineSpec) (config string, name string, err error)
// Create creates a cloud instance according to the given machine
Create(machine *v1alpha1.Machine, update MachineUpdater, userdata string) (instance.Instance, error)
Delete(machine *v1alpha1.Machine, update MachineUpdater, instance instance.Instance) error
}
K8s Cluster API Folie 22
How to implement a new provider?
// Provider exposed all required functions to interact with a cloud provider
type Provider interface {
AddDefaults(spec v1alpha1.MachineSpec) (v1alpha1.MachineSpec, bool, error)
// Validate validates the given machine's specification.
//
// In case of any error a "terminal" error should be set,
// See v1alpha1.MachineStatus for more info
Validate(machinespec v1alpha1.MachineSpec) error
// Get gets a node that is associated with the given machine.
//
// Note that this method can return what we call a "terminal" error,
// which indicates that a manual interaction is required to recover from this state.
// See v1alpha1.MachineStatus for more info and TerminalError type
Get(machine *v1alpha1.Machine) (instance.Instance, error)
GetCloudConfig(spec v1alpha1.MachineSpec) (config string, name string, err error)
// Create creates a cloud instance according to the given machine
Create(machine *v1alpha1.Machine, update MachineUpdater, userdata string) (instance.Instance, error)
Delete(machine *v1alpha1.Machine, update MachineUpdater, instance instance.Instance) error
}
github.com/kubermatic/machine-controller/../hetzner/provider.go
K8s Cluster API Folie 23
Where to get it and how to use it?
github.com/kubermatic/machine-controller
● Apache2 license
● Contains Machine Controllers for:
AWS, Azure, DigitalOcean, Hetzner, OpenStack, vSphere
kubectl apply -f examples/machine-controller.yaml
kubectl apply -f examples/machine-${my_provider}.yaml
K8s Cluster API Folie 24
New -> MachineSet
Set definitions for Machines
apiVersion: "cluster.k8s.io/v1alpha1"
kind: MachineSet
metadata:
name: << MACHINE_NAME >>
namespace: kube-system
spec:
replicas: 1
selector:
matchLabels:
name: << MACHINE_NAME >>
template:
metadata:
labels:
name: << MACHINE_NAME >>
spec:
providerConfig:
value:
sshPublicKeys:
- "<< YOUR_PUBLIC_KEY >>"
cloudProvider: "vsphere"
cloudProviderSpec:
templateVMName: '<< OS_NAME >>-template'
username: '<< VSPHERE_USERNAME >>'
vsphereURL: '<< VSPHERE_ADDRESS >>'
datacenter: 'Datacenter'
folder: '/Datacenter/vm/e2e-tests'
password: << VSPHERE_PASSWORD >>
cluster: '<< VSPHERE_CLUSTER >>'
datastore: datastore1
allowInsecure: true
cpus: 2
MemoryMB: 2048
operatingSystem: "<< OS_NAME >>"
operatingSystemSpec:
distUpgradeOnBoot: false
containerRuntimeInfo:
name: "<< CONTAINER_RUNTIME >>"
versions:
kubelet: "<< KUBERNETES_VERSION >>"
“Praise the demo gods” - Kelsey Hightower
DEMO TIME
K8s Cluster API Folie 26
ClusterAPI - Quo Vadis?
● Currently in Alpha
● Types do change in a backwards-incompatible way
● Some questions do not have a final answer yet
● Does not solve all problems, e.G. Backup & Restore
● Already allows easy decoupling of general applicable from provider-specific code
● Generic cluster-autoscaler possible
● Participation from Google & RedHat
K8s Cluster API Folie 27
Cluster API <> Kubermatic
Kubermatic is based on Cluster API and Machine Controllers and adds:
● Kubermatic Dashboard
● Backup & Restore Concept
● Cluster Upgrade Mechanism
● Secure Communication between Bootstrapping Cluster and User Cluster
● Control of different on-prem/public Cloud Provider over one Master Plane
● Prometheus Meta Monitoring and Alerting
● ELK Stack for Infrastructure
● User Management (v2.8)
Try it yourself!
(Only AWS, Digital Ocean enabled)
https://cloud.kubermatic.io
Questions?
We are hiring!
Hamburg, Berlin, Munich, San Francisco, Gdańsk, …
www.loodse.com
@Loodse

More Related Content

What's hot

What's hot (20)

Deploying your first application with Kubernetes
Deploying your first application with KubernetesDeploying your first application with Kubernetes
Deploying your first application with Kubernetes
 
AWS ECS vs EKS
AWS ECS vs EKSAWS ECS vs EKS
AWS ECS vs EKS
 
Infrastructure-as-Code (IaC) using Terraform
Infrastructure-as-Code (IaC) using TerraformInfrastructure-as-Code (IaC) using Terraform
Infrastructure-as-Code (IaC) using Terraform
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
01. Kubernetes-PPT.pptx
01. Kubernetes-PPT.pptx01. Kubernetes-PPT.pptx
01. Kubernetes-PPT.pptx
 
CNCF Meetup - OpenShift Overview
CNCF Meetup - OpenShift OverviewCNCF Meetup - OpenShift Overview
CNCF Meetup - OpenShift Overview
 
Introduction to Docker Compose
Introduction to Docker ComposeIntroduction to Docker Compose
Introduction to Docker Compose
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Intro to Helm for Kubernetes
Intro to Helm for KubernetesIntro to Helm for Kubernetes
Intro to Helm for Kubernetes
 
Virtualization Architecture & KVM
Virtualization Architecture & KVMVirtualization Architecture & KVM
Virtualization Architecture & KVM
 
Kubernetes Networking
Kubernetes NetworkingKubernetes Networking
Kubernetes Networking
 
Introduction to helm
Introduction to helmIntroduction to helm
Introduction to helm
 
Infrastructure as Code with Terraform and Ansible
Infrastructure as Code with Terraform and AnsibleInfrastructure as Code with Terraform and Ansible
Infrastructure as Code with Terraform and Ansible
 
Docker 101 - Nov 2016
Docker 101 - Nov 2016Docker 101 - Nov 2016
Docker 101 - Nov 2016
 
Final terraform
Final terraformFinal terraform
Final terraform
 
(ARC307) Infrastructure as Code
(ARC307) Infrastructure as Code(ARC307) Infrastructure as Code
(ARC307) Infrastructure as Code
 
MSA 전략 2: 마이크로서비스, 어떻게 구현할 것인가?
MSA 전략 2: 마이크로서비스, 어떻게 구현할 것인가?MSA 전략 2: 마이크로서비스, 어떻게 구현할 것인가?
MSA 전략 2: 마이크로서비스, 어떻게 구현할 것인가?
 
Introduction of CCE and DevCloud
Introduction of CCE and DevCloudIntroduction of CCE and DevCloud
Introduction of CCE and DevCloud
 
Kubernetes in Docker
Kubernetes in DockerKubernetes in Docker
Kubernetes in Docker
 

Similar to Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s meetup@heidelberg)

Creating Kubernetes multi clusters with ClusterAPI @ Stuttgart Kubernetes Meetup
Creating Kubernetes multi clusters with ClusterAPI @ Stuttgart Kubernetes MeetupCreating Kubernetes multi clusters with ClusterAPI @ Stuttgart Kubernetes Meetup
Creating Kubernetes multi clusters with ClusterAPI @ Stuttgart Kubernetes Meetup
Tobias Schneck
 
ClusterAPI Overview - Managing multi-cloud Kubernetes Clusters - k8s Meetup@v...
ClusterAPI Overview - Managing multi-cloud Kubernetes Clusters - k8s Meetup@v...ClusterAPI Overview - Managing multi-cloud Kubernetes Clusters - k8s Meetup@v...
ClusterAPI Overview - Managing multi-cloud Kubernetes Clusters - k8s Meetup@v...
Tobias Schneck
 
Operator Lifecycle Management
Operator Lifecycle ManagementOperator Lifecycle Management
Operator Lifecycle Management
DoKC
 

Similar to Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s meetup@heidelberg) (20)

Creating Kubernetes multi clusters with ClusterAPI @ Stuttgart Kubernetes Meetup
Creating Kubernetes multi clusters with ClusterAPI @ Stuttgart Kubernetes MeetupCreating Kubernetes multi clusters with ClusterAPI @ Stuttgart Kubernetes Meetup
Creating Kubernetes multi clusters with ClusterAPI @ Stuttgart Kubernetes Meetup
 
Creating Kubernetes multi clusters with ClusterAPI in the Hetzner Cloud
Creating Kubernetes multi clusters with ClusterAPI in the Hetzner CloudCreating Kubernetes multi clusters with ClusterAPI in the Hetzner Cloud
Creating Kubernetes multi clusters with ClusterAPI in the Hetzner Cloud
 
ClusterAPI Overview - Managing multi-cloud Kubernetes Clusters - k8s Meetup@v...
ClusterAPI Overview - Managing multi-cloud Kubernetes Clusters - k8s Meetup@v...ClusterAPI Overview - Managing multi-cloud Kubernetes Clusters - k8s Meetup@v...
ClusterAPI Overview - Managing multi-cloud Kubernetes Clusters - k8s Meetup@v...
 
KubeCon 2018 - Running VM Workloads Side by Side with Container Workloads
KubeCon 2018 -  Running VM Workloads Side by Side with Container Workloads KubeCon 2018 -  Running VM Workloads Side by Side with Container Workloads
KubeCon 2018 - Running VM Workloads Side by Side with Container Workloads
 
Pro2516 10 things about oracle and k8s.pptx-final
Pro2516   10 things about oracle and k8s.pptx-finalPro2516   10 things about oracle and k8s.pptx-final
Pro2516 10 things about oracle and k8s.pptx-final
 
Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibility
 
OSS Japan 2019 service mesh bridging Kubernetes and legacy
OSS Japan 2019 service mesh bridging Kubernetes and legacyOSS Japan 2019 service mesh bridging Kubernetes and legacy
OSS Japan 2019 service mesh bridging Kubernetes and legacy
 
Kubernetes for the PHP developer
Kubernetes for the PHP developerKubernetes for the PHP developer
Kubernetes for the PHP developer
 
MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 2
MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 2MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 2
MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 2
 
Dessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloudDessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloud
 
Come costruire una Platform As A Service con Docker, Kubernetes Go e Java
Come costruire una Platform As A Service con Docker, Kubernetes Go e JavaCome costruire una Platform As A Service con Docker, Kubernetes Go e Java
Come costruire una Platform As A Service con Docker, Kubernetes Go e Java
 
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
 
Mete Atamel
Mete AtamelMete Atamel
Mete Atamel
 
.NET Core Apps: Design & Development
.NET Core Apps: Design & Development.NET Core Apps: Design & Development
.NET Core Apps: Design & Development
 
The Challenges of Becoming Cloud Native
The Challenges of Becoming Cloud NativeThe Challenges of Becoming Cloud Native
The Challenges of Becoming Cloud Native
 
How do we use Kubernetes
How do we use KubernetesHow do we use Kubernetes
How do we use Kubernetes
 
Containerised ASP.NET Core apps with Kubernetes
Containerised ASP.NET Core apps with KubernetesContainerised ASP.NET Core apps with Kubernetes
Containerised ASP.NET Core apps with Kubernetes
 
Operator Lifecycle Management
Operator Lifecycle ManagementOperator Lifecycle Management
Operator Lifecycle Management
 
Operator Lifecycle Management
Operator Lifecycle ManagementOperator Lifecycle Management
Operator Lifecycle Management
 
Exploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in PythonExploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in Python
 

More from Tobias Schneck

UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)
UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)
UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)
Tobias Schneck
 
OpenShift-Build-Pipelines: Build -> Test -> Run! @JavaForumStuttgart
OpenShift-Build-Pipelines: Build -> Test -> Run! @JavaForumStuttgartOpenShift-Build-Pipelines: Build -> Test -> Run! @JavaForumStuttgart
OpenShift-Build-Pipelines: Build -> Test -> Run! @JavaForumStuttgart
Tobias Schneck
 
OpenShift-Build-Pipelines: Build ► Test ► Run!
OpenShift-Build-Pipelines: Build ► Test ► Run!OpenShift-Build-Pipelines: Build ► Test ► Run!
OpenShift-Build-Pipelines: Build ► Test ► Run!
Tobias Schneck
 
UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018
UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018
UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018
Tobias Schneck
 
Testing - Selenium? Rich-Clients? Containers?
Testing - Selenium? Rich-Clients? Containers?Testing - Selenium? Rich-Clients? Containers?
Testing - Selenium? Rich-Clients? Containers?
Tobias Schneck
 
OOP2017: Containerized End-2-End Testing – automate it!
OOP2017: Containerized End-2-End Testing – automate it!OOP2017: Containerized End-2-End Testing – automate it!
OOP2017: Containerized End-2-End Testing – automate it!
Tobias Schneck
 

More from Tobias Schneck (18)

ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdfARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
 
Kubermatic How to Migrate 100 Clusters from On-Prem to Google Cloud Without D...
Kubermatic How to Migrate 100 Clusters from On-Prem to Google Cloud Without D...Kubermatic How to Migrate 100 Clusters from On-Prem to Google Cloud Without D...
Kubermatic How to Migrate 100 Clusters from On-Prem to Google Cloud Without D...
 
KubeCI - Cloud Native Continuous Delivery for Kubernetes
KubeCI - Cloud Native Continuous Delivery for KubernetesKubeCI - Cloud Native Continuous Delivery for Kubernetes
KubeCI - Cloud Native Continuous Delivery for Kubernetes
 
UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)
UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)
UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)
 
OpenShift Build Pipelines @ Lightweight Java User Group Meetup
OpenShift Build Pipelines @ Lightweight Java User Group MeetupOpenShift Build Pipelines @ Lightweight Java User Group Meetup
OpenShift Build Pipelines @ Lightweight Java User Group Meetup
 
OpenShift-Build-Pipelines: Build -> Test -> Run! @JavaForumStuttgart
OpenShift-Build-Pipelines: Build -> Test -> Run! @JavaForumStuttgartOpenShift-Build-Pipelines: Build -> Test -> Run! @JavaForumStuttgart
OpenShift-Build-Pipelines: Build -> Test -> Run! @JavaForumStuttgart
 
OpenShift-Build-Pipelines: Build ► Test ► Run!
OpenShift-Build-Pipelines: Build ► Test ► Run!OpenShift-Build-Pipelines: Build ► Test ► Run!
OpenShift-Build-Pipelines: Build ► Test ► Run!
 
Kotlin for backend development (Hackaburg 2018 Regensburg)
Kotlin for backend development (Hackaburg 2018 Regensburg)Kotlin for backend development (Hackaburg 2018 Regensburg)
Kotlin for backend development (Hackaburg 2018 Regensburg)
 
UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018
UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018
UI-Testing - Selenium? Rich-Clients? Containers? @APEX connect 2018
 
Continuous Testing: Integration- und UI-Testing mit OpenShift-Build-Pipelines
Continuous Testing: Integration- und UI-Testing mit OpenShift-Build-PipelinesContinuous Testing: Integration- und UI-Testing mit OpenShift-Build-Pipelines
Continuous Testing: Integration- und UI-Testing mit OpenShift-Build-Pipelines
 
Testing - Selenium? Rich-Clients? Containers?
Testing - Selenium? Rich-Clients? Containers?Testing - Selenium? Rich-Clients? Containers?
Testing - Selenium? Rich-Clients? Containers?
 
OOP2017: Containerized End-2-End Testing – automate it!
OOP2017: Containerized End-2-End Testing – automate it!OOP2017: Containerized End-2-End Testing – automate it!
OOP2017: Containerized End-2-End Testing – automate it!
 
Containerized End-2-End Testing - Agile Testing Meetup at Süddeutsche Zeitung...
Containerized End-2-End Testing - Agile Testing Meetup at Süddeutsche Zeitung...Containerized End-2-End Testing - Agile Testing Meetup at Süddeutsche Zeitung...
Containerized End-2-End Testing - Agile Testing Meetup at Süddeutsche Zeitung...
 
Containerized End-2-End-Testing - ContainerConf Mannheim
Containerized End-2-End-Testing - ContainerConf MannheimContainerized End-2-End-Testing - ContainerConf Mannheim
Containerized End-2-End-Testing - ContainerConf Mannheim
 
Containerized End-2-End-Testing - Software-QS-Tag (deutsch)
Containerized End-2-End-Testing - Software-QS-Tag (deutsch)Containerized End-2-End-Testing - Software-QS-Tag (deutsch)
Containerized End-2-End-Testing - Software-QS-Tag (deutsch)
 
Containerized End-2-End Testing - JUG Saxony Day
Containerized End-2-End Testing - JUG Saxony DayContainerized End-2-End Testing - JUG Saxony Day
Containerized End-2-End Testing - JUG Saxony Day
 
Skale your test environment! Containerized End-2-End-Testing @Herbstcampus Nü...
Skale your test environment! Containerized End-2-End-Testing @Herbstcampus Nü...Skale your test environment! Containerized End-2-End-Testing @Herbstcampus Nü...
Skale your test environment! Containerized End-2-End-Testing @Herbstcampus Nü...
 
Containerized End-2-End-Testing - Tobias Schneck
Containerized End-2-End-Testing - Tobias SchneckContainerized End-2-End-Testing - Tobias Schneck
Containerized End-2-End-Testing - Tobias Schneck
 

Recently uploaded

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 

Recently uploaded (20)

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 

Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s meetup@heidelberg)

  • 1. K8s ClusterAPIManaging the infrastructure of Kubernetes Cluster Rhein-Neckar
  • 2. K8s Cluster API Folie 2 Who I am? Tobi Who are we working for? Loodse GmbH Kubernetes?! Short recap Kubermatic?! What’s that? Node Deployment Solutions The old way Cluster API! Make K8s even greater Hetzner Machine! Implementation of Machine Provider Demo time! Praise the demo gods! Review! State, Pro and Cons Agenda
  • 4. Sebastian Scheele Headquarter in in Hamburg, Germany Founders Awarded by > 25 employees world wide Founded in 2016 Julian Hansert Cloud native and container technologies Software development K8s certified Multi & Hybrid Cloud Container Engine Partners Silver Member & Training Partner GCP & Training Partner
  • 5. K8s Cluster API Folie 5 Kubernetes
  • 6. K8s Cluster API Folie 6 Kubernetes - a short recap
  • 7. K8s Cluster API Folie 7 Kubernetes SIG - Cluster API ● Subproject of sig-cluster-lifecycle ○ Focus cluster deployment and upgrades ○ Other Projects: kops, kubeadm, minikube ● Repos ○ (old, in migration) https://github.com/kubernetes/kube-deploy ○ (new) https://github.com/kubernetes-sigs/cluster-api ● Main participants: ○ Google, Redhat, Heptio, VMware, Loodse … ● Open Development: Get involved!
  • 8. K8s Cluster API Folie 8
  • 9. K8s Cluster API Folie 9 Currently Supported Providers Bare Metal
  • 12. K8s Cluster API Folie 12 • Need Ops to scale the cluster • No generic approach • Each implementation needs specific knowledge • Scaling of new nodes requires external dependencies • No generic node auto scaling • Huge effort to deploy k8s on a different platform Node Node Node Master Node Current Approach
  • 13. K8s Cluster API Folie 13 Kubernetes Cluster BKubernetes Cluster B Kubernetes Cluster A Cluster API Infrastructure Providers Cloud, On-Prem, Bare Metal Potential Providers => bootstraping CLI upgrade trigger Provider Specifc Config autoscaling Bootstrapping Machine/Cluster etcd Cluster Machine MachineSet Cluster API Server (ext-apiserver) group: cluster.,k8s.io Controller Manager Machine Controler Prov. Config Provider Machine Actuator Master Machine(s) NodeMachine(s) kubeadm kubeadm API Server etcd Kubernetes Cluster B Master Machine(s) NodeMachine(s) Provisions Manage Cluster and Machines - Creates Machines - Bootstraps Cluster - Upgrades Cluster API Server + Controllers can be provided after bootstrapping Kubermatic Machine Controller
  • 14. K8s Cluster API Folie 14 kubectl create machines • Generic cluster scaling • Pets vs cattle for nodes • Implementation of generic auto scaling possible • Very similar setup for different provider Node Node Node Master Node Kubernetes Native Integration Cluster API
  • 15. K8s Cluster API Folie 15 • A "Machine" is the declarative spec for a Node, as represented in Kubernetes core. • After provisioning a new Node matching the Machine spec is registered. Machines/Nodes
  • 16. Let’s take a look at the Code!
  • 17. K8s Cluster API Folie 17 How does a machine look like? apiVersion: "machine.k8s.io/v1alpha1" kind: Machine metadata: name: machine1 spec: metadata: name: node1 providerConfig: sshPublicKeys: [] cloudProvider: "hetzner" cloudProviderSpec: token: MY-HZ-TOKEN serverType: "cx11" datacenter: "" location: "fsn1" operatingSystem: "ubuntu"
  • 18. K8s Cluster API Folie 18 MachineController Watches for new Machine resources Provision the machine using provider-specific drivers • Machine joins the cluster • Kubelet creates the Node resource Machine Resources
  • 19. K8s Cluster API Folie 19 How does it work?
  • 20. K8s Cluster API Folie 20 How does it work? ● Render Userdata ○ CoreOS, Ubuntu & CentOS ● Create instance at Cloudprovider ○ Install Container Runtime, Kubelet, Kubeadm ○ Use Kubeadm + Token to join node ● Match Node to Machine, set ownerRef
  • 21. K8s Cluster API Folie 21 How to implement a new provider? // Provider exposed all required functions to interact with a cloud provider type Provider interface { AddDefaults(spec v1alpha1.MachineSpec) (v1alpha1.MachineSpec, bool, error) // Validate validates the given machine's specification. // // In case of any error a "terminal" error should be set, // See v1alpha1.MachineStatus for more info Validate(machinespec v1alpha1.MachineSpec) error // Get gets a node that is associated with the given machine. // // Note that this method can return what we call a "terminal" error, // which indicates that a manual interaction is required to recover from this state. // See v1alpha1.MachineStatus for more info and TerminalError type Get(machine *v1alpha1.Machine) (instance.Instance, error) GetCloudConfig(spec v1alpha1.MachineSpec) (config string, name string, err error) // Create creates a cloud instance according to the given machine Create(machine *v1alpha1.Machine, update MachineUpdater, userdata string) (instance.Instance, error) Delete(machine *v1alpha1.Machine, update MachineUpdater, instance instance.Instance) error }
  • 22. K8s Cluster API Folie 22 How to implement a new provider? // Provider exposed all required functions to interact with a cloud provider type Provider interface { AddDefaults(spec v1alpha1.MachineSpec) (v1alpha1.MachineSpec, bool, error) // Validate validates the given machine's specification. // // In case of any error a "terminal" error should be set, // See v1alpha1.MachineStatus for more info Validate(machinespec v1alpha1.MachineSpec) error // Get gets a node that is associated with the given machine. // // Note that this method can return what we call a "terminal" error, // which indicates that a manual interaction is required to recover from this state. // See v1alpha1.MachineStatus for more info and TerminalError type Get(machine *v1alpha1.Machine) (instance.Instance, error) GetCloudConfig(spec v1alpha1.MachineSpec) (config string, name string, err error) // Create creates a cloud instance according to the given machine Create(machine *v1alpha1.Machine, update MachineUpdater, userdata string) (instance.Instance, error) Delete(machine *v1alpha1.Machine, update MachineUpdater, instance instance.Instance) error } github.com/kubermatic/machine-controller/../hetzner/provider.go
  • 23. K8s Cluster API Folie 23 Where to get it and how to use it? github.com/kubermatic/machine-controller ● Apache2 license ● Contains Machine Controllers for: AWS, Azure, DigitalOcean, Hetzner, OpenStack, vSphere kubectl apply -f examples/machine-controller.yaml kubectl apply -f examples/machine-${my_provider}.yaml
  • 24. K8s Cluster API Folie 24 New -> MachineSet Set definitions for Machines apiVersion: "cluster.k8s.io/v1alpha1" kind: MachineSet metadata: name: << MACHINE_NAME >> namespace: kube-system spec: replicas: 1 selector: matchLabels: name: << MACHINE_NAME >> template: metadata: labels: name: << MACHINE_NAME >> spec: providerConfig: value: sshPublicKeys: - "<< YOUR_PUBLIC_KEY >>" cloudProvider: "vsphere" cloudProviderSpec: templateVMName: '<< OS_NAME >>-template' username: '<< VSPHERE_USERNAME >>' vsphereURL: '<< VSPHERE_ADDRESS >>' datacenter: 'Datacenter' folder: '/Datacenter/vm/e2e-tests' password: << VSPHERE_PASSWORD >> cluster: '<< VSPHERE_CLUSTER >>' datastore: datastore1 allowInsecure: true cpus: 2 MemoryMB: 2048 operatingSystem: "<< OS_NAME >>" operatingSystemSpec: distUpgradeOnBoot: false containerRuntimeInfo: name: "<< CONTAINER_RUNTIME >>" versions: kubelet: "<< KUBERNETES_VERSION >>"
  • 25. “Praise the demo gods” - Kelsey Hightower DEMO TIME
  • 26. K8s Cluster API Folie 26 ClusterAPI - Quo Vadis? ● Currently in Alpha ● Types do change in a backwards-incompatible way ● Some questions do not have a final answer yet ● Does not solve all problems, e.G. Backup & Restore ● Already allows easy decoupling of general applicable from provider-specific code ● Generic cluster-autoscaler possible ● Participation from Google & RedHat
  • 27. K8s Cluster API Folie 27 Cluster API <> Kubermatic Kubermatic is based on Cluster API and Machine Controllers and adds: ● Kubermatic Dashboard ● Backup & Restore Concept ● Cluster Upgrade Mechanism ● Secure Communication between Bootstrapping Cluster and User Cluster ● Control of different on-prem/public Cloud Provider over one Master Plane ● Prometheus Meta Monitoring and Alerting ● ELK Stack for Infrastructure ● User Management (v2.8) Try it yourself! (Only AWS, Digital Ocean enabled) https://cloud.kubermatic.io
  • 29.
  • 30. We are hiring! Hamburg, Berlin, Munich, San Francisco, Gdańsk, … www.loodse.com @Loodse