# Copyright (C) 2019, Wazuh Inc.
#
# This program is a free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public
# License (version 2) as published by the FSF - Free Software
# Foundation.

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

# Adds wazuh namespace to all resources.
namespace: wazuh

secretGenerator:
  - name: indexer-certs
    files:
      - wazuh-certificates/root-ca.pem
      - wazuh-certificates/indexer.pem
      - wazuh-certificates/indexer-key.pem
      - wazuh-certificates/dashboard.pem
      - wazuh-certificates/dashboard-key.pem
      - wazuh-certificates/admin.pem
      - wazuh-certificates/admin-key.pem
      - wazuh-certificates/server.pem
      - wazuh-certificates/server-key.pem
  - name: dashboard-certs
    files:
      - wazuh-certificates/dashboard.pem
      - wazuh-certificates/dashboard-key.pem
      - wazuh-certificates/root-ca.pem

resources:
  - base/wazuh-ns.yaml
  - base/storage-class.yaml
  - base/wazuh-ingress.yaml
  - base/Allow-DNS-np.yaml
  - base/default-deny-all.yaml

  - secrets/wazuh-api-cred-secret.yaml
  - secrets/wazuh-authd-pass-secret.yaml
  - secrets/wazuh-cluster-key-secret.yaml
  - secrets/dashboard-cred-secret.yaml
  - secrets/indexer-cred-secret.yaml

  - wazuh_managers/wazuh-cluster-svc.yaml
  - wazuh_managers/wazuh-events-svc.yaml
  - wazuh_managers/wazuh-registration-svc.yaml
  - wazuh_managers/wazuh-api-svc.yaml
  - wazuh_managers/wazuh-master-sts.yaml
  - wazuh_managers/wazuh-worker-sts.yaml
  - wazuh_managers/manager-egress.yaml
  - wazuh_managers/manager-egress-external.yaml
  - wazuh_managers/wazuh-master-ingress.yaml
  - wazuh_managers/wazuh-worker-egress.yaml

  - indexer_stack/wazuh-indexer/indexer-svc.yaml
  - indexer_stack/wazuh-indexer/indexer-egress.yaml
  - indexer_stack/wazuh-indexer/indexer-ingress.yaml
  - indexer_stack/wazuh-indexer/cluster/indexer-sts.yaml

  - indexer_stack/wazuh-dashboard/dashboard-deploy.yaml
  - indexer_stack/wazuh-dashboard/dashboard-svc.yaml
  - indexer_stack/wazuh-dashboard/dashboard-egress.yaml
