Skip to content

Commit

Permalink
update ks-core helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
ks-ci-bot committed Mar 29, 2024
1 parent 068d9c7 commit 5f1b2a2
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 365 deletions.
16 changes: 10 additions & 6 deletions src/test/ks-core/templates/post-upgrade-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,27 @@ spec:
- ks-upgrade
- post-upgrade
- --logtostderr=true
- --config=/etc/kubesphere/ks-upgrade.yaml
- --config=/etc/kubesphere/config.yaml
{{- if .Values.upgrade.config }}
- --config=/etc/kubesphere/config-patch.yaml
{{- end }}
volumeMounts:
- mountPath: /etc/kubesphere/
{{- if .Values.upgrade.config }}
- mountPath: /etc/kubesphere/config-patch.yaml
name: config
{{- if not .Values.upgrade.storage.s3.endpoint }}
subPath: config-patch.yaml
{{- end }}
- mountPath: /tmp/ks-upgrade
name: data
{{- end }}
resources: {{- toYaml .Values.upgrade.resources | nindent 12 }}
volumes:
{{- if .Values.upgrade.config }}
- name: config
configMap:
name: {{ .Release.Name }}-upgrade-config
defaultMode: 420
{{- if not .Values.upgrade.storage.s3.endpoint }}
{{- end }}
- name: data
persistentVolumeClaim:
claimName: {{ .Values.upgrade.persistenceVolume.name }}
{{- end }}
{{- end }}
33 changes: 14 additions & 19 deletions src/test/ks-core/templates/pre-upgrade-job.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if not .Values.upgrade.disabled }}
{{- if .Values.upgrade.config }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -8,20 +9,11 @@ metadata:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-weight": "-1"
data:
ks-upgrade.yaml: |
storage:
{{- if .Values.upgrade.storage.s3.endpoint }}
s3: {{- toYaml .Values.upgrade.storage.s3 | nindent 8 }}
{{- else }}
local:
path: {{ .Values.upgrade.storage.local.path }}
{{- end }}
download: {{- toYaml .Values.upgrade.download | nindent 6 }}
skipValidator: {{ .Values.upgrade.skipValidator }}
jobs: {{- toYaml .Values.upgrade.jobs | nindent 6 }}
config-patch.yaml: |
{{- toYaml .Values.upgrade.config | nindent 4 }}
{{- end }}

---
{{- if not .Values.upgrade.storage.s3.endpoint }}
{{- if not (lookup "v1" "PersistentVolumeClaim" .Release.Namespace .Values.upgrade.persistenceVolume.name) }}
kind: PersistentVolumeClaim
apiVersion: v1
Expand All @@ -42,7 +34,6 @@ spec:
storage: {{ .Values.upgrade.persistenceVolume.size | quote }}
storageClassName: {{ .Values.upgrade.persistenceVolume.storageClassName }}
{{- end }}
{{- end }}

---
apiVersion: batch/v1
Expand All @@ -66,23 +57,27 @@ spec:
- ks-upgrade
- pre-upgrade
- --logtostderr=true
- --config=/etc/kubesphere/ks-upgrade.yaml
- --config=/etc/kubesphere/config.yaml
{{- if .Values.upgrade.config }}
- --config=/etc/kubesphere/config-patch.yaml
{{- end }}
volumeMounts:
- mountPath: /etc/kubesphere/
{{- if .Values.upgrade.config }}
- mountPath: /etc/kubesphere/config-patch.yaml
name: config
{{- if not .Values.upgrade.storage.s3.endpoint }}
subPath: config-patch.yaml
{{- end }}
- mountPath: /tmp/ks-upgrade
name: data
{{- end }}
resources: {{- toYaml .Values.upgrade.resources | nindent 12 }}
volumes:
{{- if .Values.upgrade.config }}
- name: config
configMap:
name: {{ .Release.Name }}-upgrade-config
defaultMode: 420
{{- if not .Values.upgrade.storage.s3.endpoint }}
{{- end }}
- name: data
persistentVolumeClaim:
claimName: {{ .Values.upgrade.persistenceVolume.name }}
{{- end }}
{{- end }}
27 changes: 14 additions & 13 deletions src/test/ks-core/templates/prepare-upgrade-job.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
{{- if .Values.upgrade.prepare }}
{{- if .Values.upgrade.config }}
apiVersion: v1
kind: ConfigMap
metadata:
name: ks-upgrade-prepare-config
namespace: {{ .Release.Namespace }}
data:
ks-upgrade.yaml: |
storage:
{{- if .Values.upgrade.storage.s3.endpoint }}
s3: {{- toYaml .Values.upgrade.storage.s3 | nindent 8 }}
{{- else }}
local:
path: {{ .Values.upgrade.storage.local.path }}
{{- end }}
download: {{- toYaml .Values.upgrade.download | nindent 6 }}
skipValidator: {{ .Values.upgrade.skipValidator }}
jobs: {{- toYaml .Values.upgrade.jobs | nindent 6 }}
config-patch.yaml: |
{{- toYaml .Values.upgrade.config | nindent 4 }}
{{- end }}

---
apiVersion: batch/v1
Expand All @@ -36,14 +29,22 @@ spec:
- ks-upgrade
- prepare-upgrade
- --logtostderr=true
- --config=/etc/kubesphere/ks-upgrade.yaml
- --config=/etc/kubesphere/config.yaml
{{- if .Values.upgrade.config }}
- --config=/etc/kubesphere/config-patch.yaml
{{- end }}
{{- if .Values.upgrade.config }}
volumeMounts:
- mountPath: /etc/kubesphere/
- mountPath: /etc/kubesphere/config-patch.yaml
name: config
subPath: config-patch.yaml
{{- end }}
resources: {{- toYaml .Values.upgrade.resources | nindent 12 }}
{{- if .Values.upgrade.config }}
volumes:
- name: config
configMap:
name: ks-upgrade-prepare-config
defaultMode: 420
{{- end }}
{{- end }}
Loading

0 comments on commit 5f1b2a2

Please sign in to comment.