Platform Engineering: Manage your infrastructure using Kubernetes and Crossplane

Ahmed AbouZaid
Ahmed AbouZaidSRE | DevOps Facilitator | I build sustainable solutions!
Platform Engineering:
Manage your infrastructure
using Kubernetes and Crossplane
Ahmed AbouZaid
November 2023
About
Ahmed AbouZaid
With 10+ years of hands-on experience and an M.Sc. in Data Engineering, I’m
passionate about DevOps and Cloud-Native, specializing in Cloud and Kubernetes.
I’m also a Free/Open source geek and book author.
I enjoy facilitating the growth of both businesses and individuals.
My favorite topics are DevOps transformation, automation, data, and metrics.
Find me at:
DevOpsHive.net | Tech.aabouzaid.com | LinkedIn.com/in/aabouzaid
Overview
● Scenario
● What is Crossplane?
● How it look like?
● Crossplane Concepts
● How Crossplane Works
● Pros and Cons
● Conclusion
● Resources
● Questions
Let’s have a look at a real-world scenario where the
DevOps engineers decided to build an abstraction
layer to be used by all dev teams (aka Platform
Engineering), and they found the solution!
Crossplane, the open-source control plane!
Scenario
Scenario (Cont.)
03
The dev teams follow the
principle of "you build it, you
manage it", but just for the
application, not the
infrastructure, because they
are not experienced with
Terraform.
01
A mid-size company has 10
development teams. Its tech
stack is mainly Kubernetes
for the applications and
Terraform for the
infrastructure.
02
Each team has a 2-week
sprint; at the end of the
sprint, they need to spin a
fresh env for the final
acceptance tests. That env
should have the Kubernetes
deployment for the
application, Cloud Database,
and Cloud Cache.
Scenario (Cont.)
06
With more coming custom
changes, it was hard for the
DevOps engineers to handle
all those requests even with
automation. Here the time to
build an abstraction layer to
be used by all dev teams
(aka Platform Engineering).
04
Each time a team needs that
new env, they ask the DevOps
engineers to push the magic
button to spin those new
Cloud env.
05
The DevOps engineers
decided to automate that
process, however, they
needed to implement 2
different systems for that:
the infrastructure
automation for Terraform
and the application
automation for Kubernetes.
Platform Engineering: Manage your infrastructure using Kubernetes and Crossplane
What is Crossplane?
Crossplane is a Cloud Native Computing Foundation (CNCF) project
built on the foundation of Kubernetes to orchestrate anything.
At the core, it is an open-source Kubernetes add-on that extends
Kubernetes to enable the deployment and management of
infrastructure and services of various Cloud providers and
on-premises environments.
In other words, Crossplane is not just a tool but an extensible
Kubernetes operator and framework.
How it look like?
This is an example of Crossplane Claim, namely
PostgreSQLInstance from Google Cloud
Platform Configuration.
It’s same like any manifest of Kubernetes and
could be even be part of GitOps flow, Helm
chart, or Kustomize object.
You can also created your own composition
according to you needs.
apiVersion: gcp.platformref.upbound.io/v1alpha1
kind: PostgreSQLInstance
metadata:
name: super-app-db
namespace: super-app
spec:
parameters:
storageGB: 10
passwordSecretRef:
namespace: default
name: psql-secret
key: password
clusterRef:
id: platform-ref-gcp-cluster
writeConnectionSecretToRef:
name: platform-ref-gcp-db-con
How it look like? (Cont.)
Here is an example of a Crossplane claim based
on a Composition I’ve created that spins a new
GKE cluster. Full example at:
github.com/DevOpsHiveCloud/crossplane-composite
-resource-demo
apiVersion: cluster.devopshive.net/v1alpha1
kind: GKE
metadata:
name: ci
namespace: ci
spec:
name: ci-cluster
region: europe-west1
parameters:
cluster:
minVersion: 1.27.3-gke.100
nodes:
autoscaling:
minNodeCount: 0
maxNodeCount: 64
writeConnectionSecretToRef:
name: cluster-conn-ci-cluster
Crossplane Concepts
Component Abbr. Scope Functionality
Provider - Cluster
Creates new Kubernetes Custom Resource Definitions
for an external service.
Provider Config PC Cluster Applies settings for a Provider.
Managed Resource MR Cluster
A Provider resource created and managed by
Crossplane inside the Kubernetes cluster.
Composition - Cluster
A template for creating multiple managed resources
at once (think as a Terraform module).
Crossplane Concepts (Cont.)
Component Abbr. Scope Functionality
Composite
Resources
XR Cluster
Uses a Composition template to create multiple
managed resources as a single Kubernetes object
(think as a Terraform tfvars file).
CompositeResource
Definitions
XRD Cluster
Defines the API schema for Composite Resources
and Claims (think as Kubernetes Custom Resource
Definition).
Claims XC Namespace
Like a Composite Resource, but namespace scoped
(think as Kubernetes Custom Resource).
How Crossplane Works
Component Functionality
Crossplane Configuration Compose Custom API
Crossplane Providers Connect to Cloud API
Crossplane Runtime Manage External APIs (Create/Update/Delete)
Kubernetes Runtime
(API Machinery, Controller Runtime)
Events, Watch, Reconciliation, CRDs, OpenAPI,
Persistence (etcd), Run Workloads, Ingress, RBAC
Components of Crossplane powered Control plane
How Crossplane Works (Cont.)
Connect Compose Consume
Managed Resources
XRD
Composite Resource Definition
App
A Cloud API Composition Claim
Provider Configuration
Platform Team Platform Team Development Team
Claims are namespaced objects consumed by platform users (e.g., development teams)
Pros Cons
● Cloud Native, extensible, declarative,
API-driven using Kubernetes-style
● Could be used with the same Kubernetes
ecosystem tools (e.g. ArgoCD for GitOps)
● Stateless (unlike Terraform, no need to
manage the state)
● Already using Terraform providers and
support most of the Cloud services
● Bootstrap is challenging (it needs an
already running Kubernetes cluster)
● Relatively new compared to other solutions
(missing utils and helpers)
● Hard to debug and troubleshoot (you will
use “kubectl get events” a lot)
● It requires some time to get used to
Composition concepts (module-like config)
Pros and Cons
Crossplane is a great framework for managing infrastructure using the Kubernetes style
and benefits from the that ecosystem (ArgoCD, Helm, Kustomize, etc.).
There are many use cases where it can perfectly fit in already. And at the time of writing
these words (November 2023), the Marketplace has numerous enterprise and community
providers configurations. Also Composition Functions graduated to beta.
However, it’s a relatively new ecosystem and still evolving, so it might not be the optimal
solution for every workload. But it’s probably a matter of time to grow more. So, if it’s not
your fit now, consider revisiting in the future.
Conclusion
Resources
● docs.crossplane.io
● blog.crossplane.io/crossplane-vs-terraform
● blog.upbound.io/composing-a-platform-by-patching-crossplane-resources
● innoq.com/en/articles/2022/07/infrastructure-self-service-with-crossplane
● thenewstack.io/crossplane-what-most-people-get-wrong-and-how-to-get-it-right
● masterpoint.io/updates/passing-on-crossplane
For more resources:
github.com/DevOpsHiveCloud/awesome-crossplane
Thank You :-)
LinkedIn.com/in/aabouzaid
Tech.aabouzaid.com
Questions?
DevOpsHive.net
1 of 19

Recommended

KCD Italy 2022 - Application driven infrastructure with Crossplane by
KCD Italy 2022 - Application driven infrastructure with CrossplaneKCD Italy 2022 - Application driven infrastructure with Crossplane
KCD Italy 2022 - Application driven infrastructure with Crossplanesparkfabrik
83 views43 slides
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz) by
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)QAware GmbH
501 views121 slides
[Global logic] container runtimes and kubernetes by
[Global logic] container runtimes and kubernetes[Global logic] container runtimes and kubernetes
[Global logic] container runtimes and kubernetesGlobalLogic Ukraine
304 views57 slides
Architecting multi-cloud ready applications by
Architecting multi-cloud ready applicationsArchitecting multi-cloud ready applications
Architecting multi-cloud ready applicationsSwaminathan Vetri
52 views42 slides
Kubernetes: The Next Research Platform by
Kubernetes: The Next Research PlatformKubernetes: The Next Research Platform
Kubernetes: The Next Research PlatformBob Killen
1.9K views36 slides
The path to a serverless-native era with Kubernetes by
The path to a serverless-native era with KubernetesThe path to a serverless-native era with Kubernetes
The path to a serverless-native era with Kubernetessparkfabrik
944 views75 slides

More Related Content

Similar to Platform Engineering: Manage your infrastructure using Kubernetes and Crossplane

Webinar: Dealing with automation tool overload! by
Webinar: Dealing with automation tool overload!Webinar: Dealing with automation tool overload!
Webinar: Dealing with automation tool overload!Cloudify Community
369 views25 slides
Introduction to Kubernetes - Docker Global Mentor Week 2016 by
Introduction to Kubernetes - Docker Global Mentor Week 2016Introduction to Kubernetes - Docker Global Mentor Week 2016
Introduction to Kubernetes - Docker Global Mentor Week 2016Opsta
1.9K views19 slides
DevEx | there’s no place like k3s by
DevEx | there’s no place like k3sDevEx | there’s no place like k3s
DevEx | there’s no place like k3sHaggai Philip Zagury
236 views36 slides
DevOps for Databricks by
DevOps for DatabricksDevOps for Databricks
DevOps for DatabricksDatabricks
1.1K views39 slides
Gluecon Preso: Hybrid Container Infrastructure by
Gluecon Preso: Hybrid Container InfrastructureGluecon Preso: Hybrid Container Infrastructure
Gluecon Preso: Hybrid Container Infrastructurerhirschfeld
552 views20 slides
Cloud Deployment Toolkit by
Cloud Deployment ToolkitCloud Deployment Toolkit
Cloud Deployment ToolkitBret Piatt
1.1K views25 slides

Similar to Platform Engineering: Manage your infrastructure using Kubernetes and Crossplane(20)

Webinar: Dealing with automation tool overload! by Cloudify Community
Webinar: Dealing with automation tool overload!Webinar: Dealing with automation tool overload!
Webinar: Dealing with automation tool overload!
Cloudify Community369 views
Introduction to Kubernetes - Docker Global Mentor Week 2016 by Opsta
Introduction to Kubernetes - Docker Global Mentor Week 2016Introduction to Kubernetes - Docker Global Mentor Week 2016
Introduction to Kubernetes - Docker Global Mentor Week 2016
Opsta1.9K views
DevOps for Databricks by Databricks
DevOps for DatabricksDevOps for Databricks
DevOps for Databricks
Databricks1.1K views
Gluecon Preso: Hybrid Container Infrastructure by rhirschfeld
Gluecon Preso: Hybrid Container InfrastructureGluecon Preso: Hybrid Container Infrastructure
Gluecon Preso: Hybrid Container Infrastructure
rhirschfeld552 views
Cloud Deployment Toolkit by Bret Piatt
Cloud Deployment ToolkitCloud Deployment Toolkit
Cloud Deployment Toolkit
Bret Piatt1.1K views
KubeCon NA - 2021 Tools That I Wish Existed 3 Years Ago To Build a SaaS Offering by Mauricio (Salaboy) Salatino
KubeCon NA - 2021 Tools That I Wish Existed 3 Years Ago To Build a SaaS OfferingKubeCon NA - 2021 Tools That I Wish Existed 3 Years Ago To Build a SaaS Offering
KubeCon NA - 2021 Tools That I Wish Existed 3 Years Ago To Build a SaaS Offering
Kubernetes #1 intro by Terry Cho
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 intro
Terry Cho1.5K views
GCP Meetup #3 - Approaches to Cloud Native Architectures by nine
GCP Meetup #3 - Approaches to Cloud Native ArchitecturesGCP Meetup #3 - Approaches to Cloud Native Architectures
GCP Meetup #3 - Approaches to Cloud Native Architectures
nine879 views
Kubernetes or OpenShift - choosing your container platform for Dev and Ops by Tomasz Cholewa
Kubernetes or OpenShift - choosing your container platform for Dev and OpsKubernetes or OpenShift - choosing your container platform for Dev and Ops
Kubernetes or OpenShift - choosing your container platform for Dev and Ops
Tomasz Cholewa847 views
DevOps Spain 2019. David Cañadillas -Cloudbees by atSistemas
DevOps Spain 2019. David Cañadillas -CloudbeesDevOps Spain 2019. David Cañadillas -Cloudbees
DevOps Spain 2019. David Cañadillas -Cloudbees
atSistemas666 views
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot by VMware Tanzu
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootSpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
VMware Tanzu116 views
Kubernetes Architecture - beyond a black box - Part 1 by Hao H. Zhang
Kubernetes Architecture - beyond a black box - Part 1Kubernetes Architecture - beyond a black box - Part 1
Kubernetes Architecture - beyond a black box - Part 1
Hao H. Zhang7K views
Resilient Microservices with Spring Cloud by VMware Tanzu
Resilient Microservices with Spring CloudResilient Microservices with Spring Cloud
Resilient Microservices with Spring Cloud
VMware Tanzu1.6K views
Improve monitoring and observability for kubernetes with oss tools by Nilesh Gule
Improve monitoring and observability for kubernetes with oss toolsImprove monitoring and observability for kubernetes with oss tools
Improve monitoring and observability for kubernetes with oss tools
Nilesh Gule70 views
Cluster-as-code. The Many Ways towards Kubernetes by QAware GmbH
Cluster-as-code. The Many Ways towards KubernetesCluster-as-code. The Many Ways towards Kubernetes
Cluster-as-code. The Many Ways towards Kubernetes
QAware GmbH55 views
Pivotal Container Service (PKS) at SF Cloud Foundry Meetup by cornelia davis
Pivotal Container Service (PKS) at SF Cloud Foundry MeetupPivotal Container Service (PKS) at SF Cloud Foundry Meetup
Pivotal Container Service (PKS) at SF Cloud Foundry Meetup
cornelia davis2.6K views
KUBEBOOT - SPRING BOOT DEPLOYMENT ON KUBERNETES HAS NEVER BEEN SO EASY by Red Hat Developers
KUBEBOOT - SPRING BOOT DEPLOYMENT ON KUBERNETES HAS NEVER BEEN SO EASYKUBEBOOT - SPRING BOOT DEPLOYMENT ON KUBERNETES HAS NEVER BEEN SO EASY
KUBEBOOT - SPRING BOOT DEPLOYMENT ON KUBERNETES HAS NEVER BEEN SO EASY
Red Hat Developers6.1K views
Advanced Model Inferencing leveraging Kubeflow Serving, KNative and Istio by Animesh Singh
Advanced Model Inferencing leveraging Kubeflow Serving, KNative and IstioAdvanced Model Inferencing leveraging Kubeflow Serving, KNative and Istio
Advanced Model Inferencing leveraging Kubeflow Serving, KNative and Istio
Animesh Singh17.3K views
DevOps and BigData Analytics by sbbabu
DevOps and BigData Analytics DevOps and BigData Analytics
DevOps and BigData Analytics
sbbabu332 views

More from Ahmed AbouZaid

Kubernetes Security Best Practices - With tips for the CKS exam by
Kubernetes Security Best Practices - With tips for the CKS examKubernetes Security Best Practices - With tips for the CKS exam
Kubernetes Security Best Practices - With tips for the CKS examAhmed AbouZaid
764 views23 slides
Docker Best Practices Workshop by
Docker Best Practices WorkshopDocker Best Practices Workshop
Docker Best Practices WorkshopAhmed AbouZaid
1.3K views37 slides
Kubernetes Requests and Limits by
Kubernetes Requests and LimitsKubernetes Requests and Limits
Kubernetes Requests and LimitsAhmed AbouZaid
891 views25 slides
DevOps for Engineers by
DevOps for EngineersDevOps for Engineers
DevOps for EngineersAhmed AbouZaid
461 views10 slides
How contributing to Open-source made me a better DevOps by
How contributing to Open-source made me a better DevOpsHow contributing to Open-source made me a better DevOps
How contributing to Open-source made me a better DevOpsAhmed AbouZaid
535 views10 slides
Developing Ansible Dynamic Inventory Script - Nov 2017 by
Developing Ansible Dynamic Inventory Script - Nov 2017Developing Ansible Dynamic Inventory Script - Nov 2017
Developing Ansible Dynamic Inventory Script - Nov 2017Ahmed AbouZaid
938 views11 slides

More from Ahmed AbouZaid(9)

Kubernetes Security Best Practices - With tips for the CKS exam by Ahmed AbouZaid
Kubernetes Security Best Practices - With tips for the CKS examKubernetes Security Best Practices - With tips for the CKS exam
Kubernetes Security Best Practices - With tips for the CKS exam
Ahmed AbouZaid764 views
Docker Best Practices Workshop by Ahmed AbouZaid
Docker Best Practices WorkshopDocker Best Practices Workshop
Docker Best Practices Workshop
Ahmed AbouZaid1.3K views
Kubernetes Requests and Limits by Ahmed AbouZaid
Kubernetes Requests and LimitsKubernetes Requests and Limits
Kubernetes Requests and Limits
Ahmed AbouZaid891 views
How contributing to Open-source made me a better DevOps by Ahmed AbouZaid
How contributing to Open-source made me a better DevOpsHow contributing to Open-source made me a better DevOps
How contributing to Open-source made me a better DevOps
Ahmed AbouZaid535 views
Developing Ansible Dynamic Inventory Script - Nov 2017 by Ahmed AbouZaid
Developing Ansible Dynamic Inventory Script - Nov 2017Developing Ansible Dynamic Inventory Script - Nov 2017
Developing Ansible Dynamic Inventory Script - Nov 2017
Ahmed AbouZaid938 views
Introduction to InfluxDB and TICK Stack by Ahmed AbouZaid
Introduction to InfluxDB and TICK StackIntroduction to InfluxDB and TICK Stack
Introduction to InfluxDB and TICK Stack
Ahmed AbouZaid1.3K views
Getting Started with Ansible by Ahmed AbouZaid
Getting Started with AnsibleGetting Started with Ansible
Getting Started with Ansible
Ahmed AbouZaid646 views

Recently uploaded

"Ukrainian Mobile Banking Scaling in Practice. From 0 to 100 and beyond", Vad... by
"Ukrainian Mobile Banking Scaling in Practice. From 0 to 100 and beyond", Vad..."Ukrainian Mobile Banking Scaling in Practice. From 0 to 100 and beyond", Vad...
"Ukrainian Mobile Banking Scaling in Practice. From 0 to 100 and beyond", Vad...Fwdays
40 views30 slides
TE Connectivity: Card Edge Interconnects by
TE Connectivity: Card Edge InterconnectsTE Connectivity: Card Edge Interconnects
TE Connectivity: Card Edge InterconnectsCXL Forum
96 views12 slides
Empathic Computing: Delivering the Potential of the Metaverse by
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the MetaverseMark Billinghurst
449 views80 slides
Photowave Presentation Slides - 11.8.23.pptx by
Photowave Presentation Slides - 11.8.23.pptxPhotowave Presentation Slides - 11.8.23.pptx
Photowave Presentation Slides - 11.8.23.pptxCXL Forum
126 views16 slides
ChatGPT and AI for Web Developers by
ChatGPT and AI for Web DevelopersChatGPT and AI for Web Developers
ChatGPT and AI for Web DevelopersMaximiliano Firtman
174 views82 slides
"Role of a CTO in software outsourcing company", Yuriy Nakonechnyy by
"Role of a CTO in software outsourcing company", Yuriy Nakonechnyy"Role of a CTO in software outsourcing company", Yuriy Nakonechnyy
"Role of a CTO in software outsourcing company", Yuriy NakonechnyyFwdays
40 views21 slides

Recently uploaded(20)

"Ukrainian Mobile Banking Scaling in Practice. From 0 to 100 and beyond", Vad... by Fwdays
"Ukrainian Mobile Banking Scaling in Practice. From 0 to 100 and beyond", Vad..."Ukrainian Mobile Banking Scaling in Practice. From 0 to 100 and beyond", Vad...
"Ukrainian Mobile Banking Scaling in Practice. From 0 to 100 and beyond", Vad...
Fwdays40 views
TE Connectivity: Card Edge Interconnects by CXL Forum
TE Connectivity: Card Edge InterconnectsTE Connectivity: Card Edge Interconnects
TE Connectivity: Card Edge Interconnects
CXL Forum96 views
Empathic Computing: Delivering the Potential of the Metaverse by Mark Billinghurst
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the Metaverse
Mark Billinghurst449 views
Photowave Presentation Slides - 11.8.23.pptx by CXL Forum
Photowave Presentation Slides - 11.8.23.pptxPhotowave Presentation Slides - 11.8.23.pptx
Photowave Presentation Slides - 11.8.23.pptx
CXL Forum126 views
"Role of a CTO in software outsourcing company", Yuriy Nakonechnyy by Fwdays
"Role of a CTO in software outsourcing company", Yuriy Nakonechnyy"Role of a CTO in software outsourcing company", Yuriy Nakonechnyy
"Role of a CTO in software outsourcing company", Yuriy Nakonechnyy
Fwdays40 views
Spesifikasi Lengkap ASUS Vivobook Go 14 by Dot Semarang
Spesifikasi Lengkap ASUS Vivobook Go 14Spesifikasi Lengkap ASUS Vivobook Go 14
Spesifikasi Lengkap ASUS Vivobook Go 14
Dot Semarang35 views
"Fast Start to Building on AWS", Igor Ivaniuk by Fwdays
"Fast Start to Building on AWS", Igor Ivaniuk"Fast Start to Building on AWS", Igor Ivaniuk
"Fast Start to Building on AWS", Igor Ivaniuk
Fwdays36 views
Micron CXL product and architecture update by CXL Forum
Micron CXL product and architecture updateMicron CXL product and architecture update
Micron CXL product and architecture update
CXL Forum27 views
Webinar : Competing for tomorrow’s leaders – How MENA insurers can win the wa... by The Digital Insurer
Webinar : Competing for tomorrow’s leaders – How MENA insurers can win the wa...Webinar : Competing for tomorrow’s leaders – How MENA insurers can win the wa...
Webinar : Competing for tomorrow’s leaders – How MENA insurers can win the wa...
JCon Live 2023 - Lice coding some integration problems by Bernd Ruecker
JCon Live 2023 - Lice coding some integration problemsJCon Live 2023 - Lice coding some integration problems
JCon Live 2023 - Lice coding some integration problems
Bernd Ruecker67 views
Liqid: Composable CXL Preview by CXL Forum
Liqid: Composable CXL PreviewLiqid: Composable CXL Preview
Liqid: Composable CXL Preview
CXL Forum121 views
"Quality Assurance: Achieving Excellence in startup without a Dedicated QA", ... by Fwdays
"Quality Assurance: Achieving Excellence in startup without a Dedicated QA", ..."Quality Assurance: Achieving Excellence in startup without a Dedicated QA", ...
"Quality Assurance: Achieving Excellence in startup without a Dedicated QA", ...
Fwdays33 views
MemVerge: Gismo (Global IO-free Shared Memory Objects) by CXL Forum
MemVerge: Gismo (Global IO-free Shared Memory Objects)MemVerge: Gismo (Global IO-free Shared Memory Objects)
MemVerge: Gismo (Global IO-free Shared Memory Objects)
CXL Forum112 views
Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu... by NUS-ISS
Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu...Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu...
Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu...
NUS-ISS32 views
AMD: 4th Generation EPYC CXL Demo by CXL Forum
AMD: 4th Generation EPYC CXL DemoAMD: 4th Generation EPYC CXL Demo
AMD: 4th Generation EPYC CXL Demo
CXL Forum126 views
Astera Labs: Intelligent Connectivity for Cloud and AI Infrastructure by CXL Forum
Astera Labs:  Intelligent Connectivity for Cloud and AI InfrastructureAstera Labs:  Intelligent Connectivity for Cloud and AI Infrastructure
Astera Labs: Intelligent Connectivity for Cloud and AI Infrastructure
CXL Forum125 views
Future of Learning - Khoong Chan Meng by NUS-ISS
Future of Learning - Khoong Chan MengFuture of Learning - Khoong Chan Meng
Future of Learning - Khoong Chan Meng
NUS-ISS31 views

Platform Engineering: Manage your infrastructure using Kubernetes and Crossplane

  • 1. Platform Engineering: Manage your infrastructure using Kubernetes and Crossplane Ahmed AbouZaid November 2023
  • 2. About Ahmed AbouZaid With 10+ years of hands-on experience and an M.Sc. in Data Engineering, I’m passionate about DevOps and Cloud-Native, specializing in Cloud and Kubernetes. I’m also a Free/Open source geek and book author. I enjoy facilitating the growth of both businesses and individuals. My favorite topics are DevOps transformation, automation, data, and metrics. Find me at: DevOpsHive.net | Tech.aabouzaid.com | LinkedIn.com/in/aabouzaid
  • 3. Overview ● Scenario ● What is Crossplane? ● How it look like? ● Crossplane Concepts ● How Crossplane Works ● Pros and Cons ● Conclusion ● Resources ● Questions
  • 4. Let’s have a look at a real-world scenario where the DevOps engineers decided to build an abstraction layer to be used by all dev teams (aka Platform Engineering), and they found the solution! Crossplane, the open-source control plane! Scenario
  • 5. Scenario (Cont.) 03 The dev teams follow the principle of "you build it, you manage it", but just for the application, not the infrastructure, because they are not experienced with Terraform. 01 A mid-size company has 10 development teams. Its tech stack is mainly Kubernetes for the applications and Terraform for the infrastructure. 02 Each team has a 2-week sprint; at the end of the sprint, they need to spin a fresh env for the final acceptance tests. That env should have the Kubernetes deployment for the application, Cloud Database, and Cloud Cache.
  • 6. Scenario (Cont.) 06 With more coming custom changes, it was hard for the DevOps engineers to handle all those requests even with automation. Here the time to build an abstraction layer to be used by all dev teams (aka Platform Engineering). 04 Each time a team needs that new env, they ask the DevOps engineers to push the magic button to spin those new Cloud env. 05 The DevOps engineers decided to automate that process, however, they needed to implement 2 different systems for that: the infrastructure automation for Terraform and the application automation for Kubernetes.
  • 8. What is Crossplane? Crossplane is a Cloud Native Computing Foundation (CNCF) project built on the foundation of Kubernetes to orchestrate anything. At the core, it is an open-source Kubernetes add-on that extends Kubernetes to enable the deployment and management of infrastructure and services of various Cloud providers and on-premises environments. In other words, Crossplane is not just a tool but an extensible Kubernetes operator and framework.
  • 9. How it look like? This is an example of Crossplane Claim, namely PostgreSQLInstance from Google Cloud Platform Configuration. It’s same like any manifest of Kubernetes and could be even be part of GitOps flow, Helm chart, or Kustomize object. You can also created your own composition according to you needs. apiVersion: gcp.platformref.upbound.io/v1alpha1 kind: PostgreSQLInstance metadata: name: super-app-db namespace: super-app spec: parameters: storageGB: 10 passwordSecretRef: namespace: default name: psql-secret key: password clusterRef: id: platform-ref-gcp-cluster writeConnectionSecretToRef: name: platform-ref-gcp-db-con
  • 10. How it look like? (Cont.) Here is an example of a Crossplane claim based on a Composition I’ve created that spins a new GKE cluster. Full example at: github.com/DevOpsHiveCloud/crossplane-composite -resource-demo apiVersion: cluster.devopshive.net/v1alpha1 kind: GKE metadata: name: ci namespace: ci spec: name: ci-cluster region: europe-west1 parameters: cluster: minVersion: 1.27.3-gke.100 nodes: autoscaling: minNodeCount: 0 maxNodeCount: 64 writeConnectionSecretToRef: name: cluster-conn-ci-cluster
  • 11. Crossplane Concepts Component Abbr. Scope Functionality Provider - Cluster Creates new Kubernetes Custom Resource Definitions for an external service. Provider Config PC Cluster Applies settings for a Provider. Managed Resource MR Cluster A Provider resource created and managed by Crossplane inside the Kubernetes cluster. Composition - Cluster A template for creating multiple managed resources at once (think as a Terraform module).
  • 12. Crossplane Concepts (Cont.) Component Abbr. Scope Functionality Composite Resources XR Cluster Uses a Composition template to create multiple managed resources as a single Kubernetes object (think as a Terraform tfvars file). CompositeResource Definitions XRD Cluster Defines the API schema for Composite Resources and Claims (think as Kubernetes Custom Resource Definition). Claims XC Namespace Like a Composite Resource, but namespace scoped (think as Kubernetes Custom Resource).
  • 13. How Crossplane Works Component Functionality Crossplane Configuration Compose Custom API Crossplane Providers Connect to Cloud API Crossplane Runtime Manage External APIs (Create/Update/Delete) Kubernetes Runtime (API Machinery, Controller Runtime) Events, Watch, Reconciliation, CRDs, OpenAPI, Persistence (etcd), Run Workloads, Ingress, RBAC Components of Crossplane powered Control plane
  • 14. How Crossplane Works (Cont.) Connect Compose Consume Managed Resources XRD Composite Resource Definition App A Cloud API Composition Claim Provider Configuration Platform Team Platform Team Development Team
  • 15. Claims are namespaced objects consumed by platform users (e.g., development teams)
  • 16. Pros Cons ● Cloud Native, extensible, declarative, API-driven using Kubernetes-style ● Could be used with the same Kubernetes ecosystem tools (e.g. ArgoCD for GitOps) ● Stateless (unlike Terraform, no need to manage the state) ● Already using Terraform providers and support most of the Cloud services ● Bootstrap is challenging (it needs an already running Kubernetes cluster) ● Relatively new compared to other solutions (missing utils and helpers) ● Hard to debug and troubleshoot (you will use “kubectl get events” a lot) ● It requires some time to get used to Composition concepts (module-like config) Pros and Cons
  • 17. Crossplane is a great framework for managing infrastructure using the Kubernetes style and benefits from the that ecosystem (ArgoCD, Helm, Kustomize, etc.). There are many use cases where it can perfectly fit in already. And at the time of writing these words (November 2023), the Marketplace has numerous enterprise and community providers configurations. Also Composition Functions graduated to beta. However, it’s a relatively new ecosystem and still evolving, so it might not be the optimal solution for every workload. But it’s probably a matter of time to grow more. So, if it’s not your fit now, consider revisiting in the future. Conclusion
  • 18. Resources ● docs.crossplane.io ● blog.crossplane.io/crossplane-vs-terraform ● blog.upbound.io/composing-a-platform-by-patching-crossplane-resources ● innoq.com/en/articles/2022/07/infrastructure-self-service-with-crossplane ● thenewstack.io/crossplane-what-most-people-get-wrong-and-how-to-get-it-right ● masterpoint.io/updates/passing-on-crossplane For more resources: github.com/DevOpsHiveCloud/awesome-crossplane