apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: kube-system

secretGenerator:
  - name: elastic-agent-creds
    literals:
      - api_key=%API_KEY%

configMapGenerator:
- name: elastic-agent-configs
  literals:
  - host=%ES_HOST%
  - ca_trusted=%CA_TRUSTED%
  
resources:
  - ./base
  - https://github.com/kubernetes/kube-state-metrics/

patches:
- path: environmental-variables-remove.yaml
- target:
    group: apps
    version: v1
    kind: DaemonSet
    name: elastic-agent-standalone
  path: api-key-patch.yaml