{{ if ne .Environment "production" }}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: kube-janitor
  namespace: kube-system
  labels:
    application: kube-janitor
    version: v0.2.2
spec:
  replicas: 1
  selector:
    matchLabels:
      application: kube-janitor
  template:
    metadata:
      labels:
        application: kube-janitor
        version: v0.2.2
    spec:
      dnsConfig:
        options:
          - name: ndots
            value: "1"
      serviceAccountName: system
      containers:
      - name: janitor
        # see https://github.com/hjacobs/kube-janitor/releases
        image: registry.opensource.zalan.do/teapot/kube-janitor:0.2.2
        args:
          # run every minute
          - --interval=60
          # do not touch system/infra namespaces
          - --exclude-namespaces=kube-system,visibility
          - --rules-file=/config/rules.yaml
        resources:
          limits:
            cpu: 5m
            memory: 150Mi
          requests:
            # this is a background app ==> low priority, low CPU requests
            cpu: 5m
            memory: 150Mi
        securityContext:
          readOnlyRootFilesystem: true
          runAsNonRoot: true
          runAsUser: 1000
        volumeMounts:
          - name: config-volume
            mountPath: /config
      volumes:
      - name: config-volume
        configMap:
          name: kube-janitor
{{ end }}

{{ if ne .Environment "production" }}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: kube-janitor
  namespace: kube-system
  labels:
    application: kube-janitor
    version: v0.2.2
spec:
  replicas: 1
  selector:
    matchLabels:
      application: kube-janitor
  template:
    metadata:
      labels:
        application: kube-janitor
        version: v0.2.2
    spec:
      dnsConfig:
        options:
          - name: ndots
            value: "1"
      priorityClassName: system-cluster-critical
      serviceAccountName: system
      containers:
      - name: janitor
        # see https://github.com/hjacobs/kube-janitor/releases
        image: registry.opensource.zalan.do/teapot/kube-janitor:0.2.2
        args:
          # run every minute
          - --interval=60
          # do not touch system/infra namespaces
          - --exclude-namespaces=kube-system,visibility
          - --rules-file=/config/rules.yaml
        resources:
          limits:
            cpu: 5m
            memory: 150Mi
          requests:
            # this is a background app ==> low priority, low CPU requests
            cpu: 5m
            memory: 150Mi
        securityContext:
          readOnlyRootFilesystem: true
          runAsNonRoot: true
          runAsUser: 1000
        volumeMounts:
          - name: config-volume
            mountPath: /config
      volumes:
      - name: config-volume
        configMap:
          name: kube-janitor
{{ end }}

Add a missing priority class
Add a missing priority class

Signed-off-by: Alexey Ermakov <6610c7e1c26fb4c3222ac4f760cb43a9f3c01622@zalando.de>
Signed-off-by: njuettner <75ef9faee755c70589550b513ad881e5a603182c@zalando.de>
