Skip to content

Instantly share code, notes, and snippets.

@coulof
Last active June 9, 2020 13:34
Show Gist options
  • Save coulof/a9c73d015facf180a70d3e9dee4bd101 to your computer and use it in GitHub Desktop.
Save coulof/a9c73d015facf180a70d3e9dee4bd101 to your computer and use it in GitHub Desktop.
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