Spanner operation client for Cloud Spanner Administrator.
This repo is based on sample-controller.
This is an experimental project of my own practice creating custom controller.
- Create/Update/Delete instance
- Create/Delete database
- Scale instance node count
โก Notes
Currently I've only tested on my local machine by using minikube.
cd /path/to/this/repo
go build -o controller
./controller -kubeconfig ~/.kube/config (-use-mock: use mock client) (-debbugable: debug log)
cd /path/to/this/repo
cd ./artifacts/crd
kubectl apply -f crd.instance.yml
kubectl apply -f crd.database.yml
cd /path/to/this/repo
cd ./artifacts/sample
kubectl apply -f sample.instance.yml // Create instance
kubectl apply -f sample.database.yml // Create database
kubectl get spi
Output:
NAME NODECOUNT INSTANCECONFIG AGE
testing 1 regional-asia-northeast1 4s
kubectl get spd
Output:
NAME INSTANCEID AGE
testdb testing 3s
kubectl scale spi --replicas 3 testing
Output:
kubectl get spi
----------
NAME NODECOUNT INSTANCECONFIG AGE
testing 3 regional-asia-northeast1 3m56s
- Implement custom metrics server
- Extend the Kubernetes API with CustomResourceDefinitions
- sample-controller
- code-generator
- client-go
- oracle/mysql-operator