---
apiVersion: v1
kind: ConfigMap
metadata:
  name: kubemutator
  namespace: kube-system
data:
  config.yml: |
    ---
    annotationKey: kubemutator.example.com/requests

    strategies:
      - name: filebeat
        patches:
          # add filebeat sidecar
          - isTemplate: true
            data: |
              op: add
              path: /spec/containers/-
              value:
                name: filebeat
                image: myrepo/filebeat
                resources:
                  requests:
                    cpu: 100m
                    memory: 128Mi
                  limits:
                    cpu: 100m
                    memory: 128Mi
                volumeMounts:
                  - name: logs
                    mountPath: "/var/log/{{ .Pod.Labels.k8s-app }}"

    rules:
      - namespace:
          - default
        selector:
          matchLabels:
            k8s-app: myapp
        strategies:
          - filebeat
  kubemutator.crt: |
    -----BEGIN CERTIFICATE-----
    YOUR_CERTIFICATE_HERE
    -----END CERTIFICATE-----
  kubemutator.key: |
    -----BEGIN RSA PRIVATE KEY-----
    YOUR_PRIVATE_KEY_HERE
    -----END RSA PRIVATE KEY-----
