apiVersion: apps/v1
kind: Deployment
metadata:
  name: autobackup-operator
  namespace: autobackup-operator
  labels:
    app: autobackup-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      app: autobackup-operator
  template:
    metadata:
      labels:
        app: autobackup-operator
    spec:
      serviceAccountName: autobackup-operator
      securityContext:
        runAsNonRoot: true
      containers:
        - name: operator
          image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/autobackup-operator:latest
          args:
            - --leader-elect
          env:
            - name: POD_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          ports:
            - name: metrics
              containerPort: 8080
            - name: probes
              containerPort: 8081
          livenessProbe:
            httpGet:
              path: /healthz
              port: probes
            initialDelaySeconds: 15
            periodSeconds: 20
          readinessProbe:
            httpGet:
              path: /readyz
              port: probes
            initialDelaySeconds: 5
            periodSeconds: 10
          securityContext:
            allowPrivilegeEscalation: false
            readOnlyRootFilesystem: true
            capabilities:
              drop: ["ALL"]
          resources:
            requests:
              memory: 128Mi
              cpu: 100m
            limits:
              memory: 512Mi
              cpu: "1"
