Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #141 from satchpx/master
Browse files Browse the repository at this point in the history
add capability to specify alternalte scheduler
  • Loading branch information
Crazybus committed Jun 7, 2019
2 parents 240ee9e + e5d888a commit 51ab321
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions elasticsearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ helm install --name elasticsearch elastic/elasticsearch --version 7.1.1 --set im
| `nodeSelector` | Configurable [nodeSelector](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) so that you can target specific nodes for your Elasticsearch cluster | `{}` |
| `tolerations` | Configurable [tolerations](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) | `[]` |
| `ingress` | Configurable [ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/) to expose the Elasticsearch service. See [`values.yaml`](./values.yaml) for an example | `enabled: false` |
| `schedulerName` | Name of the [alternate scheduler](https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/#specify-schedulers-for-pods) | `nil` |

## Try it out

Expand Down
3 changes: 3 additions & 0 deletions elasticsearch/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ spec:
configchecksum: {{ include (print .Template.BasePath "/configmap.yaml") . | sha256sum | trunc 63 }}
{{- end }}
spec:
{{- if .Values.schedulerName }}
schedulerName: "{{ .Values.schedulerName }}"
{{- end }}
securityContext:
fsGroup: {{ .Values.fsGroup }}
{{- with .Values.tolerations }}
Expand Down
12 changes: 12 additions & 0 deletions elasticsearch/tests/elasticsearch_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,3 +569,15 @@ def test_priority_class_name():
r = helm_template(config)
priority_class_name = r['statefulset'][uname]['spec']['template']['spec']['priorityClassName']
assert priority_class_name == "highest"


def test_scheduler_name():
r = helm_template('')
spec = r['statefulset'][uname]['spec']['template']['spec']
assert 'schedulerName' not in spec

config = '''
schedulerName: "stork"
'''
r = helm_template(config)
assert r['statefulset'][uname]['spec']['template']['spec']['schedulerName'] == "stork"
5 changes: 5 additions & 0 deletions elasticsearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ readinessProbe:
# https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html#request-params wait_for_status
clusterHealthCheckParams: "wait_for_status=green&timeout=1s"

## Use an alternate scheduler.
## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
##
schedulerName: ""

imagePullSecrets: []
nodeSelector: {}
tolerations: []
Expand Down

0 comments on commit 51ab321

Please sign in to comment.