apiVersion: apps/v1
kind: Deployment
metadata:
  name: vm-operator
  labels:
    app.kubernetes.io/name: vm-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: vm-operator
      app.kubernetes.io/component: manager
  template:
    metadata:
      name: vm-operator
      labels:
        app.kubernetes.io/name: vm-operator
        app.kubernetes.io/component: manager
    spec:
      containers:
        - name: vm-operator
          image: >-
            ghcr.io/mnlipp/org.jdrupes.vmoperator.manager:latest
          volumeMounts:
            - name: config
              mountPath: /etc/opt/vmoperator
            - name: vmop-image-repository
              mountPath: /var/local/vmop-image-repository
          imagePullPolicy: Always
          securityContext:
            capabilities:
              drop:
                - ALL
            readOnlyRootFilesystem: true
            allowPrivilegeEscalation: false
          resources:
            requests:
              cpu: 100m
              memory: 128Mi
      volumes:
      - name: config
        configMap:
          name: vm-operator
      - name: vmop-image-repository
        persistentVolumeClaim:
          claimName: vmop-image-repository
      nodeSelector:
        kubernetes.io/os: linux
      serviceAccountName: vm-operator
      securityContext:
        runAsUser: 65534
        runAsNonRoot: true
