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

resources:
  - ../../base
  - tidb-sa.yaml
  # tls resources
  - cert.yaml
  - ./resource-manager

patches:
  - path: scaler.yaml
  - path: resource-manager/role.yaml
  - path: resource-manager/cluster_role.yaml
  - target:
      group: apps
      version: v1
      kind: Deployment
      name: scaler
    path: scaler_args.yaml

configMapGenerator:
  - name: scaler-config
    behavior: merge
    files:
      # Startup script
      - startup-script=startup-script.sh
      - dxf.startup-script=dxf-startup-script.sh

      # TiDB Config
      - dxf.config-file=config-file/dxf.toml

      # TiDB Resource
      - tidb-resources=tidb-resources/small.yaml # defaults to small
      - batch.tidb-resources=tidb-resources/large.yaml
      - ddl.tidb-resources=tidb-resources/large.yaml
      - import-into.tidb-resources=tidb-resources/xlarge.yaml
      - remote-query.tidb-resources=tidb-resources/large.yaml
      - shared.tidb-resources=tidb-resources/xlarge.yaml
      - dxf.tidb-resources=tidb-resources/xlarge.yaml
