apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: monitoring-es
  labels:
    component: monitoring-es-cluster
spec:
  replicas: 3
  template:
    metadata:
      labels:
        component: monitoring-es-cluster
      annotations:
        # Elasticsearch uses a hybrid mmapfs / niofs directory by default to
        # store its indices. The default operating system limits on mmap counts
        # is likely to be too low, which may result in out of memory exceptions,
        # so we use vm.max_map_count=262144 to increase that value.
        pod.beta.kubernetes.io/init-containers: '[
          {
          "name": "sysctl",
            "image": "busybox",
            "imagePullPolicy": "IfNotPresent",
            "command": ["sysctl", "-w", "vm.max_map_count=262144"],
            "securityContext": {
              "privileged": true
            }
          }
        ]'
    spec:
      containers:
      - name: monitoring-es
        securityContext:
          capabilities:
            add:
              - IPC_LOCK
              - SYS_RESOURCE
        image: "jpmeagher/playground:docker-elasticsearch-kubernetes-5.6.1"
        imagePullPolicy: Always
        env:
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: NODE_DATA
          value: "true"
        - name: NODE_MASTER
          value: "true"
        - name: HTTP_ENABLE
          value: "true"
        - name: DISCOVERY_SERVICE
          value: "monitoring-es-discovery"
        - name: ES_JAVA_OPTS
          value: "-Xms256m -Xmx256m"
        ports:
        - containerPort: 9300
          name: transport
          protocol: TCP
        - containerPort: 9200
          name: http
          protocol: TCP
        volumeMounts:
        - name: monitoring-storage
          mountPath: /mon-data
      volumes:
        - emptyDir:
            medium: ""
          name: "monitoring-storage"

Add an initial setup for a separate monitoring cluster
Add an initial setup for a separate monitoring cluster
