Skip to content

Commit

Permalink
Merge pull request #102 from upmc-enterprises/crd
Browse files Browse the repository at this point in the history
Implement CustomResourceDefinition and remove TPR
  • Loading branch information
stevesloka authored Oct 3, 2017
2 parents 7b2bc85 + 48e0c05 commit f4e3a33
Show file tree
Hide file tree
Showing 673 changed files with 90,874 additions and 63,765 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

.PHONY: all build container push clean test

TAG ?= 0.0.7
TAG ?= 0.0.8
PREFIX ?= upmcenterprises

all: container
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ The ElasticSearch operator is designed to manage one or more elastic search clus

## Kubernetes

The operator was built and tested on a 1.6.X Kubernetes cluster and is the only version supported currently. This is because it is utilizing [`StatefulSets`](https://kubernetes.io/docs/concepts/abstractions/controllers/statefulsets/) as well as [`CronJobs`](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/) which are not available in previous versions of Kubernetes.
The operator was built and tested on a 1.7.X Kubernetes cluster and is the minimum version required due to the operators use of Custom Resource Definitions.

_NOTE: If using on an older cluster, please make sure to use version [v0.0.7] (https://github.com/upmc-enterprises/elasticsearch-operator/releases/tag/v0.0.7) which still utilize third party resources.

## Cloud

Expand All @@ -24,9 +26,9 @@ Watch a demo here:<br>

# Usage

The operator is built using the controller + third party resource model. Once the controller is deployed to your cluster, it will automatically create the ThirdPartyResource. Next create a Kubernetes object type `elasticsearchCluster` to deploy the elastic cluster based upon the TPR.
The operator is built using the controller + custom resource definition model. Once the controller is deployed to your cluster, it will automatically create the CustomResourceDefinition (CRD). Next create a Kubernetes object type `elasticsearchCluster` to deploy the elastic cluster based upon the CRD.

## ThirdPartyResource
## CustomResourceDefinition

Following parameters are available to customize the elastic cluster:

Expand Down Expand Up @@ -59,7 +61,7 @@ If supplying your own certs, first generate them and add to a secret. Secret sho

## Base image

The base image used is `upmcenterprises/docker-elasticsearch-kubernetes:5.3.1` which can be overriden by addeding to the custom cluster you create _(See: [ThirdPartyResource](#thirdpartyresource) above)_.
The base image used is `upmcenterprises/docker-elasticsearch-kubernetes:5.3.1` which can be overriden by addeding to the custom cluster you create _(See: [CustomResourceDefinition](#customdesourcedefinition) above)_.

_NOTE: If no image is specified, the default noted previously is used._

Expand Down Expand Up @@ -104,7 +106,7 @@ _NOTE: In the example we're putting the operator into the namespace `operator`.
```bash
$ kubectl create -f https://raw.githubusercontent.com/upmc-enterprises/elasticsearch-operator/master/example/example-es-cluster.json
```
_NOTE: Creating a custom cluster requires the creation of a ThirdPartyResource. This happens automatically after the controller is created._
_NOTE: Creating a custom cluster requires the creation of a CustomResourceDefinition. This happens automatically after the controller is created._

# Create Example ElasticSearch Cluster (Minikube)

Expand All @@ -113,7 +115,7 @@ To run the operator on minikube, this sample file is setup to do that. It sets l
```bash
$ kubectl create -f https://raw.githubusercontent.com/upmc-enterprises/elasticsearch-operator/master/example/example-es-cluster-minikube.json
```
_NOTE: Creating a custom cluster requires the creation of a ThirdPartyResource. This happens automatically after the controller is created._
_NOTE: Creating a custom cluster requires the creation of a CustomResourceDefinition. This happens automatically after the controller is created._

# Resize ElasticSearch Cluster

Expand Down
2 changes: 1 addition & 1 deletion cmd/operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (
)

var (
appVersion = "0.0.7"
appVersion = "0.0.8"

printVersion bool
baseImage string
Expand Down
34 changes: 0 additions & 34 deletions example/example-es-cluster-azure.json

This file was deleted.

25 changes: 25 additions & 0 deletions example/example-es-cluster-azure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: enterprises.upmc.com/v1
kind: ElasticsearchCluster
metadata:
name: example-es-cluster
spec:
client-node-replicas: 3
master-node-replicas: 2
data-node-replicas: 3
network-host: 0.0.0.0
zones: []
data-volume-size: 10Gi
java-options: "-Xms1024m -Xmx1024m"
snapshot:
scheduler-enabled: false
bucket-name: elasticsnapshots99
cron-schedule: "@every 2m"
storage:
storage-class: default
resources:
requests:
memory: 512Mi
cpu: 500m
limits:
memory: 1024Mi
cpu: '1'
26 changes: 0 additions & 26 deletions example/example-es-cluster-minikube.json

This file was deleted.

20 changes: 20 additions & 0 deletions example/example-es-cluster-minikube.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: enterprises.upmc.com/v1
kind: ElasticsearchCluster
metadata:
name: example-es-cluster
spec:
elastic-search-image: upmcenterprises/docker-elasticsearch-kubernetes:5.3.1
client-node-replicas: 1
master-node-replicas: 1
data-node-replicas: 3
network-host: 0.0.0.0
zones: []
data-volume-size: 10Gi
java-options: "-Xms256m -Xmx256m"
snapshot:
scheduler-enabled: false
bucket-name: elasticsnapshots99
cron-schedule: "@every 2m"
storage:
type: standard
storage-class-version: volume.alpha.kubernetes.io/storage-class
27 changes: 27 additions & 0 deletions example/example-es-cluster-rook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: enterprises.upmc.com/v1
kind: ElasticSearch-Clusters
metadata:
name: example-es-cluster
spec:
kibana:
image: upmcenterprises/kibana:5.3.1
client-node-replicas: 3
master-node-replicas: 2
data-node-replicas: 3
network-host: 0.0.0.0
zones: []
data-volume-size: 10Gi
java-options: "-Xms256m -Xmx256m"
snapshot:
scheduler-enabled: false
bucket-name: elasticsnapshots99
cron-schedule: "@every 2m"
storage:
storage-class: rook-block
resources:
requests:
memory: 512Mi
cpu: 500m
limits:
memory: 1024Mi
cpu: '1'
38 changes: 0 additions & 38 deletions example/example-es-cluster.json

This file was deleted.

31 changes: 31 additions & 0 deletions example/example-es-cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: enterprises.upmc.com/v1
kind: ElasticsearchCluster
metadata:
name: example-es-cluster
spec:
kibana:
image: upmcenterprises/kibana:5.3.1
client-node-replicas: 3
master-node-replicas: 2
data-node-replicas: 3
network-host: 0.0.0.0
zones:
- us-east-1c
- us-east-1d
- us-east-1e
data-volume-size: 10Gi
java-options: "-Xms256m -Xmx256m"
snapshot:
scheduler-enabled: false
bucket-name: elasticsnapshots99
cron-schedule: "@every 2m"
storage:
type: gp2
storage-class-provisioner: kubernetes.io/aws-ebs
resources:
requests:
memory: 512Mi
cpu: 500m
limits:
memory: 1024Mi
cpu: '1'
Loading

0 comments on commit f4e3a33

Please sign in to comment.