Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ks-core helm chart #369

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/test/ks-core/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ 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.10
version: 0.6.11

# 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ spec:
status:
description: ApplicationReleaseStatus defines the observed state of ApplicationRelease
properties:
jobName:
type: string
lastDeployed:
format: date-time
installJobName:
type: string
lastUpdate:
format: date-time
Expand All @@ -103,11 +100,11 @@ spec:
type: string
type: array
specHash:
description: This is used to compare whether the spec has been modified
to determine if an upgrade is needed.
type: string
state:
type: string
uninstallJobName:
type: string
required:
- state
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ spec:
type: string
type: object
type: array
pullUrl:
type: string
versionName:
type: string
required:
Expand Down
4 changes: 4 additions & 0 deletions src/test/ks-core/crds/kubesphere.io_extensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ spec:
- type
type: object
type: array
enabled:
type: boolean
installedVersion:
type: string
plannedInstallVersion:
type: string
recommendedVersion:
Expand Down
2 changes: 1 addition & 1 deletion src/test/ks-core/crds/kubesphere.io_extensionversions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ spec:
description: Indicates if the dependency is required
type: boolean
type:
description: Type of dependency, default to extension
description: Type of dependency, defaults to extension
type: string
version:
description: SemVer
Expand Down
2 changes: 2 additions & 0 deletions src/test/ks-core/crds/kubesphere.io_installplans.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ spec:
- type
type: object
type: array
enabled:
type: boolean
jobName:
type: string
releaseName:
Expand Down
16 changes: 16 additions & 0 deletions src/test/ks-core/scripts/post-delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
# set -x

CRD_NAMES=$1
MAPPING_CONFIG=$2

for extension in `kubectl get extension | grep 'Installed' | awk '{print $1}'`
do
version=$(kubectl get extension $extension -o=jsonpath='{.status.installedVersion}')
extensionversion=$extension-$version
echo "Found extension $extensionversion installed"
helm status $extension --namespace extension-$extension
if [ $? -eq 0 ]; then
helm mapkubeapis $extension --namespace extension-$extension --mapfile $MAPPING_CONFIG
fi
helm status $extension-agent --namespace extension-$extension
if [ $? -eq 0 ]; then
helm mapkubeapis $extension-agent --namespace extension-$extension --mapfile $MAPPING_CONFIG
fi
done

# delete crds
for crd in `kubectl get crds -o jsonpath="{.items[*].metadata.name}"`
Expand Down
3 changes: 3 additions & 0 deletions src/test/ks-core/templates/ks-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ spec:
tier: backend
template:
metadata:
annotations:
# force restart ks-agent after the upgrade is complete (even if there is no update)
kubesphere.io/update-time: {{ dateInZone "2006-01-02T15:05:05Z" (now) "UTC"| quote }}
labels:
app: ks-agent
tier: backend
Expand Down
11 changes: 11 additions & 0 deletions src/test/ks-core/templates/post-delete-job.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- $kubeVersion := .Capabilities.KubeVersion }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -7,6 +8,15 @@ metadata:
"helm.sh/hook-weight": "-1"
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
data:
map.yaml: |
mappings:
{{- range $path, $_ := .Files.Glob "crds/**" }}
{{- $crd := $.Files.Get $path | fromYaml }}
{{- range $_, $version := $crd.spec.versions }}
- deprecatedAPI: "apiVersion: {{ $crd.spec.group }}/{{ $version.name }}\nkind: {{ $crd.spec.names.kind }}\n"
removedInVersion: "{{ $kubeVersion }}"
{{- end }}
{{- end }}
{{ (.Files.Glob "scripts/post-delete.sh").AsConfig | indent 2 }}

---
Expand Down Expand Up @@ -67,6 +77,7 @@ spec:
- /bin/bash
- /scripts/post-delete.sh
- '{{ join " " $crdNameList }}'
- /scripts/map.yaml
volumeMounts:
- mountPath: /scripts
name: scripts
Expand Down
33 changes: 0 additions & 33 deletions src/test/ks-core/templates/webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,40 +249,7 @@ webhooks:
timeoutSeconds: 30

---
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
name: applicationreleases.application.kubesphere.io
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
caBundle: {{ b64enc $ca.Cert | quote }}
service:
name: ks-controller-manager
namespace: kubesphere-system
path: /mutate-application-kubesphere-io-v2-applicationrelease
port: 443
failurePolicy: Fail
matchPolicy: Exact
name: applicationreleases.application.kubesphere.io
namespaceSelector: {}
objectSelector: {}
rules:
- apiGroups:
- application.kubesphere.io
apiVersions:
- v2
operations:
- CREATE
- UPDATE
resources:
- applicationreleases
scope: '*'
sideEffects: None
timeoutSeconds: 30

---
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
Expand Down
Loading