apiVersion: apps/v1
kind: Deployment
metadata:
  name: docker-registry
  labels:
    app: docker-registry
spec:
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: docker-registry
  template:
    metadata:
      labels:
        app: docker-registry
      annotations:
        prometheus.io/scrape: 'true'
        prometheus.io/path: /metrics
        prometheus.io/port: '8080'
    spec:
      containers:
      - name: docker-registry
        image: registry:2.7.1
        env:
          - name: REGISTRY_HTTP_DEBUG_PROMETHEUS_ENABLED
            value: "true"
          - name: REGISTRY_HTTP_DEBUG_ADDR
            value: :8080
          - name: REGISTRY_HTTP_ADDR
            value: :5000
          - name: REGISTRY_HTTP_HOST
            value: https://registry.homelab.dsb.dev
          - name: REGISTRY_HTTP_PREFIX
            value: /
          - name: REGISTRY_PROXY_REMOTEURL
            value: https://registry-1.docker.io
        volumeMounts:
          - mountPath: /var/lib/registry
            name: images
        readinessProbe:
          tcpSocket:
            port: 5000
        resources:
          limits:
            memory: 1Gi
      volumes:
        - name: images
          persistentVolumeClaim:
            claimName: docker-registry
