Created
January 11, 2019 21:25
-
-
Save timfpark/0907199f5e7d8d41c5faa01793cbc54f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
apiVersion: apps/v1beta1 | |
kind: StatefulSet | |
metadata: | |
labels: | |
app: elasticsearch | |
chart: elasticsearch-1.17.0 | |
component: master | |
heritage: Tiller | |
release: elasticsearch | |
name: elasticsearch-master | |
namespace: elasticsearch | |
spec: | |
replicas: 3 | |
serviceName: elasticsearch-master | |
template: | |
metadata: | |
labels: | |
app: elasticsearch | |
component: master | |
release: elasticsearch | |
role: master | |
spec: | |
affinity: | |
podAntiAffinity: | |
preferredDuringSchedulingIgnoredDuringExecution: | |
- podAffinityTerm: | |
labelSelector: | |
matchLabels: | |
app: elasticsearch | |
component: master | |
release: elasticsearch | |
topologyKey: kubernetes.io/hostname | |
weight: 1 | |
containers: | |
- env: | |
- name: NODE_DATA | |
value: "false" | |
- name: DISCOVERY_SERVICE | |
value: elasticsearch-discovery | |
- name: PROCESSORS | |
valueFrom: | |
resourceFieldRef: | |
resource: limits.cpu | |
- name: ES_JAVA_OPTS | |
value: '-Djava.net.preferIPv4Stack=true -Xms512m -Xmx512m ' | |
- name: MINIMUM_MASTER_NODES | |
value: "2" | |
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.5.4 | |
imagePullPolicy: IfNotPresent | |
name: elasticsearch | |
ports: | |
- containerPort: 9300 | |
name: transport | |
readinessProbe: | |
httpGet: | |
path: /_cluster/health?local=true | |
port: 9200 | |
initialDelaySeconds: 5 | |
resources: | |
limits: | |
cpu: "1" | |
requests: | |
cpu: 25m | |
memory: 512Mi | |
volumeMounts: | |
- mountPath: /usr/share/elasticsearch/data | |
name: data | |
- mountPath: /usr/share/elasticsearch/config/elasticsearch.yml | |
name: config | |
subPath: elasticsearch.yml | |
initContainers: | |
- command: | |
- sysctl | |
- -w | |
- vm.max_map_count=262144 | |
image: busybox:latest | |
imagePullPolicy: Always | |
name: sysctl | |
resources: {} | |
securityContext: | |
privileged: true | |
- command: | |
- /bin/bash | |
- -c | |
- | | |
set -e; set -x; chown elasticsearch:elasticsearch /usr/share/elasticsearch/data; for datadir in $(find /usr/share/elasticsearch/data -mindepth 1 -maxdepth 1 -not -name ".snapshot"); do | |
chown -R elasticsearch:elasticsearch $datadir; | |
done; chown elasticsearch:elasticsearch /usr/share/elasticsearch/logs; for logfile in $(find /usr/share/elasticsearch/logs -mindepth 1 -maxdepth 1 -not -name ".snapshot"); do | |
chown -R elasticsearch:elasticsearch $logfile; | |
done | |
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.5.4 | |
imagePullPolicy: IfNotPresent | |
name: chown | |
resources: {} | |
securityContext: | |
runAsUser: 0 | |
volumeMounts: | |
- mountPath: /usr/share/elasticsearch/data | |
name: data | |
securityContext: | |
fsGroup: 1000 | |
serviceAccountName: elasticsearch-master | |
volumes: | |
- configMap: | |
name: elasticsearch | |
name: config | |
updateStrategy: | |
type: OnDelete | |
volumeClaimTemplates: | |
- metadata: | |
name: data | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: | |
storage: 4Gi | |
storageClassName: managed-premium | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment