Skip to content

Commit

Permalink
Merge pull request #386 from kubesphere/sync/ks-core
Browse files Browse the repository at this point in the history
Update ks-core helm chart
  • Loading branch information
zheng1 authored Apr 8, 2024
2 parents a16bee9 + 78bf724 commit dbee6fb
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/test/ks-core/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions src/test/ks-core/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/}}
Expand Down
57 changes: 57 additions & 0 deletions src/test/ks-core/templates/dynamic-upgrade-job.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
1 change: 1 addition & 0 deletions src/test/ks-core/templates/kubesphere-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ data:
{{- end }}
multicluster:
clusterRole: {{ include "role" . | quote }}
hostClusterName: {{ include "hostClusterName" . | quote }}
terminal:
kubectl:
image: {{ template "kubectl.image" . }}
Expand Down
7 changes: 5 additions & 2 deletions src/test/ks-core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit dbee6fb

Please sign in to comment.