Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
example apm server kubectl file
---
apiVersion: v1
kind: ConfigMap
metadata:
name: apm-server-config
labels:
k8s-app: apm-server
data:
apm-server.yml: |-
apm-server:
host: "0.0.0.0:8200"
frontend:
enabled: false
setup.template.settings:
index:
number_of_shards: 1
codec: best_compression
setup.dashboards.enabled: true
setup.kibana.host: "http://mykibana:5601"
output.elasticsearch:
hosts: ["http://elasticsearch:9200"]
indices:
- index: "apm-%{[beat.version]}-sourcemap"
when.contains:
processor.event: "sourcemap"
- index: "apm-%{[beat.version]}-error-%{+yyyy.MM.dd}"
when.contains:
processor.event: "error"
- index: "apm-%{[beat.version]}-transaction-%{+yyyy.MM.dd}"
when.contains:
processor.event: "transaction"
- index: "apm-%{[beat.version]}-span-%{+yyyy.MM.dd}"
when.contains:
processor.event: "span"
processors:
- add_cloud_metadata: ~
- add_kubernetes_metadata:
in_cluster: true
default_indexers.enabled: true
default_matchers.enabled: true
indexers:
- ip_port:
matchers:
- fields:
lookup_fields: ["metricset.host"]
---
apiVersion: v1
kind: Service
metadata:
name: apm-server
labels:
app: apm-server
spec:
ports:
- port: 8200
targetPort: 8200
name: http
nodePort: 31000
selector:
app: apm-server
type: NodePort
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: apm-server
spec:
# this replicas value is default
# modify it according to your case
replicas: 1
template:
metadata:
labels:
app: apm-server
spec:
containers:
- name: apm-server
image: docker.elastic.co/apm/apm-server:6.6.0
ports:
- containerPort: 8200
name: apm-port
volumeMounts:
- name: apm-server-config
mountPath: /usr/share/apm-server/apm-server.yml
readOnly: true
subPath: apm-server.yml
volumes:
- name: apm-server-config
configMap:
name: apm-server-config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment