apiVersion: apps/v1
kind: Deployment
metadata:
  name: kcp-glbc-controller-manager
  labels:
    app.kubernetes.io/name: kcp-glbc
    app.kubernetes.io/component: controller-manager
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: kcp-glbc
      app.kubernetes.io/component: controller-manager
  replicas: 1
  strategy:
    type: Recreate
  template:
    metadata:
      annotations:
        kubectl.kubernetes.io/default-container: manager
      labels:
        app.kubernetes.io/name: kcp-glbc
        app.kubernetes.io/component: controller-manager
    spec:
      securityContext:
        runAsNonRoot: true
      containers:
        - command:
            - /kcp-glbc
          args:
            - --kubeconfig=/tmp/kcp/kubeconfig
          image: controller:latest
          name: manager
          securityContext:
            allowPrivilegeEscalation: false
          envFrom:
            - secretRef:
                name: aws-credentials
                optional: true
            - configMapRef:
                name: controller-config
                optional: true
          ports:
            - name: metrics
              containerPort: 8080
              protocol: TCP
          resources:
            limits:
              cpu: 500m
              memory: 128Mi
            requests:
              cpu: 10m
              memory: 64Mi
          volumeMounts:
            - name: kcp-kubeconfig
              mountPath: "/tmp/kcp"
              readOnly: true
      serviceAccountName: kcp-glbc-controller-manager
      terminationGracePeriodSeconds: 10
      volumes:
        - name: kcp-kubeconfig
          secret:
            secretName: kcp-kubeconfig
            optional: false
