Is Rust good for Kubernetes?
Natalie Serebryakova
Whoami
● My name is Natalie
● I'm a Staff Cloud Engineer
● LinkedIn: https://www.linkedin.com/in/login-id/
● AWS Community Builder
● AWS User Group co-organizer
Agenda
● Kubernetes Operator
● Using Rust to develop Kubernetes Operator (PVC, PV)
● Demo using PVC Operator example
● Summary
Kubernetes Operators (Custom controllers)
Operators let you use custom app-specific object types to automate the
underlying Kubernetes configuration.
How Kubernetes Operators used?
● Kubernetes Operators are processes that connect to the Kubernetes API and
watch for events (typically on a limited number of resource types).
● When a relevant event occurs, the operator reacts and performs a specific
action
Why to use Rust for Kubernetes ecosystem?
Feature Go Rust
Performance ✅ Good enough
✅ low-level control over memory management
✅ compiler optimizations
✅ and concurrency features
Concurrency
✅ Goroutines and channels
for concurrency
Async/await syntax :
✅ require finer control over concurrency
✅ error handling
✅ have performance-critical asynchronous tasks
Safety
✅ Strong typing, but lacks
memory safety checks
✅ Strong typing with rigorous (guaranteed)
memory safety checks
Majority K8s ecosystem (as of today) is build in Go. Is there benefit of using Rust?
Building Kubernetes Operators PVC with Rust
• Kubernetes Operator can automate the management of PVCs and PVs, handling
lifecycle events like creation, deletion, scaling, and backup/restoration
To build Kubernetes Operators using Rust in Kubernetes clusters we will need to Extend
Kubernetes API with Custom Resource Definitions (CRDs) to support
• PersistentVolumeClaims (PVCs): PVCs request specific size and access modes (e.g.,
read/write) for storage from Persistent Volumes (PVs).
• PersistentVolumes (PVs): PVs are the storage resources in the cluster. Each PV
corresponds to a PVC's request.
Building and deploying K8s Operator with Rust
● Rust Environment: Ensure Rust and Cargo are installed.
● Kubernetes Cluster: A Minikube or any Kubernetes cluster.
● Docker: For building and pushing the operator's container image.
● kubectl: For interacting with the Kubernetes cluster.
● kube-rs, kuberntes-openapi, tokio, serde, log Crates: Required Rust crates.
Rust crates to use
kube-rs and kubernetes-openapi are Rust crates specifically designed to support
the development of Kubernetes operators.
- kube-rs:
● Provides useful abstractions over Kubernetes API
● Simplifies handling of Custom Resource Definitions (CRDs)
- kubernetes-openapi:
● Used by kube-rs for Kubernetes API interaction
● Enhancing operator development capabilities.
Best practices for writing Kubernetes Operators
1. Define clear Custom Resources (CRDs) and associated control loops
2. Follow K8s API conventions, client libraries
3. Handle state properly
4. Incorporate error handling
5. Secure your Operator
6. Document your Operator
Kubernetes Client configuration
● Initialize the Kubernetes client for interacting with the cluster, leveraging the default
Controller Components
● Struct holds configuration that affects the controller's behavior, such as default
values for storage classes or thresholds for certain operations.
Creating Custom Controller
Creating Custom Controller
Packaging the operator
“Package” into the container by creating a Dockerfile:
Run :
docker build -t yourusername/k8s_pvc_operator:v1 .
docker push yourusername/k8s_pvc_operator:v1
Deploying the operator
1. kubectl apply -f local-pv.yaml
2. kubectl apply -f local-pvc.yaml
Running the operator
Summary
Developed Operator ensures data persistence in a Kubernetes cluster by managing
the underlying storage infrastructure .
THANK YOU

More Related Content

PPTX
Introduction+to+Kubernetes-Details-D.pptx
PDF
What Does Kubernetes Look Like?: Performance Monitoring & Visualization with ...
PDF
Google Cloud Platform Kubernetes Workshop IYTE
PPTX
Kubernetes: від знайомства до використання у CI/CD
PPTX
Containers kuberenetes
PPTX
Containers kuberenetes
PPTX
Kubernetes #1 intro
PDF
Containers kuberenetes
Introduction+to+Kubernetes-Details-D.pptx
What Does Kubernetes Look Like?: Performance Monitoring & Visualization with ...
Google Cloud Platform Kubernetes Workshop IYTE
Kubernetes: від знайомства до використання у CI/CD
Containers kuberenetes
Containers kuberenetes
Kubernetes #1 intro
Containers kuberenetes

Similar to stackconf 2024 | Ignite: Is rust good for Kubernetes by Natalie Serebryakova .pdf (20)

PDF
DevJam 2019 - Introduction to Kubernetes
PDF
Kubernetes intro
PDF
Introduction to Kubernetes Workshop
PPTX
Kubernetes presentation
PPTX
Container Orchestration using kubernetes
PDF
Introduction to kubernetes
PDF
An intro to Kubernetes operators
PDF
Nugwc k8s session-16-march-2021
PDF
kubernetesssssssssssssssssssssssssss.pdf
PDF
Kubernetes/ EKS - 김광영 (AWS 솔루션즈 아키텍트)
PPTX
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
PDF
Acd19 kubertes cluster at scale on aws at intuit
PDF
Rancher 2.0 Technical Deep Dive
PDF
Ansible Dresden meetup (Dec 2019) - How Operators with Ansible make Kubernete...
PDF
Scalable Spark deployment using Kubernetes
PDF
Build and Deploy Cloud Native Camel Quarkus routes with Tekton and Knative
PPTX
KubernetesPPT.pptx
PDF
Building Cloud-Native Applications with Kubernetes, Helm and Kubeless
PPTX
Significance Of Kubernetes In DevOps
PPTX
Kubernetes_101_Zero_to_Platform_Engineer.pptx
DevJam 2019 - Introduction to Kubernetes
Kubernetes intro
Introduction to Kubernetes Workshop
Kubernetes presentation
Container Orchestration using kubernetes
Introduction to kubernetes
An intro to Kubernetes operators
Nugwc k8s session-16-march-2021
kubernetesssssssssssssssssssssssssss.pdf
Kubernetes/ EKS - 김광영 (AWS 솔루션즈 아키텍트)
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
Acd19 kubertes cluster at scale on aws at intuit
Rancher 2.0 Technical Deep Dive
Ansible Dresden meetup (Dec 2019) - How Operators with Ansible make Kubernete...
Scalable Spark deployment using Kubernetes
Build and Deploy Cloud Native Camel Quarkus routes with Tekton and Knative
KubernetesPPT.pptx
Building Cloud-Native Applications with Kubernetes, Helm and Kubeless
Significance Of Kubernetes In DevOps
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Ad

Recently uploaded (20)

PPTX
Kompem Part Untuk MK Komunikasi Pembangunan 5.pptx
PPTX
INDIGENOUS-LANGUAGES-AND-LITERATURE.pptx
PDF
_Nature and dynamics of communities and community development .pdf
PPTX
Knowledge Knockout ( General Knowledge Quiz )
PDF
Public speaking for kids in India - LearnifyU
PPTX
2025-08-17 Joseph 03 (shared slides).pptx
PPT
Lessons from Presentation Zen_ how to craft your story visually
PPTX
CAPE CARIBBEAN STUDIES- Integration-1.pptx
PPTX
TG Hospitality workshop Vietnam (1).pptx
PPTX
Lesson 2 (Technology and Transmission) - Terms.pptx
PPTX
Public Speaking Is Easy . Start Now . It's now or never.
DOCX
CLASS XII bbbbbnjhcvfyfhfyfyhPROJECT.docx
PDF
Financial Managememt CA1 for Makaut Student
PPTX
power point presentation ofDracena species.pptx
PPTX
Unit 8#Concept of teaching and learning.pptx
DOC
EVC毕业证学历认证,北密歇根大学毕业证留学硕士毕业证
PDF
Unnecessary information is required for the
PPTX
Literatura en Star Wars (Legends y Canon)
PPTX
Lesson 1 (Digital Media) - Multimedia.pptx
PPTX
HOW TO HANDLE THE STAGE FOR ACADEMIA AND OTHERS.pptx
Kompem Part Untuk MK Komunikasi Pembangunan 5.pptx
INDIGENOUS-LANGUAGES-AND-LITERATURE.pptx
_Nature and dynamics of communities and community development .pdf
Knowledge Knockout ( General Knowledge Quiz )
Public speaking for kids in India - LearnifyU
2025-08-17 Joseph 03 (shared slides).pptx
Lessons from Presentation Zen_ how to craft your story visually
CAPE CARIBBEAN STUDIES- Integration-1.pptx
TG Hospitality workshop Vietnam (1).pptx
Lesson 2 (Technology and Transmission) - Terms.pptx
Public Speaking Is Easy . Start Now . It's now or never.
CLASS XII bbbbbnjhcvfyfhfyfyhPROJECT.docx
Financial Managememt CA1 for Makaut Student
power point presentation ofDracena species.pptx
Unit 8#Concept of teaching and learning.pptx
EVC毕业证学历认证,北密歇根大学毕业证留学硕士毕业证
Unnecessary information is required for the
Literatura en Star Wars (Legends y Canon)
Lesson 1 (Digital Media) - Multimedia.pptx
HOW TO HANDLE THE STAGE FOR ACADEMIA AND OTHERS.pptx
Ad

stackconf 2024 | Ignite: Is rust good for Kubernetes by Natalie Serebryakova .pdf

  • 1. Is Rust good for Kubernetes? Natalie Serebryakova
  • 2. Whoami ● My name is Natalie ● I'm a Staff Cloud Engineer ● LinkedIn: https://www.linkedin.com/in/login-id/ ● AWS Community Builder ● AWS User Group co-organizer
  • 3. Agenda ● Kubernetes Operator ● Using Rust to develop Kubernetes Operator (PVC, PV) ● Demo using PVC Operator example ● Summary
  • 4. Kubernetes Operators (Custom controllers) Operators let you use custom app-specific object types to automate the underlying Kubernetes configuration.
  • 5. How Kubernetes Operators used? ● Kubernetes Operators are processes that connect to the Kubernetes API and watch for events (typically on a limited number of resource types). ● When a relevant event occurs, the operator reacts and performs a specific action
  • 6. Why to use Rust for Kubernetes ecosystem? Feature Go Rust Performance ✅ Good enough ✅ low-level control over memory management ✅ compiler optimizations ✅ and concurrency features Concurrency ✅ Goroutines and channels for concurrency Async/await syntax : ✅ require finer control over concurrency ✅ error handling ✅ have performance-critical asynchronous tasks Safety ✅ Strong typing, but lacks memory safety checks ✅ Strong typing with rigorous (guaranteed) memory safety checks Majority K8s ecosystem (as of today) is build in Go. Is there benefit of using Rust?
  • 7. Building Kubernetes Operators PVC with Rust • Kubernetes Operator can automate the management of PVCs and PVs, handling lifecycle events like creation, deletion, scaling, and backup/restoration To build Kubernetes Operators using Rust in Kubernetes clusters we will need to Extend Kubernetes API with Custom Resource Definitions (CRDs) to support • PersistentVolumeClaims (PVCs): PVCs request specific size and access modes (e.g., read/write) for storage from Persistent Volumes (PVs). • PersistentVolumes (PVs): PVs are the storage resources in the cluster. Each PV corresponds to a PVC's request.
  • 8. Building and deploying K8s Operator with Rust ● Rust Environment: Ensure Rust and Cargo are installed. ● Kubernetes Cluster: A Minikube or any Kubernetes cluster. ● Docker: For building and pushing the operator's container image. ● kubectl: For interacting with the Kubernetes cluster. ● kube-rs, kuberntes-openapi, tokio, serde, log Crates: Required Rust crates.
  • 9. Rust crates to use kube-rs and kubernetes-openapi are Rust crates specifically designed to support the development of Kubernetes operators. - kube-rs: ● Provides useful abstractions over Kubernetes API ● Simplifies handling of Custom Resource Definitions (CRDs) - kubernetes-openapi: ● Used by kube-rs for Kubernetes API interaction ● Enhancing operator development capabilities.
  • 10. Best practices for writing Kubernetes Operators 1. Define clear Custom Resources (CRDs) and associated control loops 2. Follow K8s API conventions, client libraries 3. Handle state properly 4. Incorporate error handling 5. Secure your Operator 6. Document your Operator
  • 11. Kubernetes Client configuration ● Initialize the Kubernetes client for interacting with the cluster, leveraging the default
  • 12. Controller Components ● Struct holds configuration that affects the controller's behavior, such as default values for storage classes or thresholds for certain operations.
  • 15. Packaging the operator “Package” into the container by creating a Dockerfile: Run : docker build -t yourusername/k8s_pvc_operator:v1 . docker push yourusername/k8s_pvc_operator:v1
  • 16. Deploying the operator 1. kubectl apply -f local-pv.yaml 2. kubectl apply -f local-pvc.yaml
  • 18. Summary Developed Operator ensures data persistence in a Kubernetes cluster by managing the underlying storage infrastructure .