apiVersion: v1
kind: ReplicationController
metadata:
  name: es-data
  labels:
    component: elasticsearch
    role: data
spec:
  replicas: 1
  selector:
    component: elasticsearch
    role: data
  template:
    metadata:
      labels:
        component: elasticsearch
        role: data
    spec:
      serviceAccount: elasticsearch
      containers:
      - name: es-data
        securityContext:
          privileged: true
          capabilities:
            add:
              - IPC_LOCK
        image: larmog/elasticsearch-kubernetes-armhf:2.2.0
        env:
        - name: KUBERNETES_CA_CERTIFICATE_FILE
          value: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: "CLUSTER_NAME"
          value: "myesdb"
        - name: NODE_MASTER
          value: "false"
        - name: HTTP_ENABLE
          value: "false"
        ports:
        - containerPort: 9300
          name: transport
          protocol: TCP
        volumeMounts:
        - mountPath: /data
          name: storage
      volumes:
          - emptyDir:
              medium: ""
            name: "storage"
