kubehelper
This golang project patches the replicas field of a kubernetes deployment for scaling purposes, this project is mainly just for fun and learning, but perhaps could have a usecase for automation for easy programmatic access.
Testing the project
go mody tidy
go build
- run executable
- send request:
curl --location --request PATCH 'http://localhost:8081/api/v1/deployment/scale' \
--header 'Content-Type: application/json' \
--data-raw '{
"Deployment": "nginx-deployment",
"Namespace": "default",
"Replicas": 1
}'
Create local kind cluster
kind create cluster --config kind-example-config.yaml
- switch context to kind
kubectl apply -f test-deployment.yaml
(for testing)