--- apiVersion: v1 kind: ConfigMap metadata: namespace: monitoring name: apm-server-config labels: app: apm-server data: apm-server.yml: |- apm-server: host: "0.0.0.0:8200" output.elasticsearch: hosts: ['${ELASTICSEARCH_HOST:elasticsearch}:${ELASTICSEARCH_PORT:9200}'] username: ${ELASTICSEARCH_USERNAME} password: ${ELASTICSEARCH_PASSWORD} setup.kibana: host: '${KIBANA_HOST:kibana}:${KIBANA_PORT:5601}' --- apiVersion: v1 kind: Service metadata: namespace: monitoring name: apm-server labels: app: apm-server spec: ports: - port: 8200 name: apm-server selector: app: apm-server --- apiVersion: extensions/v1beta1 kind: Deployment metadata: namespace: monitoring name: apm-server labels: app: apm-server spec: replicas: 1 template: metadata: labels: app: apm-server spec: containers: - name: apm-server image: docker.elastic.co/apm/apm-server:7.3.0 env: - name: ELASTICSEARCH_HOST value: elasticsearch-client.monitoring.svc.cluster.local - name: ELASTICSEARCH_PORT value: "9200" - name: ELASTICSEARCH_USERNAME value: elastic - name: ELASTICSEARCH_PASSWORD valueFrom: secretKeyRef: name: elasticsearch-pw-elastic key: password - name: KIBANA_HOST value: kibana.monitoring.svc.cluster.local - name: KIBANA_PORT value: "5601" ports: - containerPort: 8200 name: apm-server volumeMounts: - name: config mountPath: /usr/share/apm-server/apm-server.yml readOnly: true subPath: apm-server.yml volumes: - name: config configMap: name: apm-server-config ---