apiVersion: apps/v1
kind: Deployment
metadata:
  name: medusa-operator
  labels:
    control-plane: medusa-operator
spec:
  selector:
    matchLabels:
      control-plane: medusa-operator
  replicas: 1
  template:
    metadata:
      labels:
        control-plane: medusa-operator
    spec:
      containers:
      - command:
        - /manager
        args:
        - --leader-elect
        image: controller:latest
        name: manager
        imagePullPolicy: Always
        env:
          - name: WATCH_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
        livenessProbe:
          httpGet:
            path: /healthz
            port: 8081
          initialDelaySeconds: 15
          periodSeconds: 20
        readinessProbe:
          httpGet:
            path: /readyz
            port: 8081
          initialDelaySeconds: 5
          periodSeconds: 10
        resources:
          limits:
            cpu: 100m
            memory: 30Mi
          requests:
            cpu: 100m
            memory: 20Mi
      serviceAccountName: controller-manager
      terminationGracePeriodSeconds: 10
