_persistence.tpl 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. {{- define "distribution.persistence" -}}
  2. persistence:
  3. {{- if .Values.distributionStorage.useFilesystemBackend }}
  4. data:
  5. enabled: true
  6. type: {{ .Values.distributionStorage.data.type }}
  7. datasetName: {{ .Values.distributionStorage.data.datasetName | default "" }}
  8. hostPath: {{ .Values.distributionStorage.data.hostPath | default "" }}
  9. targetSelector:
  10. distribution:
  11. distribution:
  12. mountPath: /var/lib/registry
  13. 01-permissions:
  14. mountPath: /mnt/directories/registry
  15. {{- end }}
  16. tmp:
  17. enabled: true
  18. type: emptyDir
  19. targetSelector:
  20. distribution:
  21. distribution:
  22. mountPath: /tmp
  23. {{- range $idx, $storage := .Values.distributionStorage.additionalStorages }}
  24. {{ printf "distribution-%v" (int $idx) }}:
  25. {{- $size := "" -}}
  26. {{- if $storage.size -}}
  27. {{- $size = (printf "%vGi" $storage.size) -}}
  28. {{- end }}
  29. enabled: true
  30. type: {{ $storage.type }}
  31. datasetName: {{ $storage.datasetName | default "" }}
  32. hostPath: {{ $storage.hostPath | default "" }}
  33. server: {{ $storage.server | default "" }}
  34. share: {{ $storage.share | default "" }}
  35. domain: {{ $storage.domain | default "" }}
  36. username: {{ $storage.username | default "" }}
  37. password: {{ $storage.password | default "" }}
  38. size: {{ $size }}
  39. {{- if eq $storage.type "smb-pv-pvc" }}
  40. mountOptions:
  41. - key: noperm
  42. {{- end }}
  43. targetSelector:
  44. distribution:
  45. distribution:
  46. mountPath: {{ $storage.mountPath }}
  47. 01-permissions:
  48. mountPath: /mnt/directories{{ $storage.mountPath }}
  49. {{- end -}}
  50. {{- if .Values.distributionConfig.basicAuthUsers }}
  51. htpasswd:
  52. enabled: true
  53. type: secret
  54. objectName: distribution-htpasswd
  55. defaultMode: "0600"
  56. items:
  57. - key: htpasswd
  58. path: htpasswd
  59. targetSelector:
  60. distribution:
  61. distribution:
  62. mountPath: /auth
  63. readOnly: true
  64. {{- end -}}
  65. {{- if .Values.distributionNetwork.certificateID }}
  66. cert:
  67. enabled: true
  68. type: secret
  69. objectName: distribution-cert
  70. defaultMode: "0600"
  71. items:
  72. - key: tls.key
  73. path: tls.key
  74. - key: tls.crt
  75. path: tls.crt
  76. targetSelector:
  77. distribution:
  78. distribution:
  79. mountPath: /certs
  80. readOnly: true
  81. scaleCertificate:
  82. distribution-cert:
  83. enabled: true
  84. id: {{ .Values.distributionNetwork.certificateID }}
  85. {{- end -}}
  86. {{- end -}}