options | title | author | ||
---|---|---|---|---|
|
Kubernetes meets Rust |
Shawn Wang @ TOOCON 2402 |
- What is Kubernetes?
- Some Rust Kubernetes utilities
- Why Rust is good for Kubernetes? (kube.rs)
- Rust for other parts of Kubernetes.
- k8s - container orchestration engine
- automating deployment / scaling
- management containerized applications
┌─────────────────────────┐ ┌────┬────────────┐
│ ┌────┐ Control Plan │ │Node│kube-proxy┌─┴─────┐
│ │etcd│ │ │ ┌┴──────┬─┬─│Network│
─────┐│ └────┘ ┌───────┐ │ │ │kubelet│ │ └────.──┘
Admin├┼─────────────► Api ◄───┼┐└───┴──┬────┴─┘ ..
kubectl └───────┘ │└────┬──┴┐ ┌─.───
─────┘│ ┌────────────────┐ │ ┌───┴──┐│ │Users
│ │ kube-scheduler │ │ │ Node ││ └─────
│┌──┴────────────────┴───┐│ └───┬──┴┴──┐
││kube-controller-manager││ │ Node │
└┴───────────────────────┴┘ └──────┘
- kubectl
- others
- helm
- kdash / k9s
- kube-scheduler - assigns Pods to Nodes
- kube-controller-manager
- etcd
- kube-api
- kubelet - kube agent
- cri - contianerd / cri-o
- cni
- kube-proxy
- prepare docker or podman
- apt install podman
- kind
- kind create cluster
- kubectl
- prepare kubecfg
- $KUBECONFIG
- kubectl config view
- kubectl config view --raw
kind create cluster -n toocon
podman ps
kubectl get pods -A
-
Object spec and status
-
API / Resource
-
API Group
-
watch
-
kubectl / restful
❯ k get pod nginx-0 -o yaml
apiVersion: v1
kind: Pod
metadata:
labels:
app: nginx
name: nginx-0
namespace: default
spec:
containers:
- image: nginx:1.16.1
status:
conditions:
...
┌──────────┐
┌────┤controller├──────┐
│ └────▲─────┘ │
│ │ schedule object
watch result │
┌────────┐ │ │ ┌────▼─────┐
│kubectl │ │ └───────┤reconciler│
└───┬────┘ │ └────┬─────┘
│ │ update
│ ┌────▼────┐ ` │
└─────►kube api ◄─────────────────┘
└─────────┘
- Concurrency
- No garbage collection.
- memory safe
- performance
- cargo
- cli
- kube.rs
- kernel / M$ / ... love rust
- ...
- core Rust ecosystem for building applications against Kubernetes.
- accepted to CNCF on November 16, 2021 at the Sandbox maturity level ...
- 5 crates
Core traits and types necessary for interacting with the kubernetes API.
for managing Custom Resource Definitions
kube::client and kube::config modules.
Common components for building Kubernetes operators
KDash - A simple Kubernetes dashboard v0.6.0 with ♥ in Rust
┌───────────────────────────────────────────────────────────────┐
│ Active Context <A>│All Contexts <C>│Utilization <U><←→> switch│
└───────────────────────────────────────────────────────────────┘
┌ Namespaces <n> (all: <a>) ────────┐┌ Context┐┌ CLI Info (filte┐
│ Name Status ││CPU: ││kubectl v1.29.0│
│=> kube-insider Active ││0% ━━━━━││kubectl v1.29.1│
└───────────────────────────────────┘└────────┘└────────────────┘
┌ Resources ────────────────────────────────────────────────────┐
│ Pods <1>│ Services <2>│ Nodes <3>│ ConfigMaps <4>│ StatefulSe │
│ │
│ ┌ Select Resource ───────────────────────────────┐ │
│ │ ResourceQuota │ │
│ │=> Tunnel │ │
│ │ ValidatingWebhookConfiguration │ │
│ └────────────────────────────────────────────────┘ │
└───────────────────────────────────────────────────────────────┘
k8s-insider install --pod-cidr 10.244.0.0/16
k8s-insider create network
k8s-insider connect
❯ kubectl get networks.k8s-insider.dev -A
NAMESPACE NAME AGE
kube-insider default 6h51m
❯ kubectl get tunnels.k8s-insider.dev -A
NAMESPACE NAME AGE
kube-insider default-bjk40r 6h49m
kubectl get services -n kube-insider
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
k8s-... NodePort 10.96.153.40 <none> 1234:31237/UDP 54m
- starship - cross shell prompt
- kubie kbs
- kdash
- k8s-insider
- Linkerd linkerd2 (Linkerd is a service mesh for Kubernetes.)
- https://github.com/olix0r/kubert
- CNCF 2023: Alex Leong, Five Years of Cloud Native Rust.
- Istio ztunnel
- Stackable https://github.com/orgs/stackabletech/repositories
- Tembo Stacks: Making Postgres the Everything Database https://tembo.io/
Leveraging State Machines to Build Operators in Rust - Kevin Flansburg, Moose Consulting
- mirrord https://mirrord.dev/
- kubectl plugins
- container related projects
- youki
- https://github.com/containers/conmon-rs (podman)
- wasmtime
- rust-vmm
helm related
conmon-rs
metrics -> prometheus telemetry -> OpenTelemetry
- Linkerd
- container / vmm
- wasm
k8sfwd k8s-insider
kubetui kdash kubectl-view-allocations
kubeconfig-bikeshed / kbs kubesess kubie
krew-wasm krew-wasm-plugin-sdk-rust
ksnotify