Skip to content
This repository was archived by the owner on Nov 7, 2018. It is now read-only.

adding configmaps #71

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Given this, I'm going to demonstrate how to provision a (near, as storage is sti
## (Very) Important notes

* By default, `ES_JAVA_OPTS` is set to `-Xms256m -Xmx256m`. This is a *very low* value but many users, i.e. `minikube` users, were having issues with pods getting killed because hosts were out of memory.
You can change this yourself in the deployment descriptors available in this repository.
You can change this yourself in the `es-config.yaml` ConfigMap available in this repository.

* As of the moment, Kubernetes pod descriptors use an `emptyDir` for storing data in each data node container. This is meant to be for the sake of simplicity and should be adapted according to your storage needs.

Expand All @@ -31,13 +31,17 @@ Providing your own version of [the images automatically built from this reposito
```
kubectl create -f es-discovery-svc.yaml
kubectl create -f es-svc.yaml
kubectl create -f es-config.yaml
kubectl create -f es-master-config.yaml
kubectl create -f es-master.yaml
```

Wait until `es-master` deployment is provisioned, and

```
kubectl create -f es-client-config.yaml
kubectl create -f es-client.yaml
kubectl create -f es-data-config.yaml
kubectl create -f es-data.yaml
```
Now, I leave up to you how to validate the cluster, but a first step is to wait for containers to be in the `Running` state and check Elasticsearch master logs:
Expand Down
8 changes: 8 additions & 0 deletions es-client-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: es-client-config
data:
NODE_MASTER: "false"
NODE_DATA: "false"
HTTP_ENABLE: "true"
29 changes: 22 additions & 7 deletions es-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,31 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: "CLUSTER_NAME"
value: "myesdb"
- name: CLUSTER_NAME
valueFrom:
configMapKeyRef:
name: es-config
key: CLUSTER_NAME
- name: ES_JAVA_OPTS
valueFrom:
configMapKeyRef:
name: es-config
key: ES_JAVA_OPTS
- name: NODE_MASTER
value: "false"
valueFrom:
configMapKeyRef:
name: es-client-config
key: NODE_MASTER
- name: NODE_DATA
value: "false"
valueFrom:
configMapKeyRef:
name: es-client-config
key: NODE_DATA
- name: HTTP_ENABLE
value: "true"
- name: "ES_JAVA_OPTS"
value: "-Xms256m -Xmx256m"
valueFrom:
configMapKeyRef:
name: es-client-config
key: HTTP_ENABLE
ports:
- containerPort: 9200
name: http
Expand Down
7 changes: 7 additions & 0 deletions es-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: es-config
data:
CLUSTER_NAME: "myesdb"
ES_JAVA_OPTS: "-Xms256m -Xmx256m"
8 changes: 8 additions & 0 deletions es-data-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: es-data-config
data:
NODE_MASTER: "false"
NODE_INGEST: "false"
HTTP_ENABLE: "false"
29 changes: 22 additions & 7 deletions es-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,31 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: "CLUSTER_NAME"
value: "myesdb"
- name: CLUSTER_NAME
valueFrom:
configMapKeyRef:
name: es-config
key: CLUSTER_NAME
- name: ES_JAVA_OPTS
valueFrom:
configMapKeyRef:
name: es-config
key: ES_JAVA_OPTS
- name: NODE_MASTER
value: "false"
valueFrom:
configMapKeyRef:
name: es-data-config
key: NODE_MASTER
- name: NODE_INGEST
value: "false"
valueFrom:
configMapKeyRef:
name: es-data-config
key: NODE_INGEST
- name: HTTP_ENABLE
value: "false"
- name: "ES_JAVA_OPTS"
value: "-Xms256m -Xmx256m"
valueFrom:
configMapKeyRef:
name: es-data-config
key: HTTP_ENABLE
ports:
- containerPort: 9300
name: transport
Expand Down
10 changes: 10 additions & 0 deletions es-master-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: es-master-config
data:
NUMBER_OF_MASTERS: "2"
NODE_MASTER: "true"
NODE_INGEST: "false"
NODE_DATA: "false"
HTTP_ENABLE: "false"
41 changes: 31 additions & 10 deletions es-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,41 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: "CLUSTER_NAME"
value: "myesdb"
- name: "NUMBER_OF_MASTERS"
value: "2"
- name: CLUSTER_NAME
valueFrom:
configMapKeyRef:
name: es-config
key: CLUSTER_NAME
- name: ES_JAVA_OPTS
valueFrom:
configMapKeyRef:
name: es-config
key: ES_JAVA_OPTS
- name: NUMBER_OF_MASTERS
valueFrom:
configMapKeyRef:
name: es-master-config
key: NUMBER_OF_MASTERS
- name: NODE_MASTER
value: "true"
valueFrom:
configMapKeyRef:
name: es-master-config
key: NODE_MASTER
- name: NODE_INGEST
value: "false"
valueFrom:
configMapKeyRef:
name: es-master-config
key: NODE_INGEST
- name: NODE_DATA
value: "false"
valueFrom:
configMapKeyRef:
name: es-master-config
key: NODE_DATA
- name: HTTP_ENABLE
value: "false"
- name: "ES_JAVA_OPTS"
value: "-Xms256m -Xmx256m"
valueFrom:
configMapKeyRef:
name: es-master-config
key: HTTP_ENABLE
ports:
- containerPort: 9300
name: transport
Expand Down