Skip to content

Instantly share code, notes, and snippets.

@coulof
Last active Jun 9, 2020
Embed
What would you like to do?
configmap and secrets
apiVersion: v1
kind: ConfigMap
metadata:
name: event-exporter-cfg
namespace: {{ .Release.Namespace }}
data:
config.yaml.erb: |
route:
match:
- receiver: "dump"
receivers:
- name: "dump"
elasticsearch:
hosts:
- https://{{ .Release.Name }}-es-http:9200
index: kube-events
username: elastic
password: <%= ENV['ES_PASSWORD'] %>
apiVersion: apps/v1
kind: Deployment
metadata:
name: event-exporter
spec:
replicas: 1
spec:
serviceAccountName: event-exporter
initContainers:
- name: config
image: "ruby:2.7-slim"
command: ['sh', '-c', 'erb /tmpl/config.yaml.erb > /data/config.yaml']
volumeMounts:
- name: cfgtmpl
mountPath: /tmpl
- name: configdir
mountPath: /data
env:
- name: ES_PASSWORD
valueFrom:
secretKeyRef:
name: quickstart-es-elastic-user
key: elastic
containers:
- name: event-exporter
image: opsgenie/kubernetes-event-exporter:0.7
imagePullPolicy: IfNotPresent
args:
- -conf=/data/config.yaml
volumeMounts:
- mountPath: /data
name: configdir
volumes:
- name: cfgtmpl
configMap:
name: event-exporter-cfg
- name: configdir
emptyDir: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment