SlideShare a Scribd company logo
1 of 32
Download to read offline
Creating a custom
Cluster API Provider
Himani Agrawal
@himani_93
Giri Kuncoro
@girikuncoro
History
70+ ways to deploy
Kubernetes
What is missing?
➔ Declarative, Kubernetes-style API
➔ Compatibility with tooling
➔ Cloud agnostic
➔ Single interface for infra/cluster
Cluster API
Kubernetes
Cluster
Cluster API
Reference: Deep Dive: Cluster API KubeCon EU 2019
Declarative
Config
Kubernetes
Cluster
Cluster API
Reference: Deep Dive: Cluster API KubeCon EU 2019
Kubernetes
Cluster
Cluster API
Declarative
Config
Reference: Deep Dive: Cluster API KubeCon EU 2019
Cluster API CRDs
Cluster
Cluster
apiVersion: "cluster-api.k8s.io/v1alpha1"
kind: Cluster
metadata:
name: fujisan
spec:
providerSpec:
...
clusterNetwork:
services:
cidrBlocks: ["10.96.0.0/12"]
pods:
cidrBlocks: ["192.168.0.0/16"]
serviceDomain: "cluster.local"
Cluster API CRDs
Cluster Machine
Machine
apiVersion: "cluster-api.k8s.io/v1alpha1"
kind: Machine
metadata:
name: kube-cp
spec:
providerSpec:
vcpu: 2
...
versions:
kubelet: 1.15.0
Cluster API CRDs
Cluster Machine Machine Set
Cluster API CRDs
Cluster Machine Machine Set
Machine
Deployment
Cluster API CRDs
Cluster Machine Machine Set
Machine
Deployment
Machine
Class
Cluster API CRDs
Cluster Machine Machine Set
Machine
Deployment
Machine
Class
Pod Replica Set Deployment
Storage
Class
How Cluster API works?
Controller Actuator KVM Baremetal
apiVersion:
"cluster-api.k8s.io/v1alpha1"
kind: Machine
metadata:
name: kube-cp
spec:
providerSpec:
vcpu: 2
versions:
kubelet: 1.15.0
Machine CRD
Machine
Provider Controller Manager
Cluster Controller Machine Controller
Demo
Picture Credits: Ashley McNamara
Code
func main() {
mgr, _ := manager.New(cfg, opts)
machineActuator, _ := machine.NewActuator(machine.ActuatorParams{
Client: mgr.GetClient(),
})
apis.AddToScheme(mgr.GetScheme())
clusterapis.AddToScheme(mgr.GetScheme())
capimachine.AddWithActuator(mgr, machineActuator)
mgr.Start(signals.SetupSignalHandler())
}
cmd/manager/main.go
Code
func init() {
// AddToManagerFuncs is a list of functions to create controllers
// and add them to a manager.
AddToManagerFuncs = append(AddToManagerFuncs, func(m manager.Manager) error {
return capimachine.AddWithActuator(m, &machine.Actuator{})
})
}
pkg/controller/add_machine_controller.go
Code
type LibvirtMachineProviderSpecSpec struct {
// Number of virtual CPU
VCPU int `json:"vcpu"`
// Amount of RAM in GBs
MemoryInGB int `json:"memoryInGB"`
// Image URL to be provisioned
ImageURI string `json:"imageURI"`
// UserData URI of cloud-init image
UserDataURI string `json:"userDataURI"`
}
pkg/apis/libvirt/v1alpha1/libvirtmachineproviderspec_types.go
Code
// CreateDomain connects to libvirt daemon and creates a new domain
// as per domainXML.
func CreateDomain(domainXML string) error {
...
}
// DomainExists checks if the domain with the given name exists.
func DomainExists(domainName string) bool {
...
}
// defineDomain returns the XML representation of the domain to be created.
// Output of this func is passed into CreateDomain() to create a new domain.
func defineDomain() string {
...
}
pkg/cloud/libvirt/domain.go
func (a *Actuator) Create() error {
return libvirt.CreateDomain()
}
func (a *Actuator) Exists() (bool, error) {
return libvirt.DomainExists()
}
func (a *Actuator) Delete() { ... }
func (a *Actuator) Update() { ... }
Code
pkg/cloud/libvirt/actuators/machine/actuator.go
/himani93/cluster-api-provider-libvirt
● Cluster API v0.1.0
● Kubebuilder v1.0.8
● Kustomize v1.0.11
● Kubectl v1.13
● Minikube v1.2.0
Dependency Versions
Discussion
● Cluster API is super cool!
● Early work for production version
Getting Involved
➔ Github Repo
github.com/kubernetes-sigs/cluster-api
➔ Mailing List: kubernetes-sig-cluster-lifecycle
https://groups.google.com/forum/#!forum/kubernetes-sig-clus
ter-lifecycle
➔ Slack: #cluster-api
https://kubernetes.slack.com/messages/C8TSNPY4T
Provider Implementations
● AWS, https://github.com/kubernetes-sigs/cluster-api-provider-aws
● Azure, https://github.com/kubernetes-sigs/cluster-api-provider-azure
● Baidu Cloud, https://github.com/baidu/cluster-api-provider-baiducloud
● Bare Metal, https://github.com/metal3-io/cluster-api-provider-baremetal
● DigitalOcean, https://github.com/kubernetes-sigs/cluster-api-provider-digitalocean
● Exoscale, https://github.com/exoscale/cluster-api-provider-exoscale
● GCP, https://github.com/kubernetes-sigs/cluster-api-provider-gcp
● IBM Cloud, https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud
● OpenStack, https://github.com/kubernetes-sigs/cluster-api-provider-openstack
● Talos, https://github.com/talos-systems/cluster-api-provider-talos
● Tencent Cloud, https://github.com/TencentCloud/cluster-api-provider-tencent
● vSphere, https://github.com/kubernetes-sigs/cluster-api-provider-vsphere
API Adoption
Following are the implementations managed by third-parties adopting the standard cluster-api and/or
machine-api being developed here.
● Kubermatic machine-controller, https://github.com/kubermatic/machine-controller/tree/master
● Machine API Operator, https://github.com/openshift/machine-api-operator/tree/master
● Machine-controller-manager, https://github.com/gardener/machine-controller-manager/tree/cluster-api
References
● https://kccna18.sched.com/event/Greh
● https://kccnceu19.sched.com/event/MPkR
● https://blogs.vmware.com/cloudnative/2019/03/14/what-and-why-of-cluster-api/
● https://blog.heptio.com/the-kubernetes-cluster-api-de5a1ff870a5
● https://github.com/kubernetes-sigs/cluster-api
● https://cluster-api.sigs.k8s.io/
ありがとうございます。

More Related Content

What's hot

Kubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive OverviewKubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive OverviewBob Killen
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Ryan Jarvinen
 
(Draft) Kubernetes - A Comprehensive Overview
(Draft) Kubernetes - A Comprehensive Overview(Draft) Kubernetes - A Comprehensive Overview
(Draft) Kubernetes - A Comprehensive OverviewBob Killen
 
Api gateway in microservices
Api gateway in microservicesApi gateway in microservices
Api gateway in microservicesKunal Hire
 
Secure your app with keycloak
Secure your app with keycloakSecure your app with keycloak
Secure your app with keycloakGuy Marom
 
The Future of Service Mesh
The Future of Service MeshThe Future of Service Mesh
The Future of Service MeshAll Things Open
 
How to Lock Down Apache Kafka and Keep Your Streams Safe
How to Lock Down Apache Kafka and Keep Your Streams SafeHow to Lock Down Apache Kafka and Keep Your Streams Safe
How to Lock Down Apache Kafka and Keep Your Streams Safeconfluent
 
Building secure applications with keycloak
Building secure applications with keycloak Building secure applications with keycloak
Building secure applications with keycloak Abhishek Koserwal
 
Draft: building secure applications with keycloak (oidc/jwt)
Draft: building secure applications with keycloak (oidc/jwt)Draft: building secure applications with keycloak (oidc/jwt)
Draft: building secure applications with keycloak (oidc/jwt)Abhishek Koserwal
 
Kubernetes Architecture
 Kubernetes Architecture Kubernetes Architecture
Kubernetes ArchitectureKnoldus Inc.
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetesRishabh Indoria
 
An introduction to Microservices
An introduction to MicroservicesAn introduction to Microservices
An introduction to MicroservicesCisco DevNet
 
gRPC and Microservices
gRPC and MicroservicesgRPC and Microservices
gRPC and MicroservicesJonathan Gomez
 
Microservices & API Gateways
Microservices & API Gateways Microservices & API Gateways
Microservices & API Gateways Kong Inc.
 
Free GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOpsFree GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOpsWeaveworks
 
“How to Secure Your Applications With a Keycloak?
“How to Secure Your Applications With a Keycloak?“How to Secure Your Applications With a Keycloak?
“How to Secure Your Applications With a Keycloak?GlobalLogic Ukraine
 

What's hot (20)

Kubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive OverviewKubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive Overview
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
 
Gitlab, GitOps & ArgoCD
Gitlab, GitOps & ArgoCDGitlab, GitOps & ArgoCD
Gitlab, GitOps & ArgoCD
 
(Draft) Kubernetes - A Comprehensive Overview
(Draft) Kubernetes - A Comprehensive Overview(Draft) Kubernetes - A Comprehensive Overview
(Draft) Kubernetes - A Comprehensive Overview
 
Api gateway in microservices
Api gateway in microservicesApi gateway in microservices
Api gateway in microservices
 
Secure your app with keycloak
Secure your app with keycloakSecure your app with keycloak
Secure your app with keycloak
 
GitLab.pptx
GitLab.pptxGitLab.pptx
GitLab.pptx
 
The Future of Service Mesh
The Future of Service MeshThe Future of Service Mesh
The Future of Service Mesh
 
How to Lock Down Apache Kafka and Keep Your Streams Safe
How to Lock Down Apache Kafka and Keep Your Streams SafeHow to Lock Down Apache Kafka and Keep Your Streams Safe
How to Lock Down Apache Kafka and Keep Your Streams Safe
 
Building secure applications with keycloak
Building secure applications with keycloak Building secure applications with keycloak
Building secure applications with keycloak
 
Draft: building secure applications with keycloak (oidc/jwt)
Draft: building secure applications with keycloak (oidc/jwt)Draft: building secure applications with keycloak (oidc/jwt)
Draft: building secure applications with keycloak (oidc/jwt)
 
Kubernetes Architecture
 Kubernetes Architecture Kubernetes Architecture
Kubernetes Architecture
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
An introduction to Microservices
An introduction to MicroservicesAn introduction to Microservices
An introduction to Microservices
 
Kubernetes networking & Security
Kubernetes networking & SecurityKubernetes networking & Security
Kubernetes networking & Security
 
gRPC and Microservices
gRPC and MicroservicesgRPC and Microservices
gRPC and Microservices
 
Microservices & API Gateways
Microservices & API Gateways Microservices & API Gateways
Microservices & API Gateways
 
DevOps with Kubernetes
DevOps with KubernetesDevOps with Kubernetes
DevOps with Kubernetes
 
Free GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOpsFree GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOps
 
“How to Secure Your Applications With a Keycloak?
“How to Secure Your Applications With a Keycloak?“How to Secure Your Applications With a Keycloak?
“How to Secure Your Applications With a Keycloak?
 

Similar to Using Libvirt with Cluster API to manage baremetal Kubernetes

Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s ...
Kubernetes Cluster API - managing the infrastructure of  multi clusters (k8s ...Kubernetes Cluster API - managing the infrastructure of  multi clusters (k8s ...
Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s ...Tobias Schneck
 
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 MeetupTobias 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
 
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 CloudTobias Schneck
 
SDPHP Lightning Talk - Let's Talk Laravel
SDPHP Lightning Talk - Let's Talk LaravelSDPHP Lightning Talk - Let's Talk Laravel
SDPHP Lightning Talk - Let's Talk Laravelmarcusamoore
 
Scaling docker with kubernetes
Scaling docker with kubernetesScaling docker with kubernetes
Scaling docker with kubernetesLiran Cohen
 
DevOpSec_KubernetesOperatorUsingJava.pdf
DevOpSec_KubernetesOperatorUsingJava.pdfDevOpSec_KubernetesOperatorUsingJava.pdf
DevOpSec_KubernetesOperatorUsingJava.pdfkanedafromparis
 
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexusMicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexusEmily Jiang
 
Serverless with Knative - Mete Atamel (Google)
Serverless with Knative - Mete Atamel (Google)Serverless with Knative - Mete Atamel (Google)
Serverless with Knative - Mete Atamel (Google)Shift Conference
 
Operator SDK for K8s using Go
Operator SDK for K8s using GoOperator SDK for K8s using Go
Operator SDK for K8s using GoCloudOps2005
 
Open Service Broker APIとKubernetes Service Catalog #k8sjp
Open Service Broker APIとKubernetes Service Catalog #k8sjpOpen Service Broker APIとKubernetes Service Catalog #k8sjp
Open Service Broker APIとKubernetes Service Catalog #k8sjpToshiaki Maki
 
Kubernetes and docker
Kubernetes and dockerKubernetes and docker
Kubernetes and dockerSmartLogic
 
OpenShift Meetup - Tokyo - Service Mesh and Serverless Overview
OpenShift Meetup - Tokyo - Service Mesh and Serverless OverviewOpenShift Meetup - Tokyo - Service Mesh and Serverless Overview
OpenShift Meetup - Tokyo - Service Mesh and Serverless OverviewMaría Angélica Bracho
 
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 2Alfonso Martino
 
DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your TeamGR8Conf
 
Deep Dive into SpaceONE
Deep Dive into SpaceONEDeep Dive into SpaceONE
Deep Dive into SpaceONEChoonho Son
 
Red Hat and kubernetes: awesome stuff coming your way
Red Hat and kubernetes:  awesome stuff coming your wayRed Hat and kubernetes:  awesome stuff coming your way
Red Hat and kubernetes: awesome stuff coming your wayJohannes Brännström
 
Kubernetes - Starting with 1.2
Kubernetes  - Starting with 1.2Kubernetes  - Starting with 1.2
Kubernetes - Starting with 1.2William Stewart
 
Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibilityDocker, Inc.
 
Creating a modern web application using Symfony API Platform, ReactJS and Red...
Creating a modern web application using Symfony API Platform, ReactJS and Red...Creating a modern web application using Symfony API Platform, ReactJS and Red...
Creating a modern web application using Symfony API Platform, ReactJS and Red...Jesus Manuel Olivas
 

Similar to Using Libvirt with Cluster API to manage baremetal Kubernetes (20)

Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s ...
Kubernetes Cluster API - managing the infrastructure of  multi clusters (k8s ...Kubernetes Cluster API - managing the infrastructure of  multi clusters (k8s ...
Kubernetes Cluster API - managing the infrastructure of multi clusters (k8s ...
 
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
 
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...
 
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
 
SDPHP Lightning Talk - Let's Talk Laravel
SDPHP Lightning Talk - Let's Talk LaravelSDPHP Lightning Talk - Let's Talk Laravel
SDPHP Lightning Talk - Let's Talk Laravel
 
Scaling docker with kubernetes
Scaling docker with kubernetesScaling docker with kubernetes
Scaling docker with kubernetes
 
DevOpSec_KubernetesOperatorUsingJava.pdf
DevOpSec_KubernetesOperatorUsingJava.pdfDevOpSec_KubernetesOperatorUsingJava.pdf
DevOpSec_KubernetesOperatorUsingJava.pdf
 
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexusMicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
MicroProfile, Docker, Kubernetes, Istio and Open Shift lab @dev nexus
 
Serverless with Knative - Mete Atamel (Google)
Serverless with Knative - Mete Atamel (Google)Serverless with Knative - Mete Atamel (Google)
Serverless with Knative - Mete Atamel (Google)
 
Operator SDK for K8s using Go
Operator SDK for K8s using GoOperator SDK for K8s using Go
Operator SDK for K8s using Go
 
Open Service Broker APIとKubernetes Service Catalog #k8sjp
Open Service Broker APIとKubernetes Service Catalog #k8sjpOpen Service Broker APIとKubernetes Service Catalog #k8sjp
Open Service Broker APIとKubernetes Service Catalog #k8sjp
 
Kubernetes and docker
Kubernetes and dockerKubernetes and docker
Kubernetes and docker
 
OpenShift Meetup - Tokyo - Service Mesh and Serverless Overview
OpenShift Meetup - Tokyo - Service Mesh and Serverless OverviewOpenShift Meetup - Tokyo - Service Mesh and Serverless Overview
OpenShift Meetup - Tokyo - Service Mesh and Serverless Overview
 
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
 
DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your Team
 
Deep Dive into SpaceONE
Deep Dive into SpaceONEDeep Dive into SpaceONE
Deep Dive into SpaceONE
 
Red Hat and kubernetes: awesome stuff coming your way
Red Hat and kubernetes:  awesome stuff coming your wayRed Hat and kubernetes:  awesome stuff coming your way
Red Hat and kubernetes: awesome stuff coming your way
 
Kubernetes - Starting with 1.2
Kubernetes  - Starting with 1.2Kubernetes  - Starting with 1.2
Kubernetes - Starting with 1.2
 
Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibility
 
Creating a modern web application using Symfony API Platform, ReactJS and Red...
Creating a modern web application using Symfony API Platform, ReactJS and Red...Creating a modern web application using Symfony API Platform, ReactJS and Red...
Creating a modern web application using Symfony API Platform, ReactJS and Red...
 

Recently uploaded

Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...Erbil Polytechnic University
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Sumanth A
 
BSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptxBSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptxNiranjanYadav41
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptNarmatha D
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONjhunlian
 
National Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfNational Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfRajuKanojiya4
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxVelmuruganTECE
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
Crystal Structure analysis and detailed information pptx
Crystal Structure analysis and detailed information pptxCrystal Structure analysis and detailed information pptx
Crystal Structure analysis and detailed information pptxachiever3003
 
Ch10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfCh10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfChristianCDAM
 
System Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingSystem Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingBootNeck1
 
home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadaditya806802
 
Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptxmohitesoham12
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
Cooling Tower SERD pH drop issue (11 April 2024) .pptx
Cooling Tower SERD pH drop issue (11 April 2024) .pptxCooling Tower SERD pH drop issue (11 April 2024) .pptx
Cooling Tower SERD pH drop issue (11 April 2024) .pptxmamansuratman0253
 
chpater16.pptxMMMMMMMMMMMMMMMMMMMMMMMMMMM
chpater16.pptxMMMMMMMMMMMMMMMMMMMMMMMMMMMchpater16.pptxMMMMMMMMMMMMMMMMMMMMMMMMMMM
chpater16.pptxMMMMMMMMMMMMMMMMMMMMMMMMMMMNanaAgyeman13
 
Crushers to screens in aggregate production
Crushers to screens in aggregate productionCrushers to screens in aggregate production
Crushers to screens in aggregate productionChinnuNinan
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgsaravananr517913
 

Recently uploaded (20)

Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
 
BSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptxBSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptx
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.ppt
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
 
National Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfNational Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdf
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptx
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
Crystal Structure analysis and detailed information pptx
Crystal Structure analysis and detailed information pptxCrystal Structure analysis and detailed information pptx
Crystal Structure analysis and detailed information pptx
 
Ch10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfCh10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdf
 
System Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingSystem Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event Scheduling
 
home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasad
 
Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptx
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
Cooling Tower SERD pH drop issue (11 April 2024) .pptx
Cooling Tower SERD pH drop issue (11 April 2024) .pptxCooling Tower SERD pH drop issue (11 April 2024) .pptx
Cooling Tower SERD pH drop issue (11 April 2024) .pptx
 
chpater16.pptxMMMMMMMMMMMMMMMMMMMMMMMMMMM
chpater16.pptxMMMMMMMMMMMMMMMMMMMMMMMMMMMchpater16.pptxMMMMMMMMMMMMMMMMMMMMMMMMMMM
chpater16.pptxMMMMMMMMMMMMMMMMMMMMMMMMMMM
 
Crushers to screens in aggregate production
Crushers to screens in aggregate productionCrushers to screens in aggregate production
Crushers to screens in aggregate production
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
 

Using Libvirt with Cluster API to manage baremetal Kubernetes

  • 1. Creating a custom Cluster API Provider Himani Agrawal @himani_93 Giri Kuncoro @girikuncoro
  • 3. 70+ ways to deploy Kubernetes
  • 4. What is missing? ➔ Declarative, Kubernetes-style API ➔ Compatibility with tooling ➔ Cloud agnostic ➔ Single interface for infra/cluster
  • 6. Kubernetes Cluster Cluster API Reference: Deep Dive: Cluster API KubeCon EU 2019
  • 10. Cluster apiVersion: "cluster-api.k8s.io/v1alpha1" kind: Cluster metadata: name: fujisan spec: providerSpec: ... clusterNetwork: services: cidrBlocks: ["10.96.0.0/12"] pods: cidrBlocks: ["192.168.0.0/16"] serviceDomain: "cluster.local"
  • 12. Machine apiVersion: "cluster-api.k8s.io/v1alpha1" kind: Machine metadata: name: kube-cp spec: providerSpec: vcpu: 2 ... versions: kubelet: 1.15.0
  • 13. Cluster API CRDs Cluster Machine Machine Set
  • 14. Cluster API CRDs Cluster Machine Machine Set Machine Deployment
  • 15. Cluster API CRDs Cluster Machine Machine Set Machine Deployment Machine Class
  • 16. Cluster API CRDs Cluster Machine Machine Set Machine Deployment Machine Class Pod Replica Set Deployment Storage Class
  • 17. How Cluster API works? Controller Actuator KVM Baremetal apiVersion: "cluster-api.k8s.io/v1alpha1" kind: Machine metadata: name: kube-cp spec: providerSpec: vcpu: 2 versions: kubelet: 1.15.0 Machine CRD Machine
  • 18. Provider Controller Manager Cluster Controller Machine Controller
  • 20. Code func main() { mgr, _ := manager.New(cfg, opts) machineActuator, _ := machine.NewActuator(machine.ActuatorParams{ Client: mgr.GetClient(), }) apis.AddToScheme(mgr.GetScheme()) clusterapis.AddToScheme(mgr.GetScheme()) capimachine.AddWithActuator(mgr, machineActuator) mgr.Start(signals.SetupSignalHandler()) } cmd/manager/main.go
  • 21. Code func init() { // AddToManagerFuncs is a list of functions to create controllers // and add them to a manager. AddToManagerFuncs = append(AddToManagerFuncs, func(m manager.Manager) error { return capimachine.AddWithActuator(m, &machine.Actuator{}) }) } pkg/controller/add_machine_controller.go
  • 22. Code type LibvirtMachineProviderSpecSpec struct { // Number of virtual CPU VCPU int `json:"vcpu"` // Amount of RAM in GBs MemoryInGB int `json:"memoryInGB"` // Image URL to be provisioned ImageURI string `json:"imageURI"` // UserData URI of cloud-init image UserDataURI string `json:"userDataURI"` } pkg/apis/libvirt/v1alpha1/libvirtmachineproviderspec_types.go
  • 23. Code // CreateDomain connects to libvirt daemon and creates a new domain // as per domainXML. func CreateDomain(domainXML string) error { ... } // DomainExists checks if the domain with the given name exists. func DomainExists(domainName string) bool { ... } // defineDomain returns the XML representation of the domain to be created. // Output of this func is passed into CreateDomain() to create a new domain. func defineDomain() string { ... } pkg/cloud/libvirt/domain.go
  • 24. func (a *Actuator) Create() error { return libvirt.CreateDomain() } func (a *Actuator) Exists() (bool, error) { return libvirt.DomainExists() } func (a *Actuator) Delete() { ... } func (a *Actuator) Update() { ... } Code pkg/cloud/libvirt/actuators/machine/actuator.go
  • 26. ● Cluster API v0.1.0 ● Kubebuilder v1.0.8 ● Kustomize v1.0.11 ● Kubectl v1.13 ● Minikube v1.2.0 Dependency Versions
  • 27. Discussion ● Cluster API is super cool! ● Early work for production version
  • 28. Getting Involved ➔ Github Repo github.com/kubernetes-sigs/cluster-api ➔ Mailing List: kubernetes-sig-cluster-lifecycle https://groups.google.com/forum/#!forum/kubernetes-sig-clus ter-lifecycle ➔ Slack: #cluster-api https://kubernetes.slack.com/messages/C8TSNPY4T
  • 29. Provider Implementations ● AWS, https://github.com/kubernetes-sigs/cluster-api-provider-aws ● Azure, https://github.com/kubernetes-sigs/cluster-api-provider-azure ● Baidu Cloud, https://github.com/baidu/cluster-api-provider-baiducloud ● Bare Metal, https://github.com/metal3-io/cluster-api-provider-baremetal ● DigitalOcean, https://github.com/kubernetes-sigs/cluster-api-provider-digitalocean ● Exoscale, https://github.com/exoscale/cluster-api-provider-exoscale ● GCP, https://github.com/kubernetes-sigs/cluster-api-provider-gcp ● IBM Cloud, https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud ● OpenStack, https://github.com/kubernetes-sigs/cluster-api-provider-openstack ● Talos, https://github.com/talos-systems/cluster-api-provider-talos ● Tencent Cloud, https://github.com/TencentCloud/cluster-api-provider-tencent ● vSphere, https://github.com/kubernetes-sigs/cluster-api-provider-vsphere
  • 30. API Adoption Following are the implementations managed by third-parties adopting the standard cluster-api and/or machine-api being developed here. ● Kubermatic machine-controller, https://github.com/kubermatic/machine-controller/tree/master ● Machine API Operator, https://github.com/openshift/machine-api-operator/tree/master ● Machine-controller-manager, https://github.com/gardener/machine-controller-manager/tree/cluster-api
  • 31. References ● https://kccna18.sched.com/event/Greh ● https://kccnceu19.sched.com/event/MPkR ● https://blogs.vmware.com/cloudnative/2019/03/14/what-and-why-of-cluster-api/ ● https://blog.heptio.com/the-kubernetes-cluster-api-de5a1ff870a5 ● https://github.com/kubernetes-sigs/cluster-api ● https://cluster-api.sigs.k8s.io/