You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.4 KiB

  1. ---
  2. apiVersion: apps/v1
  3. kind: ReplicaSet
  4. metadata:
  5. name: registry
  6. namespace: {{ registry_namespace }}
  7. labels:
  8. k8s-app: registry
  9. version: v{{ registry_image_tag }}
  10. addonmanager.kubernetes.io/mode: Reconcile
  11. spec:
  12. replicas: 1
  13. selector:
  14. matchLabels:
  15. k8s-app: registry
  16. version: v{{ registry_image_tag }}
  17. template:
  18. metadata:
  19. labels:
  20. k8s-app: registry
  21. version: v{{ registry_image_tag }}
  22. spec:
  23. priorityClassName: {% if registry_namespace == 'kube-system' %}system-cluster-critical{% else %}k8s-cluster-critical{% endif %}{{''}}
  24. serviceAccountName: registry
  25. containers:
  26. - name: registry
  27. image: {{ registry_image_repo }}:{{ registry_image_tag }}
  28. imagePullPolicy: {{ k8s_image_pull_policy }}
  29. env:
  30. - name: REGISTRY_HTTP_ADDR
  31. value: :{{ registry_port }}
  32. - name: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY
  33. value: /var/lib/registry
  34. volumeMounts:
  35. - name: registry-pvc
  36. mountPath: /var/lib/registry
  37. ports:
  38. - containerPort: {{ registry_port }}
  39. name: registry
  40. protocol: TCP
  41. volumes:
  42. - name: registry-pvc
  43. {% if registry_storage_class != "" %}
  44. persistentVolumeClaim:
  45. claimName: registry-pvc
  46. {% else %}
  47. emptyDir: {}
  48. {% endif %}