30 lines
1.2 KiB
YAML
30 lines
1.2 KiB
YAML
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: "{{ .Release.Name }}-post-patch-system-ns"
|
|
annotations:
|
|
"helm.sh/hook": post-install,post-upgrade
|
|
"helm.sh/hook-weight": "-5"
|
|
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
|
|
spec:
|
|
template:
|
|
spec:
|
|
restartPolicy: Never
|
|
serviceAccountName: {{ include "ks-core.serviceAccountName" . }}
|
|
{{- if .Values.global.imagePullSecrets }}
|
|
imagePullSecrets: {{ toYaml .Values.global.imagePullSecrets | nindent 8 }}
|
|
{{- end }}
|
|
containers:
|
|
- name: post-patch-system-ns
|
|
image: {{ template "kubectl.image" . }}
|
|
command:
|
|
- /bin/bash
|
|
- -c
|
|
- |
|
|
kubectl create namespace kubesphere-controls-system --dry-run=client -o yaml | kubectl apply -f -
|
|
for ns in kubesphere-system kubesphere-controls-system default kube-node-lease kube-public kube-system;
|
|
do
|
|
kubectl label ns $ns kubesphere.io/workspace=system-workspace
|
|
kubectl label ns $ns kubesphere.io/managed=true
|
|
kubectl label ns $ns kubesphere.io/protected-resource=true
|
|
done |