apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/instance: flux-system
    control-plane: controller
  name: kustomize-controller
  namespace: flux-system
spec:
  replicas: 1
  selector:
    matchLabels:
      app: kustomize-controller
  template:
    metadata:
      annotations:
        prometheus.io/port: "8080"
        prometheus.io/scrape: "true"
      labels:
        app: kustomize-controller
    spec:
      containers:
        - args:
            - --watch-all-namespaces
            - --log-level=info
            - --log-encoding=json
            - --enable-leader-election
          env:
            - name: RUNTIME_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          image: fluxcd/kustomize-controller:v0.13.1
          imagePullPolicy: IfNotPresent
          livenessProbe:
            httpGet:
              path: /healthz
              port: healthz
          name: manager
          ports:
            - containerPort: 8080
              name: http-prom
            - containerPort: 9440
              name: healthz
              protocol: TCP
          readinessProbe:
            httpGet:
              path: /readyz
              port: healthz
          resources:
            limits:
              cpu: 1000m
              memory: 1Gi
            requests:
              cpu: 100m
              memory: 64Mi
          securityContext:
            allowPrivilegeEscalation: false
            readOnlyRootFilesystem: true
          volumeMounts:
            - mountPath: /tmp
              name: temp
      securityContext:
        fsGroup: 1337
      serviceAccountName: sa-kustomize-controller
      terminationGracePeriodSeconds: 60
      volumes:
        - emptyDir: { }
          name: temp
