From 7f0affa478239c7fd72abdbe4813970c43bb2234 Mon Sep 17 00:00:00 2001 From: owen Date: Thu, 31 Aug 2023 11:21:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=B9=E5=99=A8=E5=8C=96=E9=83=A8?= =?UTF-8?q?=E7=BD=B2=E8=AE=BE=E7=BD=AEnfs=E6=8C=82=E8=BD=BD=E5=8F=82?= =?UTF-8?q?=E6=95=B0=20#1074=20(#1079)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 容器化部署设置nfs挂载参数 #1074 * feat: 容器化部署设置nfs挂载参数 #1074 * feat: 容器化部署设置nfs挂载参数 #1074 * feat: 容器化部署设置nfs挂载参数 #1074 * feat: 容器化部署设置nfs挂载参数 #1074 * feat: 容器化部署设置nfs挂载参数 #1074 * feat: 容器化部署设置nfs挂载参数 #1074 * feat: 容器化部署设置nfs挂载参数 #1074 * feat: 容器化部署设置nfs挂载参数 #1074 * feat: 容器化部署设置nfs挂载参数 #1074 * feat: 容器化部署设置nfs挂载参数 #1074 * feat: 容器化部署设置nfs挂载参数 #1074 * feat: 容器化部署设置nfs挂载参数 #1074 --- .../bkrepo/templates/docker/deployment.yaml | 5 ++--- .../bkrepo/templates/fs-server/deployment.yaml | 5 ++--- .../bkrepo/templates/generic/deployment.yaml | 5 ++--- .../bkrepo/templates/helm/deployment.yaml | 5 ++--- .../bkrepo/templates/job/deployment.yaml | 5 ++--- .../bkrepo/templates/npm/deployment.yaml | 5 ++--- .../bkrepo/templates/opdata/deployment.yaml | 5 ++--- .../charts/bkrepo/templates/pv-nfs.yaml | 18 ++++++++++++++++++ .../charts/bkrepo/templates/pvc-nfs.yaml | 14 ++++++++++++++ .../bkrepo/templates/pypi/deployment.yaml | 5 ++--- .../templates/replication/deployment.yaml | 5 ++--- .../templates/repository/deployment.yaml | 5 ++--- .../kubernetes/charts/bkrepo/values.yaml | 1 + 13 files changed, 53 insertions(+), 30 deletions(-) create mode 100644 support-files/kubernetes/charts/bkrepo/templates/pv-nfs.yaml create mode 100644 support-files/kubernetes/charts/bkrepo/templates/pvc-nfs.yaml diff --git a/support-files/kubernetes/charts/bkrepo/templates/docker/deployment.yaml b/support-files/kubernetes/charts/bkrepo/templates/docker/deployment.yaml index 447fded405..649c639ec1 100644 --- a/support-files/kubernetes/charts/bkrepo/templates/docker/deployment.yaml +++ b/support-files/kubernetes/charts/bkrepo/templates/docker/deployment.yaml @@ -100,9 +100,8 @@ spec: volumes: - name: storage {{- if .Values.common.config.storage.nfs.enabled }} - nfs: - path: {{ .Values.common.config.storage.nfs.path }} - server: {{ .Values.common.config.storage.nfs.server }} + persistentVolumeClaim: + claimName: {{ include "common.names.fullname" . }}-nfs-pvc {{- else if .Values.persistence.enabled }} persistentVolumeClaim: claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "common.names.fullname" . }}-storage{{- end }} diff --git a/support-files/kubernetes/charts/bkrepo/templates/fs-server/deployment.yaml b/support-files/kubernetes/charts/bkrepo/templates/fs-server/deployment.yaml index 62a2ef68c5..e58b2b1747 100644 --- a/support-files/kubernetes/charts/bkrepo/templates/fs-server/deployment.yaml +++ b/support-files/kubernetes/charts/bkrepo/templates/fs-server/deployment.yaml @@ -100,9 +100,8 @@ spec: volumes: - name: storage {{- if .Values.common.config.storage.nfs.enabled }} - nfs: - path: {{ .Values.common.config.storage.nfs.path }} - server: {{ .Values.common.config.storage.nfs.server }} + persistentVolumeClaim: + claimName: {{ include "common.names.fullname" . }}-nfs-pvc {{- else if .Values.persistence.enabled }} persistentVolumeClaim: claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "common.names.fullname" . }}-storage{{- end }} diff --git a/support-files/kubernetes/charts/bkrepo/templates/generic/deployment.yaml b/support-files/kubernetes/charts/bkrepo/templates/generic/deployment.yaml index 2c9f9f7890..0519696fd4 100644 --- a/support-files/kubernetes/charts/bkrepo/templates/generic/deployment.yaml +++ b/support-files/kubernetes/charts/bkrepo/templates/generic/deployment.yaml @@ -124,9 +124,8 @@ spec: volumes: - name: storage {{- if .Values.common.config.storage.nfs.enabled }} - nfs: - path: {{ .Values.common.config.storage.nfs.path }} - server: {{ .Values.common.config.storage.nfs.server }} + persistentVolumeClaim: + claimName: {{ include "common.names.fullname" . }}-nfs-pvc {{- else if .Values.persistence.enabled }} persistentVolumeClaim: claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "common.names.fullname" . }}-storage{{- end }} diff --git a/support-files/kubernetes/charts/bkrepo/templates/helm/deployment.yaml b/support-files/kubernetes/charts/bkrepo/templates/helm/deployment.yaml index b35d5c5664..03b52f7a7d 100644 --- a/support-files/kubernetes/charts/bkrepo/templates/helm/deployment.yaml +++ b/support-files/kubernetes/charts/bkrepo/templates/helm/deployment.yaml @@ -100,9 +100,8 @@ spec: volumes: - name: storage {{- if .Values.common.config.storage.nfs.enabled }} - nfs: - path: {{ .Values.common.config.storage.nfs.path }} - server: {{ .Values.common.config.storage.nfs.server }} + persistentVolumeClaim: + claimName: {{ include "common.names.fullname" . }}-nfs-pvc {{- else if .Values.persistence.enabled }} persistentVolumeClaim: claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "common.names.fullname" . }}-storage{{- end }} diff --git a/support-files/kubernetes/charts/bkrepo/templates/job/deployment.yaml b/support-files/kubernetes/charts/bkrepo/templates/job/deployment.yaml index b7b00df296..5911d61bd6 100644 --- a/support-files/kubernetes/charts/bkrepo/templates/job/deployment.yaml +++ b/support-files/kubernetes/charts/bkrepo/templates/job/deployment.yaml @@ -100,9 +100,8 @@ spec: volumes: - name: storage {{- if .Values.common.config.storage.nfs.enabled }} - nfs: - path: {{ .Values.common.config.storage.nfs.path }} - server: {{ .Values.common.config.storage.nfs.server }} + persistentVolumeClaim: + claimName: {{ include "common.names.fullname" . }}-nfs-pvc {{- else if .Values.persistence.enabled }} persistentVolumeClaim: claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "common.names.fullname" . }}-storage{{- end }} diff --git a/support-files/kubernetes/charts/bkrepo/templates/npm/deployment.yaml b/support-files/kubernetes/charts/bkrepo/templates/npm/deployment.yaml index 0cace081e8..812754adb8 100644 --- a/support-files/kubernetes/charts/bkrepo/templates/npm/deployment.yaml +++ b/support-files/kubernetes/charts/bkrepo/templates/npm/deployment.yaml @@ -100,9 +100,8 @@ spec: volumes: - name: storage {{- if .Values.common.config.storage.nfs.enabled }} - nfs: - path: {{ .Values.common.config.storage.nfs.path }} - server: {{ .Values.common.config.storage.nfs.server }} + persistentVolumeClaim: + claimName: {{ include "common.names.fullname" . }}-nfs-pvc {{- else if .Values.persistence.enabled }} persistentVolumeClaim: claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "common.names.fullname" . }}-storage{{- end }} diff --git a/support-files/kubernetes/charts/bkrepo/templates/opdata/deployment.yaml b/support-files/kubernetes/charts/bkrepo/templates/opdata/deployment.yaml index 39bd028e23..ad86e925b1 100644 --- a/support-files/kubernetes/charts/bkrepo/templates/opdata/deployment.yaml +++ b/support-files/kubernetes/charts/bkrepo/templates/opdata/deployment.yaml @@ -100,9 +100,8 @@ spec: volumes: - name: storage {{- if .Values.common.config.storage.nfs.enabled }} - nfs: - path: {{ .Values.common.config.storage.nfs.path }} - server: {{ .Values.common.config.storage.nfs.server }} + persistentVolumeClaim: + claimName: {{ include "common.names.fullname" . }}-nfs-pvc {{- else if .Values.persistence.enabled }} persistentVolumeClaim: claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "common.names.fullname" . }}-storage{{- end }} diff --git a/support-files/kubernetes/charts/bkrepo/templates/pv-nfs.yaml b/support-files/kubernetes/charts/bkrepo/templates/pv-nfs.yaml new file mode 100644 index 0000000000..0bce32af01 --- /dev/null +++ b/support-files/kubernetes/charts/bkrepo/templates/pv-nfs.yaml @@ -0,0 +1,18 @@ +{{- if .Values.common.config.storage.nfs.enabled -}} +apiVersion: v1 +kind: PersistentVolume +metadata: + name: {{ include "common.names.fullname" . }}-nfs-pv +spec: + storageClassName: bkrepo-nfs + capacity: + storage: {{ .Values.common.config.storage.nfs.capacity }} + accessModes: + - ReadWriteMany + mountOptions: + - lookupcache=pos + nfs: + server: {{ .Values.common.config.storage.nfs.server }} + path: {{ .Values.common.config.storage.nfs.path }} +{{- end -}} + diff --git a/support-files/kubernetes/charts/bkrepo/templates/pvc-nfs.yaml b/support-files/kubernetes/charts/bkrepo/templates/pvc-nfs.yaml new file mode 100644 index 0000000000..49fdc1b369 --- /dev/null +++ b/support-files/kubernetes/charts/bkrepo/templates/pvc-nfs.yaml @@ -0,0 +1,14 @@ +{{- if .Values.common.config.storage.nfs.enabled -}} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "common.names.fullname" . }}-nfs-pvc +spec: + storageClassName: bkrepo-nfs + resources: + requests: + storage: {{ .Values.common.config.storage.nfs.capacity }} + accessModes: + - ReadWriteMany + volumeName: {{ include "common.names.fullname" . }}-nfs-pv +{{- end -}} \ No newline at end of file diff --git a/support-files/kubernetes/charts/bkrepo/templates/pypi/deployment.yaml b/support-files/kubernetes/charts/bkrepo/templates/pypi/deployment.yaml index 8a73a9f401..ed298c41e1 100644 --- a/support-files/kubernetes/charts/bkrepo/templates/pypi/deployment.yaml +++ b/support-files/kubernetes/charts/bkrepo/templates/pypi/deployment.yaml @@ -100,9 +100,8 @@ spec: volumes: - name: storage {{- if .Values.common.config.storage.nfs.enabled }} - nfs: - path: {{ .Values.common.config.storage.nfs.path }} - server: {{ .Values.common.config.storage.nfs.server }} + persistentVolumeClaim: + claimName: {{ include "common.names.fullname" . }}-nfs-pvc {{- else if .Values.persistence.enabled }} persistentVolumeClaim: claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "common.names.fullname" . }}-storage{{- end }} diff --git a/support-files/kubernetes/charts/bkrepo/templates/replication/deployment.yaml b/support-files/kubernetes/charts/bkrepo/templates/replication/deployment.yaml index 9054a98406..8d3b21bb0b 100644 --- a/support-files/kubernetes/charts/bkrepo/templates/replication/deployment.yaml +++ b/support-files/kubernetes/charts/bkrepo/templates/replication/deployment.yaml @@ -103,9 +103,8 @@ spec: volumes: - name: storage {{- if .Values.common.config.storage.nfs.enabled }} - nfs: - path: {{ .Values.common.config.storage.nfs.path }} - server: {{ .Values.common.config.storage.nfs.server }} + persistentVolumeClaim: + claimName: {{ include "common.names.fullname" . }}-nfs-pvc {{- else if .Values.persistence.enabled }} persistentVolumeClaim: claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "common.names.fullname" . }}-storage{{- end }} diff --git a/support-files/kubernetes/charts/bkrepo/templates/repository/deployment.yaml b/support-files/kubernetes/charts/bkrepo/templates/repository/deployment.yaml index a7be1cc1ef..ab6d6160c8 100644 --- a/support-files/kubernetes/charts/bkrepo/templates/repository/deployment.yaml +++ b/support-files/kubernetes/charts/bkrepo/templates/repository/deployment.yaml @@ -115,9 +115,8 @@ spec: volumes: - name: storage {{- if .Values.common.config.storage.nfs.enabled }} - nfs: - path: {{ .Values.common.config.storage.nfs.path }} - server: {{ .Values.common.config.storage.nfs.server }} + persistentVolumeClaim: + claimName: {{ include "common.names.fullname" . }}-nfs-pvc {{- else if .Values.persistence.enabled }} persistentVolumeClaim: claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "common.names.fullname" . }}-storage{{- end }} diff --git a/support-files/kubernetes/charts/bkrepo/values.yaml b/support-files/kubernetes/charts/bkrepo/values.yaml index f746e4aecc..86bf1d9e50 100644 --- a/support-files/kubernetes/charts/bkrepo/values.yaml +++ b/support-files/kubernetes/charts/bkrepo/values.yaml @@ -212,6 +212,7 @@ common: # 是否启用nfs挂载 nfs: enabled: false + capacity: 100Ti path: / server: