Skip to content

Commit

Permalink
Distribute ES pods accross the cluster and added es-client probes
Browse files Browse the repository at this point in the history
  • Loading branch information
kayrus committed Jan 2, 2017
1 parent ef4b37d commit 12331a8
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 8 deletions.
30 changes: 28 additions & 2 deletions es-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ spec:
labels:
component: elasticsearch
role: client
annotations:
scheduler.alpha.kubernetes.io/affinity: |
{
"podAntiAffinity": {
"requiredDuringSchedulingIgnoredDuringExecution": [
{
"labelSelector": {
"matchLabels": {
"component": "elasticsearch",
"role": "client"
}
},
"topologyKey": "kubernetes.io/hostname"
}
]
}
}
spec:
containers:
- name: es-client
Expand All @@ -30,10 +47,19 @@ spec:
- /run.sh
- -Des.path.conf=/etc/elasticsearch
readinessProbe:
tcpSocket:
port: 9300
httpGet:
path: /
port: 9200
scheme: HTTP
timeoutSeconds: 1
successThreshold: 3
livenessProbe:
httpGet:
path: /_cluster/health
port: 9200
scheme: HTTP
initialDelaySeconds: 360
timeoutSeconds: 2
imagePullPolicy: Always
env:
- name: NAMESPACE
Expand Down
18 changes: 18 additions & 0 deletions es-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,24 @@ spec:
component: elasticsearch
role: master
master: 'true'
annotations:
scheduler.alpha.kubernetes.io/affinity: |
{
"podAntiAffinity": {
"requiredDuringSchedulingIgnoredDuringExecution": [
{
"labelSelector": {
"matchLabels": {
"component": "elasticsearch",
"role": "master",
"master": "true"
}
},
"topologyKey": "kubernetes.io/hostname"
}
]
}
}
spec:
containers:
- name: es-master
Expand Down
30 changes: 28 additions & 2 deletions es5/es-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ spec:
labels:
component: elasticsearch
role: client
annotations:
scheduler.alpha.kubernetes.io/affinity: |
{
"podAntiAffinity": {
"requiredDuringSchedulingIgnoredDuringExecution": [
{
"labelSelector": {
"matchLabels": {
"component": "elasticsearch",
"role": "client"
}
},
"topologyKey": "kubernetes.io/hostname"
}
]
}
}
spec:
containers:
- name: es-client
Expand All @@ -30,10 +47,19 @@ spec:
- /run.sh
- -Epath.conf=/etc/elasticsearch
readinessProbe:
tcpSocket:
port: 9300
httpGet:
path: /
port: 9200
scheme: HTTP
timeoutSeconds: 1
successThreshold: 3
livenessProbe:
httpGet:
path: /_cluster/health
port: 9200
scheme: HTTP
initialDelaySeconds: 360
timeoutSeconds: 2
imagePullPolicy: Always
env:
- name: NAMESPACE
Expand Down
18 changes: 18 additions & 0 deletions es5/es-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,24 @@ spec:
component: elasticsearch
role: master
master: 'true'
annotations:
scheduler.alpha.kubernetes.io/affinity: |
{
"podAntiAffinity": {
"requiredDuringSchedulingIgnoredDuringExecution": [
{
"labelSelector": {
"matchLabels": {
"component": "elasticsearch",
"role": "master",
"master": "true"
}
},
"topologyKey": "kubernetes.io/hostname"
}
]
}
}
spec:
containers:
- name: es-master
Expand Down
3 changes: 1 addition & 2 deletions es5/undeploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ service/elasticsearch
service/elasticsearch-discovery
service/kibana
service/cerebro
configmap/es-env
configmap/es-config"
configmap/es-env"

for instance in ${INSTANCES}; do
eval "${KUBECTL} delete --ignore-not-found --now \"${instance}\""
Expand Down
3 changes: 1 addition & 2 deletions undeploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ service/elasticsearch-logging
service/elasticsearch-discovery
service/kibana-logging
configmap/es-env
configmap/fluentd-config
configmap/es-config"
configmap/fluentd-config"

for instance in ${INSTANCES}; do
eval "${KUBECTL} delete --ignore-not-found --now \"${instance}\""
Expand Down

0 comments on commit 12331a8

Please sign in to comment.