Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.16 KB | None | 0 0
  1. apiVersion: apps/v1
  2. kind: StatefulSet
  3. metadata:
  4.   name: es-cluster
  5.   namespace: kube-logging
  6. spec:
  7.   serviceName: elasticsearch
  8.   replicas: 1
  9.   selector:
  10.     matchLabels:
  11.       app: elasticsearch
  12.   template:
  13.     metadata:
  14.       labels:
  15.         app: elasticsearch
  16.     spec:
  17.       containers:
  18.       - name: elasticsearch
  19.         image: docker.elastic.co/elasticsearch/elasticsearch:7.2.0
  20.         resources:
  21.             limits:
  22.               cpu: 1000m
  23.             requests:
  24.               cpu: 100m
  25.         ports:
  26.         - containerPort: 9200
  27.           name: rest
  28.           protocol: TCP
  29.         - containerPort: 9300
  30.           name: inter-node
  31.           protocol: TCP
  32.         volumeMounts:
  33.         - name: data
  34.           mountPath: /usr/share/elasticsearch/data
  35.         env:
  36.           - name: cluster.name
  37.             value: k8s-logs
  38.           - name: node.name
  39.             valueFrom:
  40.               fieldRef:
  41.                 fieldPath: metadata.name
  42.           - name: discovery.seed_hosts
  43.             value: "es-cluster-0.elasticsearch,es-cluster-1.elasticsearch,es-cluster-2.elasticsearch"
  44.           - name: cluster.initial_master_nodes
  45.             value: "es-cluster-0,es-cluster-1,es-cluster-2"
  46.           - name: ES_JAVA_OPTS
  47.             value: "-Xms512m -Xmx512m"
  48.       initContainers:
  49.       - name: fix-permissions
  50.         image: busybox
  51.         command: ["sh", "-c", "chown -R 1000:1000 /usr/share/elasticsearch/data"]
  52.         securityContext:
  53.           privileged: true
  54.         volumeMounts:
  55.         - name: data
  56.           mountPath: /usr/share/elasticsearch/data
  57.       - name: increase-vm-max-map
  58.         image: busybox
  59.         command: ["sysctl", "-w", "vm.max_map_count=262144"]
  60.         securityContext:
  61.           privileged: true
  62.       - name: increase-fd-ulimit
  63.         image: busybox
  64.         command: ["sh", "-c", "ulimit -n 65536"]
  65.         securityContext:
  66.           privileged: true
  67.   volumeClaimTemplates:
  68.   - metadata:
  69.       name: data
  70.       labels:
  71.         app: elasticsearch
  72.     spec:
  73.       accessModes: [ "ReadWriteOnce" ]
  74.       storageClassName: do-block-storage
  75.       resources:
  76.         requests:
  77.           storage: 5Gi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement