Skip to content

Commit

Permalink
Merge pull request #315 from kubesphere/sync/ks-core
Browse files Browse the repository at this point in the history
Update ks-core helm chart
  • Loading branch information
wansir authored Jul 28, 2023
2 parents 2184e7e + 9035225 commit a973dfa
Show file tree
Hide file tree
Showing 16 changed files with 208 additions and 11 deletions.
101 changes: 101 additions & 0 deletions src/test/ks-core/crds/kubesphere.io_extensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,107 @@ spec:
type: object
status:
properties:
clusterSchedulingStatuses:
additionalProperties:
properties:
conditions:
items:
description: "Condition contains details for one aspect of
the current state of this API Resource. --- This struct
is intended for direct use as an array at the field path
.status.conditions. For example, \n type FooStatus struct{
// Represents the observations of a foo's current state.
// Known .status.conditions.type are: \"Available\", \"Progressing\",
and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
// +listType=map // +listMapKey=type Conditions []metav1.Condition
`json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields
}"
properties:
lastTransitionTime:
description: lastTransitionTime is the last time the condition
transitioned from one status to another. This should
be when the underlying condition changed. If that is
not known, then using the time when the API field changed
is acceptable.
format: date-time
type: string
message:
description: message is a human readable message indicating
details about the transition. This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: observedGeneration represents the .metadata.generation
that the condition was set based upon. For instance,
if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration
is 9, the condition is out of date with respect to the
current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: reason contains a programmatic identifier
indicating the reason for the condition's last transition.
Producers of specific condition types may define expected
values and meanings for this field, and whether the
values are considered a guaranteed API. The value should
be a CamelCase string. This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False,
Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
--- Many .condition.type values are consistent across
resources like Available, but because arbitrary conditions
can be useful (see .node.status.conditions), the ability
to deconflict is important. The regex it matches is
(dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
jobName:
type: string
releaseName:
type: string
state:
type: string
stateHistory:
items:
properties:
lastTransitionTime:
format: date-time
type: string
state:
type: string
required:
- lastTransitionTime
- state
type: object
type: array
targetNamespace:
type: string
type: object
description: ClusterSchedulingStatuses describes the subchart installation
status of the extension
type: object
conditions:
items:
description: "Condition contains details for one aspect of the current
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ spec:
description: workspace number of cluster
type: integer
type: object
syncTime:
description: when to sync data to ksCloud
format: date-time
type: string
ts:
description: collection time
format: date-time
Expand Down
35 changes: 32 additions & 3 deletions src/test/ks-core/templates/builtin-resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ items:
- iam.kubesphere.io
resources:
- users
- roletemplates
- categories
verbs:
- list
- apiGroups:
Expand Down Expand Up @@ -191,6 +193,20 @@ items:
- workspacetemplates
verbs:
- patch
- apiGroups:
- extensions.kubesphere.io
resources:
- jsbundles
verbs:
- get
- list
- apiGroups:
- kubesphere.io
resources:
- extensions
verbs:
- get
- list
- aggregationRoleTemplates:
roleSelector:
matchLabels:
Expand Down Expand Up @@ -465,7 +481,7 @@ items:
aggregationRoleTemplates:
roleSelectors:
- matchLabels:
scope.iam.kubesphere.io/workspace: ""
iam.kubesphere.io/aggregate-to-admin: ""
templateNames:
- workspace-manage-workspace-settings
- workspace-view-workspace-settings
Expand All @@ -488,6 +504,8 @@ items:
annotations:
iam.kubesphere.io/aggregation-roles: '["workspace-manage-workspace-settings","workspace-view-workspace-settings","workspace-manage-projects","workspace-view-projects","workspace-create-projects","workspace-manage-app-templates","workspace-view-app-templates","workspace-manage-app-repos","workspace-view-app-repos","workspace-view-members","workspace-manage-members","workspace-manage-roles","workspace-view-roles","workspace-manage-groups","workspace-view-groups"]'
kubesphere.io/creator: system
labels:
iam.kubesphere.io/auto-aggregate: "true"
name: admin
rules:
- apiGroups:
Expand All @@ -504,13 +522,18 @@ items:
scope.iam.kubesphere.io/workspace: ""
role:
aggregationRoleTemplates:
roleSelector:
matchLabels:
iam.kubesphere.io/aggregate-to-regular: ""
templateNames:
- workspace-view-workspace-settings
apiVersion: iam.kubesphere.io/v1beta1
kind: WorkspaceRole
metadata:
annotations:
kubesphere.io/creator: system
labels:
iam.kubesphere.io/auto-aggregate: "true"
name: regular
rules:
- apiGroups:
Expand All @@ -530,6 +553,9 @@ items:
scope.iam.kubesphere.io/workspace: ""
role:
aggregationRoleTemplates:
roleSelector:
matchLabels:
iam.kubesphere.io/aggregate-to-self-provisioner: ""
templateNames:
- workspace-create-projects
- workspace-view-app-templates
Expand All @@ -541,6 +567,8 @@ items:
annotations:
iam.kubesphere.io/aggregation-roles: '["workspace-create-projects","workspace-view-app-templates","workspace-manage-app-templates","workspace-view-workspace-settings"]'
kubesphere.io/creator: system
labels:
iam.kubesphere.io/auto-aggregate: "true"
name: self-provisioner
rules:
- apiGroups:
Expand Down Expand Up @@ -573,8 +601,7 @@ items:
aggregationRoleTemplates:
roleSelector:
matchLabels:
iam.kubesphere.io/resource: view
scope.iam.kubesphere.io/workspace: ""
iam.kubesphere.io/aggregate-to-viewer: ""
templateNames:
- workspace-view-projects
- workspace-view-app-templates
Expand All @@ -589,6 +616,8 @@ items:
annotations:
iam.kubesphere.io/aggregation-roles: '["workspace-view-projects","workspace-view-app-templates","workspace-view-app-repos","workspace-view-members","workspace-view-roles","workspace-view-groups","workspace-view-workspace-settings"]'
kubesphere.io/creator: system
labels:
iam.kubesphere.io/auto-aggregate: "true"
name: viewer
rules:
- apiGroups:
Expand Down
1 change: 1 addition & 0 deletions src/test/ks-core/templates/ks-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
tier: backend
version: {{ .Chart.AppVersion }}
name: ks-agent
namespace: kubesphere-system
spec:
strategy:
rollingUpdate:
Expand Down
1 change: 1 addition & 0 deletions src/test/ks-core/templates/ks-apiserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
tier: backend
version: {{ .Chart.AppVersion }}
name: ks-apiserver
namespace: kubesphere-system
spec:
strategy:
rollingUpdate:
Expand Down
1 change: 1 addition & 0 deletions src/test/ks-core/templates/ks-console-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ data:
kind: ConfigMap
metadata:
name: ks-console-config
namespace: kubesphere-system
1 change: 1 addition & 0 deletions src/test/ks-core/templates/ks-console.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
tier: frontend
version: {{ .Chart.AppVersion }}
name: ks-console
namespace: kubesphere-system
spec:
strategy:
rollingUpdate:
Expand Down
1 change: 1 addition & 0 deletions src/test/ks-core/templates/ks-controller-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
tier: backend
version: {{ .Chart.AppVersion }}
name: ks-controller-manager
namespace: kubesphere-system
spec:
strategy:
rollingUpdate:
Expand Down
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 @@ -3,6 +3,7 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: kubesphere-config
namespace: kubesphere-system
data:
kubesphere.yaml: |
authentication:
Expand Down
1 change: 1 addition & 0 deletions src/test/ks-core/templates/marketplace-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ stringData:
kind: Secret
metadata:
name: marketplace
namespace: kubesphere-system
type: config.kubesphere.io/marketplace
17 changes: 17 additions & 0 deletions src/test/ks-core/templates/post-install-job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: batch/v1
kind: Job
metadata:
name: "{{ .Release.Name }}-post-install"
annotations:
"helm.sh/hook": post-install
"helm.sh/hook-weight": "-5"
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
spec:
template:
spec:
restartPolicy: Never
serviceAccountName: {{ include "ks-core.serviceAccountName" . }}
containers:
- name: post-install-job
image: "kubesphere/kubectl:v1.27.4"
command: ["/bin/bash","-c","for ns in kubesphere-system default kube-system; do kubectl label ns $ns kubesphere.io/workspace=system-workspace; done;"]
36 changes: 36 additions & 0 deletions src/test/ks-core/templates/pre-delete-job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: batch/v1
kind: Job
metadata:
name: "{{ .Release.Name }}-pre-delete"
annotations:
"helm.sh/hook": pre-delete
"helm.sh/hook-weight": "-5"
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
spec:
template:
spec:
restartPolicy: Never
serviceAccountName: {{ include "ks-core.serviceAccountName" . }}
containers:
- name: pre-delete-job
image: "kubesphere/kubectl:v1.27.4"
command:
- /bin/bash
- -c
- |
kubectl -n kubesphere-system scale deploy ks-controller-manager --replicas=0
until [ "$(kubectl -n kube-system get deploy ks-controller-manager -o jsonpath='{.status.readyReplicas}')" = "" ];
do
echo "ks-controller-manager is running......"
sleep 1s
done
kubectl patch workspaces.tenant.kubesphere.io system-workspace -p '{"metadata":{"finalizers":[]}}' --type=merge
kubectl patch workspacetemplates.tenant.kubesphere.io system-workspace -p '{"metadata":{"finalizers":[]}}' --type=merge
for ns in $(kubectl get ns -o jsonpath='{.items[*].metadata.name}')
do
kubectl label ns $ns kubesphere.io/workspace- && \
kubectl patch ns $ns -p '{"metadata":{"ownerReferences":[]}}' --type=merge && \
echo "{\"kind\":\"Namespace\",\"apiVersion\":\"v1\",\"metadata\":{\"name\":\"$ns\",\"finalizers\":null}}" | kubectl replace --raw "/api/v1/namespaces/$ns/finalize" -f -
done

3 changes: 2 additions & 1 deletion src/test/ks-core/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "ks-core.serviceAccountName" . }}
namespace: kubesphere-system
labels:
{{- include "ks-core.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
Expand All @@ -23,4 +24,4 @@ roleRef:
subjects:
- kind: ServiceAccount
name: {{ include "ks-core.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
namespace: kubesphere-system
2 changes: 2 additions & 0 deletions src/test/ks-core/templates/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ metadata:
tier: backend
version: {{ .Chart.AppVersion }}
name: ks-apiserver
namespace: kubesphere-system
spec:
ports:
- port: 80
Expand Down Expand Up @@ -40,6 +41,7 @@ metadata:
tier: backend
version: {{ .Chart.AppVersion }}
name: ks-controller-manager
namespace: kubesphere-system
spec:
ports:
- port: 443
Expand Down
Loading

0 comments on commit a973dfa

Please sign in to comment.