_persistence.tpl 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. {{- define "distribution.persistence" -}}
  2. persistence:
  3. {{- if .Values.distributionStorage.useFilesystemBackend }}
  4. data:
  5. enabled: true
  6. {{- include "distribution.storage.ci.migration" (dict "storage" .Values.distributionStorage.data) }}
  7. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.distributionStorage.data) | nindent 4 }}
  8. targetSelector:
  9. distribution:
  10. distribution:
  11. mountPath: /var/lib/registry
  12. {{- if and (eq .Values.distributionStorage.data.type "ixVolume")
  13. (not (.Values.distributionStorage.data.ixVolumeConfig | default dict).aclEnable) }}
  14. 01-permissions:
  15. mountPath: /mnt/directories/registry
  16. {{- end -}}
  17. {{- end }}
  18. tmp:
  19. enabled: true
  20. type: emptyDir
  21. targetSelector:
  22. distribution:
  23. distribution:
  24. mountPath: /tmp
  25. {{- range $idx, $storage := .Values.distributionStorage.additionalStorages }}
  26. {{ printf "distribution-%v:" (int $idx) }}
  27. enabled: true
  28. {{- include "distribution.storage.ci.migration" (dict "storage" $storage) }}
  29. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  30. targetSelector:
  31. distribution:
  32. distribution:
  33. mountPath: {{ $storage.mountPath }}
  34. {{- if and (eq $storage.type "ixVolume") (not ($storage.ixVolumeConfig | default dict).aclEnable) }}
  35. 01-permissions:
  36. mountPath: /mnt/directories{{ $storage.mountPath }}
  37. {{- end }}
  38. {{- end -}}
  39. {{- if .Values.distributionConfig.basicAuthUsers }}
  40. htpasswd:
  41. enabled: true
  42. type: secret
  43. objectName: distribution-htpasswd
  44. defaultMode: "0600"
  45. items:
  46. - key: htpasswd
  47. path: htpasswd
  48. targetSelector:
  49. distribution:
  50. distribution:
  51. mountPath: /auth
  52. readOnly: true
  53. {{- end -}}
  54. {{- if .Values.distributionNetwork.certificateID }}
  55. cert:
  56. enabled: true
  57. type: secret
  58. objectName: distribution-cert
  59. defaultMode: "0600"
  60. items:
  61. - key: tls.key
  62. path: tls.key
  63. - key: tls.crt
  64. path: tls.crt
  65. targetSelector:
  66. distribution:
  67. distribution:
  68. mountPath: /certs
  69. readOnly: true
  70. scaleCertificate:
  71. distribution-cert:
  72. enabled: true
  73. id: {{ .Values.distributionNetwork.certificateID }}
  74. {{- end -}}
  75. {{- end -}}
  76. {{/* TODO: Remove on the next version bump, eg 1.2.0+ */}}
  77. {{- define "distribution.storage.ci.migration" -}}
  78. {{- $storage := .storage -}}
  79. {{- if $storage.hostPath -}}
  80. {{- $_ := set $storage "hostPathConfig" dict -}}
  81. {{- $_ := set $storage.hostPathConfig "hostPath" $storage.hostPath -}}
  82. {{- end -}}
  83. {{- end -}}