diff --git a/src/test/ks-core/Chart.yaml b/src/test/ks-core/Chart.yaml index 5b11314b..fd96318c 100644 --- a/src/test/ks-core/Chart.yaml +++ b/src/test/ks-core/Chart.yaml @@ -7,12 +7,12 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.6.22 +version: 0.6.23 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. -appVersion: "v4.1.0-beta.0" +appVersion: "v4.1.0-rc.0" dependencies: - name: redis-ha diff --git a/src/test/ks-core/templates/_helpers.tpl b/src/test/ks-core/templates/_helpers.tpl index cfadafc1..2c2ad24b 100644 --- a/src/test/ks-core/templates/_helpers.tpl +++ b/src/test/ks-core/templates/_helpers.tpl @@ -127,6 +127,26 @@ Create the name of the secret of sa token. {{- end }} {{- end }} +{{- define "hostClusterName" -}} +{{- if eq .Values.hostClusterName "" }} +{{- with lookup "v1" "ConfigMap" (printf "%s" .Release.Namespace) "kubesphere-config" }} +{{- with (fromYaml (index .data "kubesphere.yaml")) }} +{{- if and .multicluster (.multicluster).hostClusterName }} +{{- .multicluster.hostClusterName }} +{{- else }} +{{- $.Values.hostClusterName | default "host" }} +{{- end }} +{{- else }} +{{- $.Values.hostClusterName | default "host" }} +{{- end }} +{{- else }} +{{- $.Values.hostClusterName | default "host" }} +{{- end }} +{{- else }} +{{- .Values.hostClusterName }} +{{- end }} +{{- end }} + {{/* Returns user's password or use default */}} diff --git a/src/test/ks-core/templates/dynamic-upgrade-job.yaml b/src/test/ks-core/templates/dynamic-upgrade-job.yaml new file mode 100644 index 00000000..f4d252fa --- /dev/null +++ b/src/test/ks-core/templates/dynamic-upgrade-job.yaml @@ -0,0 +1,57 @@ +{{- if .Values.upgrade.enabled }} +{{- if .Values.upgrade.dynamic }} +{{- if .Values.upgrade.config }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: ks-upgrade-dynamic-config + namespace: {{ .Release.Namespace }} +data: + config-patch.yaml: | + {{- toYaml .Values.upgrade.config | nindent 4 }} +{{- end }} + +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: dynamic-upgrade + namespace: {{ .Release.Namespace }} +spec: + template: + spec: + restartPolicy: Never + serviceAccountName: {{ include "ks-core.serviceAccountName" . }} + containers: + - name: dynamic-upgrade-job + image: {{ template "upgrade.image" . }} + imagePullPolicy: {{ .Values.upgrade.image.pullPolicy }} + command: + - ks-upgrade + - dynamic-upgrade + - --logtostderr=true + - --config=/etc/kubesphere/config.yaml + {{- if .Values.upgrade.config }} + - --config=/etc/kubesphere/config-patch.yaml + {{- end }} + volumeMounts: + - mountPath: /tmp/ks-upgrade + name: data + {{- if .Values.upgrade.config }} + - mountPath: /etc/kubesphere/config-patch.yaml + name: config + subPath: config-patch.yaml + {{- end }} + resources: {{- toYaml .Values.upgrade.resources | nindent 12 }} + volumes: + - name: data + persistentVolumeClaim: + claimName: {{ .Values.upgrade.persistenceVolume.name }} + {{- if .Values.upgrade.config }} + - name: config + configMap: + name: ks-upgrade-dynamic-config + defaultMode: 420 + {{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/src/test/ks-core/templates/kubesphere-config.yaml b/src/test/ks-core/templates/kubesphere-config.yaml index f0b28495..8053feff 100644 --- a/src/test/ks-core/templates/kubesphere-config.yaml +++ b/src/test/ks-core/templates/kubesphere-config.yaml @@ -31,6 +31,7 @@ data: {{- end }} multicluster: clusterRole: {{ include "role" . | quote }} + hostClusterName: {{ include "hostClusterName" . | quote }} terminal: kubectl: image: {{ template "kubectl.image" . }} diff --git a/src/test/ks-core/values.yaml b/src/test/ks-core/values.yaml index e267247e..d3efe305 100644 --- a/src/test/ks-core/values.yaml +++ b/src/test/ks-core/values.yaml @@ -2,7 +2,7 @@ ## @param global.tag Global Docker image tag global: imageRegistry: registry.cn-beijing.aliyuncs.com - tag: v4.1.0-beta.0 + tag: v4.1.0-rc.0 imagePullSecrets: [] ## @param nameOverride String to partially override common.names.fullname @@ -23,6 +23,9 @@ commonAnnotations: {} ## Priority: specified in values > get from kubesphere-config > default role (host) role: "" +## Priority: specified in values > get from kubesphere-config > default name (host) +hostClusterName: "" + portal: ## The IP address or hostname to access ks-console service. ## DO NOT use IP address if ingress is enabled. @@ -33,7 +36,7 @@ portal: # port: 30443 s3: -# If endpoint is empty, disable s3 storage + # If endpoint is empty, disable s3 storage endpoint: "" region: "us-east-1" disableSSL: true