Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kitagry/kubers-sample
A toy custom controller for kubernetes wirtten by kube-rs
https://github.com/kitagry/kubers-sample
Last synced: 15 days ago
JSON representation
A toy custom controller for kubernetes wirtten by kube-rs
- Host: GitHub
- URL: https://github.com/kitagry/kubers-sample
- Owner: kitagry
- Created: 2021-09-15T14:29:47.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-09-19T03:31:36.000Z (over 3 years ago)
- Last Synced: 2024-12-15T14:43:52.112Z (20 days ago)
- Language: Rust
- Homepage:
- Size: 25.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## kubers-sample
A toy custom controller written by Rust.
### Register CustomResourceDefinition
```bash
$ cargo run --bin crdgen | kubectl apply -f -
```### Run Custom Controller
```bash
$ cargo run --bin controller
```### Create Custom Resource
```bash
# Create custom resource
$ kubectl apply -f config/sample/sample.yaml$ kubectl get jobs.kitagry.github.io
NAME AGE
sample 1m0s$ kubectl get pods
NAME READY STATUS RESTARTS AGE
sample-m7vbtg 1/1 Running 0 1m0s# Delete custom resource
$ kubectl delete -f config/sample/sample.yaml
job.kitagry.github.io "sample" deleted# Pod is deleted, too.
$ kubectl get pods
No resources found in default namespace.
```