Code Monkey home page Code Monkey logo

spanner-operator's Introduction

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

spanner-operator's People

Contributors

katsew avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.