apiVersion: apps/v1
kind: Deployment
metadata:
  name: dm-controller
spec:
  template:
    spec:
      containers:
        - name: controller
          image: cp9.local/gcp-gke-provider:placeholder
          command:
            - /eks-provider
            - run-dm-controller
            - --infra-kubeconfig=/var/run/cp9/dedicated-api/cluster-controller.kubeconfig
            - --root-config=/etc/cluster-controller/main/root-config.yaml
            - --leader-elect=true
          env:
            - name: AWS_REGION
              value: __CP9_PRIMARY_AWS_REGION__
            - name: AWS_DEFAULT_REGION
              value: __CP9_PRIMARY_AWS_REGION__
            - name: AWS_ROLE_ARN
              value: __CP9_GCP_AWS_ROLE_ARN__
            - name: AWS_WEB_IDENTITY_TOKEN_FILE
              value: /var/run/cp9/aws-web-identity/token
          volumeMounts:
            - name: aws-web-identity
              mountPath: /var/run/cp9/aws-web-identity
              readOnly: true
      volumes:
        - name: aws-web-identity
          hostPath:
            path: __CP9_GCP_AWS_IDENTITY_DIR__
            type: Directory
