From 495a2809860c35ea4a48cc9478804274a85d2191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Thu, 26 May 2022 13:54:08 +0800 Subject: [PATCH 1/2] =?UTF-8?q?perf:=20=E6=9B=B4=E6=96=B0=20persistence?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/celery/deployment-celery.yaml | 10 ++++++++++ .../jumpserver/templates/core/deployment-core.yaml | 10 ++++++++++ .../jumpserver/templates/koko/deployment-koko.yaml | 7 +++++++ .../jumpserver/templates/lion/deployment-lion.yaml | 7 +++++++ .../templates/magnus/deployment-magnus.yaml | 7 +++++++ .../templates/omnidb/deployment-omnidb.yaml | 7 +++++++ .../jumpserver/templates/web/deployment-nginx.yaml | 14 ++++++++++++++ .../jumpserver/templates/xrdp/deployment-xrdp.yaml | 7 +++++++ charts/jumpserver/values.yaml | 14 +++++++++++++- 9 files changed, 82 insertions(+), 1 deletion(-) diff --git a/charts/jumpserver/templates/celery/deployment-celery.yaml b/charts/jumpserver/templates/celery/deployment-celery.yaml index d2d60f0..988cc83 100644 --- a/charts/jumpserver/templates/celery/deployment-celery.yaml +++ b/charts/jumpserver/templates/celery/deployment-celery.yaml @@ -89,8 +89,14 @@ spec: subPath: "config.yml" - mountPath: "/opt/jumpserver/data" name: "jms-core-data" + {{- if .persistence.subPath }} + subPath: {{ .persistence.subPath | quote }} + {{- end }} - mountPath: "/opt/jumpserver/logs" name: "jms-core-logs" + {{- if .persistence.subPath }} + subPath: {{ .persistence.subPath | quote }} + {{- end }} {{- with .volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} @@ -100,7 +106,11 @@ spec: name: '{{ include "jumpserver.fullname" $ }}-jms-core' name: "jms-core-config" - persistentVolumeClaim: + {{- if .persistence.existingClaim }} + claimName: {{ .persistence.existingClaim | quote }} + {{- else }} claimName: '{{ include "jumpserver.fullname" $ }}-jms-core-data' + {{- end }} name: "jms-core-data" - persistentVolumeClaim: claimName: '{{ include "jumpserver.fullname" $ }}-jms-core-logs' diff --git a/charts/jumpserver/templates/core/deployment-core.yaml b/charts/jumpserver/templates/core/deployment-core.yaml index e0dc9e4..544b512 100644 --- a/charts/jumpserver/templates/core/deployment-core.yaml +++ b/charts/jumpserver/templates/core/deployment-core.yaml @@ -96,8 +96,14 @@ spec: subPath: "config.yml" - mountPath: "/opt/jumpserver/data" name: "jms-core-data" + {{- if .persistence.subPath }} + subPath: {{ .persistence.subPath | quote }} + {{- end }} - mountPath: "/opt/jumpserver/logs" name: "jms-core-logs" + {{- if .persistence.subPath }} + subPath: {{ .persistence.subPath | quote }} + {{- end }} {{- with .volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} @@ -107,7 +113,11 @@ spec: name: '{{ include "jumpserver.fullname" $ }}-jms-core' name: "jms-core-config" - persistentVolumeClaim: + {{- if .persistence.existingClaim }} + claimName: {{ .persistence.existingClaim | quote }} + {{- else }} claimName: '{{ include "jumpserver.fullname" $ }}-jms-core-data' + {{- end }} name: "jms-core-data" - persistentVolumeClaim: claimName: '{{ include "jumpserver.fullname" $ }}-jms-core-logs' diff --git a/charts/jumpserver/templates/koko/deployment-koko.yaml b/charts/jumpserver/templates/koko/deployment-koko.yaml index e1f73b4..fd9ea6f 100644 --- a/charts/jumpserver/templates/koko/deployment-koko.yaml +++ b/charts/jumpserver/templates/koko/deployment-koko.yaml @@ -82,13 +82,20 @@ spec: volumeMounts: - mountPath: "/opt/koko/data" name: "jms-koko-data" + {{- if .persistence.subPath }} + subPath: {{ .persistence.subPath | quote }} + {{- end }} {{- with .volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} restartPolicy: Always volumes: - persistentVolumeClaim: + {{- if .persistence.existingClaim }} + claimName: {{ .persistence.existingClaim | quote }} + {{- else }} claimName: '{{ include "jumpserver.fullname" $ }}-jms-koko-data' + {{- end }} name: "jms-koko-data" {{- with .volumes }} {{- tpl (toYaml .) $ | nindent 8 }} diff --git a/charts/jumpserver/templates/lion/deployment-lion.yaml b/charts/jumpserver/templates/lion/deployment-lion.yaml index 80f15b4..4f8c7b7 100644 --- a/charts/jumpserver/templates/lion/deployment-lion.yaml +++ b/charts/jumpserver/templates/lion/deployment-lion.yaml @@ -75,13 +75,20 @@ spec: volumeMounts: - mountPath: "/opt/lion/data" name: "jms-lion-data" + {{- if .persistence.subPath }} + subPath: {{ .persistence.subPath | quote }} + {{- end }} {{- with .volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} restartPolicy: Always volumes: - persistentVolumeClaim: + {{- if .persistence.existingClaim }} + claimName: {{ .persistence.existingClaim | quote }} + {{- else }} claimName: '{{ include "jumpserver.fullname" $ }}-jms-lion-data' + {{- end }} name: "jms-lion-data" {{- with .volumes }} {{- tpl (toYaml .) $ | nindent 8 }} diff --git a/charts/jumpserver/templates/magnus/deployment-magnus.yaml b/charts/jumpserver/templates/magnus/deployment-magnus.yaml index c75cd8e..3468f66 100644 --- a/charts/jumpserver/templates/magnus/deployment-magnus.yaml +++ b/charts/jumpserver/templates/magnus/deployment-magnus.yaml @@ -73,13 +73,20 @@ spec: volumeMounts: - mountPath: "/opt/magnus/data" name: "jms-magnus-data" + {{- if .persistence.subPath }} + subPath: {{ .persistence.subPath | quote }} + {{- end }} {{- with .volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} restartPolicy: Always volumes: - persistentVolumeClaim: + {{- if .persistence.existingClaim }} + claimName: {{ .persistence.existingClaim | quote }} + {{- else }} claimName: '{{ include "jumpserver.fullname" $ }}-jms-magnus-data' + {{- end }} name: "jms-magnus-data" {{- with .volumes }} {{- tpl (toYaml .) $ | nindent 8 }} diff --git a/charts/jumpserver/templates/omnidb/deployment-omnidb.yaml b/charts/jumpserver/templates/omnidb/deployment-omnidb.yaml index f0d232c..9db8c3d 100644 --- a/charts/jumpserver/templates/omnidb/deployment-omnidb.yaml +++ b/charts/jumpserver/templates/omnidb/deployment-omnidb.yaml @@ -67,13 +67,20 @@ spec: volumeMounts: - mountPath: "/opt/omnidb/data" name: "jms-omnidb-data" + {{- if .persistence.subPath }} + subPath: {{ .persistence.subPath | quote }} + {{- end }} {{- with .volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} restartPolicy: Always volumes: - persistentVolumeClaim: + {{- if .persistence.existingClaim }} + claimName: {{ .persistence.existingClaim | quote }} + {{- else }} claimName: '{{ include "jumpserver.fullname" $ }}-jms-omnidb-data' + {{- end }} name: "jms-omnidb-data" {{- with .volumes }} {{- tpl (toYaml .) $ | nindent 8 }} diff --git a/charts/jumpserver/templates/web/deployment-nginx.yaml b/charts/jumpserver/templates/web/deployment-nginx.yaml index b82ad65..740fab4 100644 --- a/charts/jumpserver/templates/web/deployment-nginx.yaml +++ b/charts/jumpserver/templates/web/deployment-nginx.yaml @@ -62,8 +62,14 @@ spec: subPath: "default.conf" - mountPath: "/opt/jumpserver/data" name: "jms-core-data" + {{- if $.Values.core.persistence.subPath }} + subPath: {{ $.Values.core.persistence.subPath | quote }} + {{- end }} - mountPath: "/var/log/nginx" name: "jms-web-logs" + {{- if .persistence.subPath }} + subPath: {{ .persistence.subPath | quote }} + {{- end }} {{- with .volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} @@ -73,10 +79,18 @@ spec: name: '{{ include "jumpserver.fullname" $ }}-jms-web' name: "jms-web-config" - persistentVolumeClaim: + {{- if $.Values.core.persistence.existingClaim }} + claimName: {{ $.Values.core.persistence.existingClaim | quote }} + {{- else }} claimName: '{{ include "jumpserver.fullname" $ }}-jms-core-data' + {{- end }} name: "jms-core-data" - persistentVolumeClaim: + {{- if .persistence.existingClaim }} + claimName: {{ .persistence.existingClaim | quote }} + {{- else }} claimName: '{{ include "jumpserver.fullname" $ }}-jms-web-logs' + {{- end }} name: "jms-web-logs" {{- with .volumes }} {{- tpl (toYaml .) $ | nindent 8 }} diff --git a/charts/jumpserver/templates/xrdp/deployment-xrdp.yaml b/charts/jumpserver/templates/xrdp/deployment-xrdp.yaml index d428217..1b5c967 100644 --- a/charts/jumpserver/templates/xrdp/deployment-xrdp.yaml +++ b/charts/jumpserver/templates/xrdp/deployment-xrdp.yaml @@ -67,13 +67,20 @@ spec: volumeMounts: - mountPath: "/opt/xrdp/data" name: "jms-xrdp-data" + {{- if .persistence.subPath }} + subPath: {{ .persistence.subPath | quote }} + {{- end }} {{- with .volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} restartPolicy: Always volumes: - persistentVolumeClaim: + {{- if .persistence.existingClaim }} + claimName: {{ .persistence.existingClaim | quote }} + {{- else }} claimName: '{{ include "jumpserver.fullname" $ }}-jms-xrdp-data' + {{- end }} name: "jms-xrdp-data" {{- with .volumes }} {{- tpl (toYaml .) $ | nindent 8 }} diff --git a/charts/jumpserver/values.yaml b/charts/jumpserver/values.yaml index 5531b49..5f0b07c 100644 --- a/charts/jumpserver/values.yaml +++ b/charts/jumpserver/values.yaml @@ -147,7 +147,7 @@ core: finalizers: - kubernetes.io/pvc-protection # subPath: "" - # existingClaim: + # existingClaim: "" volumeMounts: [] @@ -237,6 +237,8 @@ koko: # annotations: {} finalizers: - kubernetes.io/pvc-protection + # subPath: "" + # existingClaim: "" volumeMounts: [] @@ -326,6 +328,8 @@ lion: # annotations: {} finalizers: - kubernetes.io/pvc-protection + # subPath: "" + # existingClaim: "" volumeMounts: [] @@ -409,6 +413,8 @@ magnus: # annotations: {} finalizers: - kubernetes.io/pvc-protection + # subPath: "" + # existingClaim: "" volumeMounts: [] @@ -489,6 +495,8 @@ omnidb: # annotations: {} finalizers: - kubernetes.io/pvc-protection + # subPath: "" + # existingClaim: "" volumeMounts: [] @@ -575,6 +583,8 @@ xrdp: # annotations: {} finalizers: - kubernetes.io/pvc-protection + # subPath: "" + # existingClaim: "" volumeMounts: [] @@ -654,6 +664,8 @@ web: # annotations: {} finalizers: - kubernetes.io/pvc-protection + # subPath: "" + # existingClaim: "" volumeMounts: [] From 9b87d5c1498510f30f72b82492243c1667385438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Wed, 8 Jun 2022 15:55:39 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20v2.22.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- charts/jumpserver/Chart.yaml | 4 ++-- charts/jumpserver/README.md | 2 +- charts/jumpserver/values.yaml | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/charts/jumpserver/Chart.yaml b/charts/jumpserver/Chart.yaml index 3ff40f3..4013add 100644 --- a/charts/jumpserver/Chart.yaml +++ b/charts/jumpserver/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 -appVersion: "v2.22.1" +appVersion: "v2.22.2" description: A Helm chart for Deploying Jumpserver on Kubernetes engine: gotpl home: https://jumpserver.org @@ -10,4 +10,4 @@ maintainers: sources: - https://github.com/jumpserver/ name: jumpserver -version: 2.22.1 +version: 2.22.2 diff --git a/charts/jumpserver/README.md b/charts/jumpserver/README.md index 8a33615..ec68048 100644 --- a/charts/jumpserver/README.md +++ b/charts/jumpserver/README.md @@ -30,7 +30,7 @@ helm repo add jumpserver https://jumpserver.github.io/helm-charts | `nameOveride` | name override | `nil` | | `fullNameOveride` | full name override | `nil` | | `global.imageRegistry` | 仓库地址 | `docker.io` | -| `global.imageTag` | 版本号 | `v2.22.1 ` | +| `global.imageTag` | 版本号 | `v2.22.2 ` | | `global.imagePullSecrets` | 私有仓库认证凭据 | `nil` | | `global.storageClass` | 存储 sc | `nil` | | `ingress.enabled` | 开启 ingress | `true` | diff --git a/charts/jumpserver/values.yaml b/charts/jumpserver/values.yaml index 5f0b07c..93a56d0 100644 --- a/charts/jumpserver/values.yaml +++ b/charts/jumpserver/values.yaml @@ -12,7 +12,7 @@ fullnameOverride: "" ## global: imageRegistry: "docker.io" - imageTag: v2.22.1 + imageTag: v2.22.2 ## E.g. # imagePullSecrets: # - myRegistryKeySecretName @@ -85,7 +85,7 @@ core: image: registry: docker.io repository: jumpserver/core - tag: v2.22.1 + tag: v2.22.2 pullPolicy: IfNotPresent command: [] @@ -174,7 +174,7 @@ koko: image: registry: docker.io repository: jumpserver/koko - tag: v2.22.1 + tag: v2.22.2 pullPolicy: IfNotPresent command: [] @@ -265,7 +265,7 @@ lion: image: registry: docker.io repository: jumpserver/lion - tag: v2.22.1 + tag: v2.22.2 pullPolicy: IfNotPresent command: [] @@ -356,7 +356,7 @@ magnus: image: registry: docker.io repository: jumpserver/magnus - tag: v2.22.1 + tag: v2.22.2 pullPolicy: IfNotPresent command: [] @@ -442,7 +442,7 @@ omnidb: image: registry: registry.fit2cloud.com repository: jumpserver/omnidb - tag: v2.22.1 + tag: v2.22.2 pullPolicy: IfNotPresent command: [] @@ -521,7 +521,7 @@ xrdp: image: registry: registry.fit2cloud.com repository: jumpserver/xrdp - tag: v2.22.1 + tag: v2.22.2 pullPolicy: IfNotPresent command: [] @@ -607,7 +607,7 @@ web: image: registry: docker.io repository: jumpserver/web - tag: v2.22.1 + tag: v2.22.2 pullPolicy: IfNotPresent command: []