Skip to content

This is an experimental kubernetes operator of Google Cloud Spanner

Notifications You must be signed in to change notification settings

katsew/spanner-operator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spanner-operator

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.

Features

  • Create/Update/Delete instance
  • Create/Delete database
  • Scale instance node count

Installation

⚡ Notes
Currently I've only tested on my local machine by using minikube.

Running controller

cd /path/to/this/repo
go build -o controller
./controller -kubeconfig ~/.kube/config (-use-mock: use mock client) (-debbugable: debug log)

Install CRD

cd /path/to/this/repo
cd ./artifacts/crd
kubectl apply -f crd.instance.yml
kubectl apply -f crd.database.yml

Running sample

cd /path/to/this/repo
cd ./artifacts/sample
kubectl apply -f sample.instance.yml // Create instance
kubectl apply -f sample.database.yml // Create database

Get SpannerInstance

kubectl get spi

Output:

NAME      NODECOUNT   INSTANCECONFIG             AGE
testing   1           regional-asia-northeast1   4s

Get SpannerDatabase

kubectl get spd

Output:

NAME     INSTANCEID   AGE
testdb   testing      3s

Scale SpannerInstance

kubectl scale spi --replicas 3 testing

Output:

kubectl get spi
----------
NAME      NODECOUNT   INSTANCECONFIG             AGE
testing   3           regional-asia-northeast1   3m56s

Plans

  • Implement custom metrics server

References

About custom controller

About autoscaling

About custom metrics

Releases

No releases published

Packages

No packages published

Languages