presto-operator

command module
v0.0.0-...-e24fcb8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2019 License: Apache-2.0 Imports: 34 Imported by: 0

README

presto-controller

This is a prototype of Presto K8S Operator. Tested and developed in GKE. This project follows the approach used in kubernetes/sample-controller.

How to start

Start the presto-controller

Compile the presto-controller

$ dep ensure  # This project is using dep for dependency management
$ go build -o presto-controller .

Start the presto-controller

$ ./presto-controller -kubeconfig=<PATH_TO_YOUR_KUBECONFIG> -logtostderr -v 4

Create a Presto CRD

Create a CRD Definition in your K8S cluster.

$ kubectl create -f artifacts/crd.yaml

Create a Presto resource

$ kubectl create -f artifacts/example1.yaml

Example

# Create a CRD Definition in your K8S cluster.
$ kubectl create -f artifacts/crd.yaml

# Create the configmaps for presto
$ kubectl create configmap coordinator-config --from-file=coordinator_config
$ kubectl create configmap worker-config --from-file=worker_config
$ kubectl create configmap catalog --from-file=catalog

# Create a Presto CRD
# Specify the configmaps in the Presto CRD
$ cat artifacts/example1.yaml
apiVersion: prestocontroller.prestosql.io/v1alpha1
kind: Presto
metadata:
  name: presto-cluster
spec:
  clusterName: star-presto
  image: "gcr.io/learn-227713/presto:latest"
  replicas: 2
  coordinatorConfig: coordinator-config   ## Config file for coordinator
  workerConfig: worker-config             ## Config file for worker
  catalogConfig: catalog                  ## Config file for catalog

$ kubectl create -f artifacts/example1.yaml
presto.prestocontroller.prestosql.io/presto-cluster created

$ kubectl get presto
NAME             DESIRED   CURRENT
presto-cluster   2         2

$ kubectl get rs
NAME                            DESIRED   CURRENT   READY   AGE
star-presto-coordinator-r9jtl   1         1         0       6s
star-presto-worker-9vv65        2         2         0       5s

$ kubectl get pods
NAME                                  READY   STATUS    RESTARTS   AGE
star-presto-coordinator-r9jtl-sbwjt   1/1     Running   0          22s
star-presto-worker-9vv65-7ddmq        1/1     Running   0          22s
star-presto-worker-9vv65-kcb27        1/1     Running   0          22s

WIP

Deploy operator using pre-build docker image

Setup the service account if you are using RBAC. Then create a presto-operator deployment. You may refer to artifacts/operator.yaml

Memo

The Dockerfile in docker/presto/ builds the Docker image of Presto being used by this project.

The Dockerfile in docker/ builds the Docker image of Presto-operator.

Presto Resource = 
    Presto Coordinator ReplicaSet
    + Presto Worker ReplicaSet
    + Presto Coordinator Service

Presto Coordinator ReplicaSet =
    Presto docker image
    + Coordinator ConfigMap/Secret

Presto Worker ReplicaSet = 
    Presto docker image
    + Worker ConfigMap/Secret

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
apis/operator/v1alpha1
Package v1alpha1 is the v1alpha1 version of the API.
Package v1alpha1 is the v1alpha1 version of the API.
client/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
client/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
client/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
client/clientset/versioned/typed/operator/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/operator/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL