apiVersion: apps/v1
kind: Deployment
metadata:
  name: version-checker
  labels:
    app.kubernetes.io/name: version-checker
    helm.sh/chart: version-checker-v0.10.0
    app.kubernetes.io/instance: version-checker
    app.kubernetes.io/version: "v0.10.0"
    app.kubernetes.io/managed-by: Helm
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: version-checker
      app.kubernetes.io/instance: version-checker
  template:
    metadata:
      labels:
        app.kubernetes.io/name: version-checker
        helm.sh/chart: version-checker-v0.10.0
        app.kubernetes.io/instance: version-checker
        app.kubernetes.io/version: "v0.10.0"
        app.kubernetes.io/managed-by: Helm
      annotations:
        prometheus.io/path: "/metrics"
        prometheus.io/scrape: "true"
        prometheus.io/port: "8080"
        enable.version-checker.io/version-checker: "true"
    spec:
      serviceAccountName: version-checker
      containers:
        - name: version-checker
          image: "quay.io/jetstack/version-checker:v0.10.0@sha256:ea7a85422684479d0e51a41efc8edb12bed8f43aa89ab59dfea45aa92b2e8c8d"
          imagePullPolicy: IfNotPresent
          ports:
            - name: metrics
              containerPort: 8080
          command: ["version-checker"]
          args:
            - "--image-cache-timeout=30m"
            - "--log-level=info"
            - "--metrics-serving-address=0.0.0.0:8080"
            - "--test-all-containers=true"
          resources:
            requests:
              cpu: 1m
              memory: 400Mi
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - ALL
            readOnlyRootFilesystem: true
            runAsNonRoot: true
            runAsUser: 65534
            seccompProfile:
              type: RuntimeDefault
          livenessProbe:
            httpGet:
              path: /readyz
              port: 8080
            initialDelaySeconds: 3
            periodSeconds: 3
          readinessProbe:
            httpGet:
              path: /readyz
              port: 8080
            initialDelaySeconds: 3
            periodSeconds: 3
          env:
            - name: VERSION_CHECKER_SELFHOSTED_HOST_Harbor
              valueFrom:
                secretKeyRef:
                  name: version-checker
                  key: selfhosted.Harbor.host
            - name: VERSION_CHECKER_SELFHOSTED_HOST_Gitea
              valueFrom:
                secretKeyRef:
                  name: version-checker
                  key: selfhosted.Gitea.host
      volumes:
        - name: version-checker
          secret:
            secretName: version-checker
