apiVersion: apps/v1
kind: Deployment
metadata:
  name: controller-manager
  namespace: system
  labels:
    control-plane: controller-manager
spec:
  selector:
    matchLabels:
      control-plane: controller-manager
  replicas: 1
  template:
    metadata:
      labels:
        control-plane: controller-manager
    spec:
      securityContext:
        runAsNonRoot: false
      containers:
      - command:
        - /opt/vcloud/bin/cluster-api-provider-cloud-director
        image: harbor-repo.vmware.com/vcloud/cluster-api-provider-cloud-director:main-branch
        name: manager
        securityContext:
          allowPrivilegeEscalation: false
        livenessProbe:
          httpGet:
            path: /healthz
            port: 8081
          initialDelaySeconds: 15
          periodSeconds: 20
        readinessProbe:
          httpGet:
            path: /readyz
            port: 8081
          initialDelaySeconds: 5
          periodSeconds: 10
        resources:
          limits:
            cpu: 1000m
            memory: 2048Mi
          requests:
            cpu: 100m
            memory: 512Mi
        volumeMounts:
          - name: controller-manager-config-volume
            mountPath: /etc/kubernetes/vcloud
          - name: controller-manager-vcloud-basic-auth-volume
            mountPath: /etc/kubernetes/vcloud/basic-auth
      volumes:
        - name: controller-manager-config-volume
          configMap:
            name: manager-config
        - name: controller-manager-vcloud-basic-auth-volume
          secret:
            secretName: vcloud-basic-auth
      serviceAccountName: controller-manager
      terminationGracePeriodSeconds: 10
