https://github.com/backaged/tdset-operator
Kubernetes operator
https://github.com/backaged/tdset-operator
golang kubernetes kubernetes-operator operator-framework operator-sdk
Last synced: about 1 month ago
JSON representation
Kubernetes operator
- Host: GitHub
- URL: https://github.com/backaged/tdset-operator
- Owner: BackAged
- Created: 2022-12-15T17:50:14.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-28T08:30:20.000Z (about 3 years ago)
- Last Synced: 2025-04-22T23:36:59.562Z (12 months ago)
- Topics: golang, kubernetes, kubernetes-operator, operator-framework, operator-sdk
- Language: Go
- Homepage:
- Size: 85 KB
- Stars: 16
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TDSet
A simple kubernetes operator to set replica count based on the hour of the day, built for demonstration purpose for this article -
https://shahin-mahmud.medium.com/write-your-first-kubernetes-operator-in-go-177047337eae
## Description
Built with https://github.com/operator-framework/operator-sdk
This operator lets you dynamically scale up and down your deployment replicaset based on the hour of the day.
Example:
Everyday from 18:00 to 19:00 you want to have 5 replicas of the deployment,
from 19:00 to 21:00 you want to have 3 replicas of the deployment
and rest of the time you want to have 2 replicas of the deployment.
```
apiVersion: schedule.rs/v1
kind: TDSet
metadata:
labels:
app.kubernetes.io/name: tdset-sample
app.kubernetes.io/instance: tdset-sample
app.kubernetes.io/part-of: rs
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: rs
name: tdset-sample
#namespace: tdtest
spec:
container:
image: crccheck/hello-world
port: 8000
schedulingConfig:
- startTime: 18
endTime: 19
replica: 5
- startTime: 19
endTime: 21
replica: 3
defaultReplica: 2
```
## Helm installation
```
helm repo add tdset https://backaged.github.io/tdset-operator/
helm install tdset tdset/tdset-controller -n tdset
```