项目作者: Terracotta-OSS

项目描述 :
Kubernetes operator to setup a Terracotta cluster with ease
高级语言: Java
项目地址: git://github.com/Terracotta-OSS/terracotta-operator.git
创建时间: 2018-12-03T18:50:01Z
项目社区:https://github.com/Terracotta-OSS/terracotta-operator

开源协议:Apache License 2.0

下载


Terracotta Operator

get started with local environement

  1. mvn clean install

Then run the main method from your IDE or run with maven spring-boot:run

Upgrade plugin versions

  1. mvn versions:display-dependency-updates versions:display-plugin-updates

deploying to Kubernetes

build and publish it

  1. mvn -f app/pom.xml jib:dockerBuild
  2. docker push terracotta/terracotta-operator

Required access (if needed)

If you encounter :

  1. Message: Forbidden!Configured service account doesn't have access. Service account may have been revoked. namespaces "thisisatest" is forbidden: User "system:serviceaccount:default:default" cannot get namespaces in the namespace "thisisatest".

Then apply this file :

  1. kubectl apply -f sample-yaml-files/fabric8-rbac.yaml

Run and expose the operator

If on Minikube :

  1. kubectl run terracotta-operator --image-pull-policy='Always' --image=terracotta/terracotta-operator --port=8080
  2. kubectl expose deployment terracotta-operator --name=terracotta-operator-port --type=NodePort
  3. minikube service terracotta-operator-port

If somewhere else :

  1. kubectl run terracotta-operator --image-pull-policy='Always' --image=terracotta/terracotta-operator --port=8080
  2. kubectl expose deployment terracotta-operator --name=operator-port --type=NodePort

Interact with the operator, via Rest

create a new cluster, list it, delete it

To create a new cluster:

  1. curl --header "Content-Type: application/json" \
  2. --request POST \
  3. --data '{"offheaps":{"offheap1":"100MB","offheap2":"1GB"},"serversPerStripe":2,"clientReconnectWindow":20}' \
  4. http://localhost:8080/api/cluster

Check the status of the cluster:

  1. curl http://localhost:8080/api/cluster

Delete the cluster:

  1. curl -X DELETE http://localhost:8080/api/cluster

Interact with the operator, via kubectl and CRDs

  1. kubectl --namespace=thisisatest apply -f sample-yaml-files/1server-cluster.yaml

and delete :

  1. kubectl --namespace=thisisatest delete -f sample-yaml-files/1server-cluster.yaml

few notes

super slow to delete a statefulset…