Skip to content

Instantly share code, notes, and snippets.

@kotarusv
Created October 10, 2018 21:24
Show Gist options
  • Select an option

  • Save kotarusv/2f521544c83af0305f57183ac6d096fe to your computer and use it in GitHub Desktop.

Select an option

Save kotarusv/2f521544c83af0305f57183ac6d096fe to your computer and use it in GitHub Desktop.
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: es-k8s-logging
namespace: kube-instrumentation
spec:
serviceName: "es"
replicas: 1
selector:
matchLabels:
app: elasticsearch
function: logging
template:
metadata:
labels:
app: elasticsearch
function: logging
spec:
initContainers:
- name: volume-mount-hack
image: busybox
command: ["sh", "-c", "chown -R 1000:100 /usr/share/elasticsearch/data"]
volumeMounts:
- name: data
mountPath: /usr/share/elasticsearch/data
containers:
- name: elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:5.5.1
command: ["bin/elasticsearch"]
args: ["-Ehttp.host=0.0.0.0", "-Etransport.host=127.0.0.1", "-Ecluster.name=kubernetes", "-Ebootstrap.memory_lock=true"]
env:
- name: ES_JAVA_OPTS
value: "-Xms512m -Xmx512m"
ports:
- containerPort: 9200
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 5Gi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment