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 12, 2024
1 parent 8ea1176 commit 7729dd7
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 82 deletions.
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
7 changes: 0 additions & 7 deletions src/test/ks-core/templates/globalroles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,6 @@ rules:
verbs:
- get
- list
- apiGroups:
- license.kubesphere.io
resources:
- licenses
verbs:
- get
- list
- apiGroups:
- cluster.kubesphere.io
resources:
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
68 changes: 0 additions & 68 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 Expand Up @@ -317,41 +284,6 @@ webhooks:

---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: license.kubesphere.io
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
caBundle: {{ b64enc $ca.Cert | quote }}
service:
name: ks-controller-manager
namespace: kubesphere-system
path: /license-cluster-checker
port: 443
name: license-cluster-checker.kubesphere.io
failurePolicy: Ignore
matchPolicy: Exact
namespaceSelector: {}
objectSelector:
matchExpressions:
- key: cluster-role.kubesphere.io/host
operator: DoesNotExist
rules:
- apiGroups:
- cluster.kubesphere.io
apiVersions:
- v1alpha1
operations:
- CREATE
resources:
- clusters
scope: '*'
sideEffects: None
timeoutSeconds: 30
---
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
name: defaulter.config.kubesphere.io
Expand Down

0 comments on commit 7729dd7

Please sign in to comment.