apiVersion: apps/v1
kind: Deployment
metadata:
  name: image-automation-controller
  labels:
    control-plane: controller
spec:
  selector:
    matchLabels:
      app: image-automation-controller
  replicas: 1
  template:
    metadata:
      labels:
        app: image-automation-controller
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "8080"
    spec:
      terminationGracePeriodSeconds: 10
      # Required for AWS IAM Role bindings
      # https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts-technical-overview.html
      securityContext:
        fsGroup: 1337
      containers:
      - name: manager
        image: fluxcd/image-automation-controller
        imagePullPolicy: IfNotPresent
        securityContext:
          allowPrivilegeEscalation: false
          readOnlyRootFilesystem: true
          runAsNonRoot: true
          capabilities:
            drop: [ "ALL" ]
          seccompProfile:
            type: RuntimeDefault
        ports:
          - containerPort: 8080
            name: http-prom
          - containerPort: 9440
            name: healthz
            protocol: TCP
        env:
          - name: RUNTIME_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
        args:
        - --watch-all-namespaces
        - --log-level=info
        - --log-encoding=json
        - --enable-leader-election
        readinessProbe:
          httpGet:
            path: /readyz
            port: healthz
        livenessProbe:
          httpGet:
            path: /healthz
            port: healthz
        resources:
          limits:
            cpu: 1000m
            memory: 1Gi
          requests:
            cpu: 100m
            memory: 64Mi
        volumeMounts:
          - name: temp
            mountPath: /tmp
      volumes:
        - name: temp
          emptyDir: {}
