Skip to content

Commit 24b4b47

Browse files
authored
Merge branch 'master' into custom_annotations
2 parents d1eb807 + 4afe59d commit 24b4b47

10 files changed

+17
-3
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Following parameters are available to customize the elastic cluster:
3737
- data-node-replicas: Number of data node replicas
3838
- 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_)
3939
- data-volume-size: Size of persistent volume to attach to data nodes
40+
- master-volume-size: Size of persistent volume to attach to master nodes
4041
- elastic-search-image: Override the elasticsearch image (e.g. `upmcenterprises/docker-elasticsearch-kubernetes:6.1.3_0`)
4142
- keep-secrets-on-delete (Boolean): Tells the operator to not delete cert secrets when a cluster is deleted
4243
- use-ssl: Use SSL for communication with the cluster and inside the cluster. Default value is true.
@@ -113,6 +114,7 @@ spec:
113114
client-node-replicas: 3
114115
data-node-replicas: 3
115116
data-volume-size: 10Gi
117+
master-volume-size: 10Gi
116118
java-options: -Xms256m -Xmx256m
117119
master-node-replicas: 2
118120
image-pull-secrets:
@@ -281,6 +283,7 @@ spec:
281283
client-node-replicas: 3
282284
data-node-replicas: 3
283285
data-volume-size: 10Gi
286+
master-volume-size: 10Gi
284287
java-options: -Xms256m -Xmx256m
285288
master-node-replicas: 2
286289
snapshot:

example/example-es-cluster-azure.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ spec:
1010
network-host: 0.0.0.0
1111
zones: []
1212
data-volume-size: 10Gi
13+
master-volume-size: 10Gi
1314
java-options: "-Xms1024m -Xmx1024m"
1415
snapshot:
1516
scheduler-enabled: false

example/example-es-cluster-gke.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ spec:
1515
zones:
1616
- us-east1-d
1717
data-volume-size: 10Gi
18+
master-volume-size: 10Gi
1819
java-options: "-Xms512m -Xmx512m"
1920
snapshot:
2021
scheduler-enabled: false

example/example-es-cluster-hostpath.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ spec:
1414
network-host: 0.0.0.0
1515
zones: []
1616
data-volume-size: 10Gi
17+
master-volume-size: 10Gi
1718
java-options: "-Xms512m -Xmx512m"
1819
snapshot:
1920
scheduler-enabled: false

example/example-es-cluster-ibm.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ spec:
7171
- dal12
7272
- dal13
7373
data-volume-size: 10Gi
74+
master-volume-size: 10Gi
7475
java-options: "-Xms512m -Xmx512m"
7576
snapshot: # Not verified with IBM Cloud Object Storage
7677
scheduler-enabled: false

example/example-es-cluster-minikube.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ spec:
1717
network-host: 0.0.0.0
1818
zones: []
1919
data-volume-size: 10Gi
20+
master-volume-size: 10Gi
2021
java-options: "-Xms512m -Xmx512m"
2122
snapshot:
2223
scheduler-enabled: false

example/example-es-cluster-rook.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ spec:
1212
network-host: 0.0.0.0
1313
zones: []
1414
data-volume-size: 10Gi
15+
master-volume-size: 10Gi
1516
java-options: "-Xms256m -Xmx256m"
1617
snapshot:
1718
scheduler-enabled: false

example/example-es-cluster.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ spec:
1515
zones:
1616
- us-east-2b
1717
data-volume-size: 10Gi
18+
master-volume-size: 10Gi
1819
java-options: "-Xms512m -Xmx512m"
1920
snapshot:
2021
scheduler-enabled: false

pkg/apis/elasticsearchoperator/v1/cluster.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ type ClusterSpec struct {
9090
// to the data nodes in the ES cluster
9191
DataDiskSize string `json:"data-volume-size"`
9292

93+
// MasterDiskSize specifies how large the persistent volume should be attached
94+
// to the master nodes in the ES cluster
95+
MasterDiskSize string `json:"master-volume-size"`
96+
9397
// ElasticSearchImage specifies the docker image to use (optional)
9498
ElasticSearchImage string `json:"elastic-search-image"`
9599

pkg/processor/processor.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ func (p *Processor) refreshClusters() error {
161161
DataNodeReplicas: cluster.Spec.DataNodeReplicas,
162162
Zones: cluster.Spec.Zones,
163163
DataDiskSize: cluster.Spec.DataDiskSize,
164+
MasterDiskSize: cluster.Spec.MasterDiskSize,
164165
JavaOptions: cluster.Spec.JavaOptions,
165166
ClientJavaOptions: cluster.Spec.ClientJavaOptions,
166167
DataJavaOptions: cluster.Spec.DataJavaOptions,
@@ -396,7 +397,7 @@ func (p *Processor) processElasticSearchCluster(c *myspec.ElasticsearchCluster)
396397

397398
// Create Master Nodes
398399
for index, count := range zoneDistributionMaster {
399-
if err := p.k8sclient.CreateDataNodeDeployment("master", &count, baseImage, c.Spec.Zones[index], c.Spec.DataDiskSize, c.Spec.Resources,
400+
if err := p.k8sclient.CreateDataNodeDeployment("master", &count, baseImage, c.Spec.Zones[index], c.Spec.MasterDiskSize, c.Spec.Resources,
400401
c.Spec.ImagePullSecrets, c.Spec.ImagePullPolicy, c.Spec.ServiceAccountName, c.ObjectMeta.Name, c.Spec.Instrumentation.StatsdHost, c.Spec.NetworkHost,
401402
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 {
402403
logrus.Error("Error creating master node deployment ", err)
@@ -423,10 +424,9 @@ func (p *Processor) processElasticSearchCluster(c *myspec.ElasticsearchCluster)
423424

424425
// Create Master Nodes
425426
if err := p.k8sclient.CreateDataNodeDeployment("master", func() *int32 { i := int32(c.Spec.MasterNodeReplicas); return &i }(), baseImage, c.Spec.Storage.StorageClass,
426-
c.Spec.DataDiskSize, c.Spec.Resources, c.Spec.ImagePullSecrets, c.Spec.ImagePullPolicy, c.Spec.ServiceAccountName, c.ObjectMeta.Name,
427+
c.Spec.MasterDiskSize, c.Spec.Resources, c.Spec.ImagePullSecrets, c.Spec.ImagePullPolicy, c.Spec.ServiceAccountName, c.ObjectMeta.Name,
427428
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 {
428429
logrus.Error("Error creating master node deployment ", err)
429-
430430
return err
431431
}
432432

0 commit comments

Comments
 (0)