apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: clusterresourceoverride-operator
  name: clusterresourceoverride-operator
  labels:
    clusterresourceoverride.operator: "true"
spec:
  replicas: 1
  selector:
    matchLabels:
      clusterresourceoverride.operator: "true"
  template:
    metadata:
      name: clusterresourceoverride
      labels:
        clusterresourceoverride.operator: "true"
    spec:
      serviceAccountName: clusterresourceoverride-operator
      containers:
        - name: clusterresourceoverride-operator
          image: CLUSTERRESOURCEOVERRIDE_OPERATOR_IMAGE
          imagePullPolicy: Always
          command:
            - /usr/bin/cluster-resource-override-admission-operator
          args:
            - "start"
            - "--namespace=$(OPERAND_NAMESPACE)"
            - "--v=2"
          env:
            - name: OPERATOR_POD_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: OPERAND_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: OPERAND_IMAGE
              value: CLUSTERRESOURCEOVERRIDE_OPERAND_IMAGE
            - name: OPERAND_VERSION
              value: 1.0.0
          ports:
            - containerPort: 8080
          readinessProbe:
            httpGet:
              path: /healthz
              port: 8080
          livenessProbe:
            httpGet:
              path: /healthz
              port: 8080
            initialDelaySeconds: 5
