apiVersion: apps/v1
kind: Deployment
metadata:
  name: controller-manager
  namespace: system
  labels:
    control-plane: controller-manager
spec:
  selector:
    matchLabels:
      control-plane: controller-manager
  replicas: 1
  template:
    metadata:
      labels:
        control-plane: controller-manager
    spec:
      containers:
      - command:
        - /manager
        args:
        - --enable-leader-election
        image: xridge/kubestone:latest
        imagePullPolicy: Always
        name: manager
        resources:
          limits:
            cpu: 100m
            memory: 30Mi
          requests:
            cpu: 100m
            memory: 20Mi
        securityContext:
          readOnlyRootFilesystem: true
          runAsNonRoot: true
          allowPrivilegeEscalation: false
          capabilities:
            drop: ["all"]
        volumeMounts:
        - name: tmp
          mountPath: /tmp
      securityContext:
        fsGroup: 65534
        runAsUser: 65534
        runAsGroup: 65534
      terminationGracePeriodSeconds: 10
      serviceAccountName: "default"
      automountServiceAccountToken: true
      volumes:
      - name: tmp
        emptyDir:
          medium: "Memory"
