apiVersion: apps/v1
kind: Deployment
metadata:
  name: source-watcher
  labels:
    control-plane: controller
spec:
  selector:
    matchLabels:
      app: source-watcher
  replicas: 1
  template:
    metadata:
      labels:
        app: source-watcher
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "8080"
    spec:
      terminationGracePeriodSeconds: 10
      containers:
        - name: manager
          image: source-watcher
          imagePullPolicy: IfNotPresent
          securityContext:
            allowPrivilegeEscalation: false
            readOnlyRootFilesystem: true
          ports:
            - containerPort: 8080
              name: http-prom
          env:
            - name: RUNTIME_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          args:
            - --log-level=info
            - --log-json
            - --enable-leader-election
          livenessProbe:
            httpGet:
              port: http
              path: /
          readinessProbe:
            httpGet:
              port: http
              path: /
          resources:
            limits:
              cpu: 1000m
              memory: 1Gi
            requests:
              cpu: 50m
              memory: 64Mi
          volumeMounts:
            - name: tmp
              mountPath: /tmp
      volumes:
        - name: tmp
          emptyDir: {}

