--- apiVersion: v1 kind: ConfigMap metadata: namespace: monitoring name: elasticsearch-master-config labels: app: elasticsearch role: master data: elasticsearch.yml: |- cluster.name: ${CLUSTER_NAME} node.name: ${NODE_NAME} discovery.seed_hosts: ${NODE_LIST} cluster.initial_master_nodes: ${MASTER_NODES} network.host: 0.0.0.0 node: master: true data: false ingest: false xpack.security.enabled: true xpack.monitoring.collection.enabled: true --- apiVersion: v1 kind: Service metadata: namespace: monitoring name: elasticsearch-master labels: app: elasticsearch role: master spec: ports: - port: 9300 name: transport selector: app: elasticsearch role: master --- apiVersion: apps/v1 kind: Deployment metadata: namespace: monitoring name: elasticsearch-master labels: app: elasticsearch role: master spec: replicas: 1 selector: matchLabels: app: elasticsearch role: master template: metadata: labels: app: elasticsearch role: master spec: containers: - name: elasticsearch-master image: docker.elastic.co/elasticsearch/elasticsearch:7.3.0 env: - name: CLUSTER_NAME value: elasticsearch - name: NODE_NAME value: elasticsearch-master - name: NODE_LIST value: elasticsearch-master,elasticsearch-data,elasticsearch-client - name: MASTER_NODES value: elasticsearch-master - name: "ES_JAVA_OPTS" value: "-Xms256m -Xmx256m" ports: - containerPort: 9300 name: transport volumeMounts: - name: config mountPath: /usr/share/elasticsearch/config/elasticsearch.yml readOnly: true subPath: elasticsearch.yml - name: storage mountPath: /data volumes: - name: config configMap: name: elasticsearch-master-config - name: "storage" emptyDir: medium: "" ---