This repository has been archived by the owner on Dec 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 633
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #789 from rawmind0/master
Updated es-cluster package to work on rancher v1.6.15 and higher
- Loading branch information
Showing
12 changed files
with
542 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Elasticsearch Cluster | ||
|
||
A scalable Elasticsearch cluster | ||
|
||
WARN: To avoid vm.max_map_count errors you could set "Update host sysctl" to true. Then param vm.max_map_count will be update to 262144 if it's less in your hosts. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
version: '2' | ||
services: | ||
es-master: | ||
labels: | ||
io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} | ||
io.rancher.container.hostname_override: container_name | ||
io.rancher.sidekicks: es-master-storage{{- if eq .Values.UPDATE_SYSCTL "true" -}},es-sysctl{{- end}} | ||
image: docker.elastic.co/elasticsearch/elasticsearch:5.5.1 | ||
environment: | ||
- "cluster.name=${cluster_name}" | ||
- "node.name=$${HOSTNAME}" | ||
- "bootstrap.memory_lock=true" | ||
- "xpack.security.enabled=false" | ||
- "ES_JAVA_OPTS=-Xms${master_heap_size} -Xmx${master_heap_size}" | ||
- "discovery.zen.ping.unicast.hosts=es-master" | ||
- "discovery.zen.minimum_master_nodes=${minimum_master_nodes}" | ||
- "node.master=true" | ||
- "node.data=false" | ||
ulimits: | ||
memlock: | ||
soft: -1 | ||
hard: -1 | ||
nofile: | ||
soft: 65536 | ||
hard: 65536 | ||
mem_limit: ${master_mem_limit} | ||
mem_swappiness: 0 | ||
cap_add: | ||
- IPC_LOCK | ||
volumes_from: | ||
- es-master-storage | ||
|
||
es-master-storage: | ||
labels: | ||
io.rancher.container.start_once: true | ||
network_mode: none | ||
image: rawmind/alpine-volume:0.0.2-1 | ||
environment: | ||
- SERVICE_UID=1000 | ||
- SERVICE_GID=1000 | ||
- SERVICE_VOLUME=/usr/share/elasticsearch/data | ||
volumes: | ||
- es-master-volume:/usr/share/elasticsearch/data | ||
|
||
es-data: | ||
labels: | ||
io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} | ||
io.rancher.container.hostname_override: container_name | ||
io.rancher.sidekicks: es-data-storage{{- if eq .Values.UPDATE_SYSCTL "true" -}},es-sysctl{{- end}} | ||
image: docker.elastic.co/elasticsearch/elasticsearch:5.5.1 | ||
environment: | ||
- "cluster.name=${cluster_name}" | ||
- "node.name=$${HOSTNAME}" | ||
- "bootstrap.memory_lock=true" | ||
- "xpack.security.enabled=false" | ||
- "discovery.zen.ping.unicast.hosts=es-master" | ||
- "ES_JAVA_OPTS=-Xms${data_heap_size} -Xmx${data_heap_size}" | ||
- "node.master=false" | ||
- "node.data=true" | ||
ulimits: | ||
memlock: | ||
soft: -1 | ||
hard: -1 | ||
nofile: | ||
soft: 65536 | ||
hard: 65536 | ||
mem_limit: ${data_mem_limit} | ||
mem_swappiness: 0 | ||
cap_add: | ||
- IPC_LOCK | ||
volumes_from: | ||
- es-data-storage | ||
depends_on: | ||
- es-master | ||
|
||
es-data-storage: | ||
labels: | ||
io.rancher.container.start_once: true | ||
network_mode: none | ||
image: rawmind/alpine-volume:0.0.2-1 | ||
environment: | ||
- SERVICE_UID=1000 | ||
- SERVICE_GID=1000 | ||
- SERVICE_VOLUME=/usr/share/elasticsearch/data | ||
volumes: | ||
- es-data-volume:/usr/share/elasticsearch/data | ||
|
||
es-client: | ||
labels: | ||
io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} | ||
io.rancher.container.hostname_override: container_name | ||
io.rancher.sidekicks: es-client-storage{{- if eq .Values.UPDATE_SYSCTL "true" -}},es-sysctl{{- end}} | ||
image: docker.elastic.co/elasticsearch/elasticsearch:5.5.1 | ||
environment: | ||
- "cluster.name=${cluster_name}" | ||
- "node.name=$${HOSTNAME}" | ||
- "bootstrap.memory_lock=true" | ||
- "xpack.security.enabled=false" | ||
- "discovery.zen.ping.unicast.hosts=es-master" | ||
- "ES_JAVA_OPTS=-Xms${client_heap_size} -Xmx${client_heap_size}" | ||
- "node.master=false" | ||
- "node.data=false" | ||
ulimits: | ||
memlock: | ||
soft: -1 | ||
hard: -1 | ||
nofile: | ||
soft: 65536 | ||
hard: 65536 | ||
mem_limit: ${client_mem_limit} | ||
mem_swappiness: 0 | ||
cap_add: | ||
- IPC_LOCK | ||
volumes_from: | ||
- es-client-storage | ||
depends_on: | ||
- es-master | ||
|
||
es-client-storage: | ||
labels: | ||
io.rancher.container.start_once: true | ||
network_mode: none | ||
image: rawmind/alpine-volume:0.0.2-1 | ||
environment: | ||
- SERVICE_UID=1000 | ||
- SERVICE_GID=1000 | ||
- SERVICE_VOLUME=/usr/share/elasticsearch/data | ||
volumes: | ||
- es-client-volume:/usr/share/elasticsearch/data | ||
|
||
{{- if eq .Values.UPDATE_SYSCTL "true" }} | ||
es-sysctl: | ||
labels: | ||
io.rancher.container.start_once: true | ||
network_mode: none | ||
image: rawmind/alpine-sysctl:0.1 | ||
privileged: true | ||
environment: | ||
- "SYSCTL_KEY=vm.max_map_count" | ||
- "SYSCTL_VALUE=262144" | ||
{{- end}} | ||
|
||
volumes: | ||
es-master-volume: | ||
driver: ${VOLUME_DRIVER} | ||
per_container: true | ||
es-data-volume: | ||
driver: ${VOLUME_DRIVER} | ||
per_container: true | ||
es-client-volume: | ||
driver: ${VOLUME_DRIVER} | ||
per_container: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
version: '2' | ||
catalog: | ||
name: Elasticsearch Cluster | ||
version: 5.5.1-rancher2 | ||
description: Scalable Elasticsearch Cluster | ||
|
||
questions: | ||
- variable: "cluster_name" | ||
type: "string" | ||
required: true | ||
label: "Cluster name" | ||
description: "Name of the Elasticsearch Cluster" | ||
default: "es-cluster" | ||
|
||
- variable: "UPDATE_SYSCTL" | ||
label: "Update host sysctl:" | ||
description: | | ||
Set true to avoid vm.max_map_count errors. | ||
WARN: If set true, host param vm.max_map_count will be update to 262144. | ||
default: false | ||
required: true | ||
type: enum | ||
options: | ||
- false | ||
- true | ||
|
||
- variable: "master_heap_size" | ||
type: "string" | ||
required: true | ||
label: "Heap size (master nodes)" | ||
description: "Heap size to be allocated for Java (master nodes)" | ||
default: "512m" | ||
|
||
- variable: "master_mem_limit" | ||
type: "int" | ||
required: true | ||
label: "Memory limit in byte (master nodes)" | ||
description: "Memory limit in Byte per elasticsearch container. AT LEAST double the heap size! (master nodes)" | ||
default: 1073741824 | ||
|
||
- variable: "data_heap_size" | ||
type: "string" | ||
required: true | ||
label: "Heap size (data nodes)" | ||
description: "Heap size to be allocated for Java (data nodes)" | ||
default: "512m" | ||
|
||
- variable: "data_mem_limit" | ||
type: "int" | ||
required: true | ||
label: "Memory limit in byte (data nodes)" | ||
description: "Memory limit in Byte per elasticsearch container. AT LEAST double the heap size! (data nodes)" | ||
default: 1073741824 | ||
|
||
- variable: "client_heap_size" | ||
type: "string" | ||
required: true | ||
label: "Heap size (client nodes)" | ||
description: "Heap size to be allocated for Java (client nodes)" | ||
default: "512m" | ||
|
||
- variable: "client_mem_limit" | ||
type: "int" | ||
required: true | ||
label: "Memory limit in byte (client nodes)" | ||
description: "Memory limit in Byte per elasticsearch container. AT LEAST double the heap size! (client nodes)" | ||
default: 1073741824 | ||
|
||
- variable: "minimum_master_nodes" | ||
type: "int" | ||
required: true | ||
label: "# of minimum Master Nodes" | ||
description: "Set the number of required master nodes to reach quorum. Sets initial scale to this value as well" | ||
default: 3 | ||
|
||
- variable: "initial_data_nodes" | ||
type: "int" | ||
required: true | ||
label: "# of initial data nodes" | ||
description: "Set the initial number of data nodes" | ||
default: 2 | ||
|
||
- variable: "initial_client_nodes" | ||
type: "int" | ||
required: true | ||
label: "# of initial client nodes" | ||
description: "Set the initial number of client nodes" | ||
default: 1 | ||
|
||
- variable: "VOLUME_DRIVER" | ||
description: "The VOLUME driver to associate with this server" | ||
label: "VOLUME Driver" | ||
required: true | ||
default: "local" | ||
type: enum | ||
options: | ||
- local | ||
- rancher-nfs | ||
- rancher-efs | ||
- rancher-ebs | ||
|
||
services: | ||
|
||
es-master: | ||
scale: ${minimum_master_nodes} | ||
|
||
es-data: | ||
scale: ${initial_data_nodes} | ||
|
||
es-client: | ||
scale: ${initial_client_nodes} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Elasticsearch Cluster | ||
|
||
A scalable Elasticsearch cluster | ||
|
||
WARN: To avoid vm.max_map_count errors you could set "Update host sysctl" to true. Then param vm.max_map_count will be update to 262144 if it's less in your hosts. |
Oops, something went wrong.