Skip to content

Commit

Permalink
Merge branch 'master' into custom_annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
komljen authored May 31, 2019
2 parents d1eb807 + 4afe59d commit 24b4b47
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Following parameters are available to customize the elastic cluster:
- data-node-replicas: Number of data node replicas
- zones: Define which zones to deploy data nodes to for high availability (_Note: Zones are evenly distributed based upon number of data-node-replicas defined_)
- data-volume-size: Size of persistent volume to attach to data nodes
- master-volume-size: Size of persistent volume to attach to master nodes
- elastic-search-image: Override the elasticsearch image (e.g. `upmcenterprises/docker-elasticsearch-kubernetes:6.1.3_0`)
- keep-secrets-on-delete (Boolean): Tells the operator to not delete cert secrets when a cluster is deleted
- use-ssl: Use SSL for communication with the cluster and inside the cluster. Default value is true.
Expand Down Expand Up @@ -113,6 +114,7 @@ spec:
client-node-replicas: 3
data-node-replicas: 3
data-volume-size: 10Gi
master-volume-size: 10Gi
java-options: -Xms256m -Xmx256m
master-node-replicas: 2
image-pull-secrets:
Expand Down Expand Up @@ -281,6 +283,7 @@ spec:
client-node-replicas: 3
data-node-replicas: 3
data-volume-size: 10Gi
master-volume-size: 10Gi
java-options: -Xms256m -Xmx256m
master-node-replicas: 2
snapshot:
Expand Down
1 change: 1 addition & 0 deletions example/example-es-cluster-azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ spec:
network-host: 0.0.0.0
zones: []
data-volume-size: 10Gi
master-volume-size: 10Gi
java-options: "-Xms1024m -Xmx1024m"
snapshot:
scheduler-enabled: false
Expand Down
1 change: 1 addition & 0 deletions example/example-es-cluster-gke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ spec:
zones:
- us-east1-d
data-volume-size: 10Gi
master-volume-size: 10Gi
java-options: "-Xms512m -Xmx512m"
snapshot:
scheduler-enabled: false
Expand Down
1 change: 1 addition & 0 deletions example/example-es-cluster-hostpath.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ spec:
network-host: 0.0.0.0
zones: []
data-volume-size: 10Gi
master-volume-size: 10Gi
java-options: "-Xms512m -Xmx512m"
snapshot:
scheduler-enabled: false
Expand Down
1 change: 1 addition & 0 deletions example/example-es-cluster-ibm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ spec:
- dal12
- dal13
data-volume-size: 10Gi
master-volume-size: 10Gi
java-options: "-Xms512m -Xmx512m"
snapshot: # Not verified with IBM Cloud Object Storage
scheduler-enabled: false
Expand Down
1 change: 1 addition & 0 deletions example/example-es-cluster-minikube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ spec:
network-host: 0.0.0.0
zones: []
data-volume-size: 10Gi
master-volume-size: 10Gi
java-options: "-Xms512m -Xmx512m"
snapshot:
scheduler-enabled: false
Expand Down
1 change: 1 addition & 0 deletions example/example-es-cluster-rook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ spec:
network-host: 0.0.0.0
zones: []
data-volume-size: 10Gi
master-volume-size: 10Gi
java-options: "-Xms256m -Xmx256m"
snapshot:
scheduler-enabled: false
Expand Down
1 change: 1 addition & 0 deletions example/example-es-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ spec:
zones:
- us-east-2b
data-volume-size: 10Gi
master-volume-size: 10Gi
java-options: "-Xms512m -Xmx512m"
snapshot:
scheduler-enabled: false
Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/elasticsearchoperator/v1/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ type ClusterSpec struct {
// to the data nodes in the ES cluster
DataDiskSize string `json:"data-volume-size"`

// MasterDiskSize specifies how large the persistent volume should be attached
// to the master nodes in the ES cluster
MasterDiskSize string `json:"master-volume-size"`

// ElasticSearchImage specifies the docker image to use (optional)
ElasticSearchImage string `json:"elastic-search-image"`

Expand Down
6 changes: 3 additions & 3 deletions pkg/processor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ func (p *Processor) refreshClusters() error {
DataNodeReplicas: cluster.Spec.DataNodeReplicas,
Zones: cluster.Spec.Zones,
DataDiskSize: cluster.Spec.DataDiskSize,
MasterDiskSize: cluster.Spec.MasterDiskSize,
JavaOptions: cluster.Spec.JavaOptions,
ClientJavaOptions: cluster.Spec.ClientJavaOptions,
DataJavaOptions: cluster.Spec.DataJavaOptions,
Expand Down Expand Up @@ -396,7 +397,7 @@ func (p *Processor) processElasticSearchCluster(c *myspec.ElasticsearchCluster)

// Create Master Nodes
for index, count := range zoneDistributionMaster {
if err := p.k8sclient.CreateDataNodeDeployment("master", &count, baseImage, c.Spec.Zones[index], c.Spec.DataDiskSize, c.Spec.Resources,
if err := p.k8sclient.CreateDataNodeDeployment("master", &count, baseImage, c.Spec.Zones[index], c.Spec.MasterDiskSize, c.Spec.Resources,
c.Spec.ImagePullSecrets, c.Spec.ImagePullPolicy, c.Spec.ServiceAccountName, c.ObjectMeta.Name, c.Spec.Instrumentation.StatsdHost, c.Spec.NetworkHost,
c.ObjectMeta.Namespace, c.Spec.JavaOptions, c.Spec.MasterJavaOptions, c.Spec.DataJavaOptions, c.Spec.UseSSL, c.Spec.Scheduler.ElasticURL, c.Spec.NodeSelector, c.Spec.Tolerations, c.Spec.Annotations); err != nil {
logrus.Error("Error creating master node deployment ", err)
Expand All @@ -423,10 +424,9 @@ func (p *Processor) processElasticSearchCluster(c *myspec.ElasticsearchCluster)

// Create Master Nodes
if err := p.k8sclient.CreateDataNodeDeployment("master", func() *int32 { i := int32(c.Spec.MasterNodeReplicas); return &i }(), baseImage, c.Spec.Storage.StorageClass,
c.Spec.DataDiskSize, c.Spec.Resources, c.Spec.ImagePullSecrets, c.Spec.ImagePullPolicy, c.Spec.ServiceAccountName, c.ObjectMeta.Name,
c.Spec.MasterDiskSize, c.Spec.Resources, c.Spec.ImagePullSecrets, c.Spec.ImagePullPolicy, c.Spec.ServiceAccountName, c.ObjectMeta.Name,
c.Spec.Instrumentation.StatsdHost, c.Spec.NetworkHost, c.ObjectMeta.Namespace, c.Spec.JavaOptions, c.Spec.MasterJavaOptions, c.Spec.DataJavaOptions, c.Spec.UseSSL, c.Spec.Scheduler.ElasticURL, c.Spec.NodeSelector, c.Spec.Tolerations, c.Spec.Annotations); err != nil {
logrus.Error("Error creating master node deployment ", err)

return err
}

Expand Down

0 comments on commit 24b4b47

Please sign in to comment.