2020-09-18 15:18:59 +00:00
|
|
|
{{- if .Values.annotateKubeSystemNameSpace }}
|
2020-05-18 17:12:02 +00:00
|
|
|
apiVersion: v1
|
|
|
|
kind: ServiceAccount
|
|
|
|
metadata:
|
|
|
|
labels:
|
2020-05-19 10:28:38 +00:00
|
|
|
{{ include "kubezero-lib.labels" . | indent 4 }}
|
2020-05-18 17:12:02 +00:00
|
|
|
name: kiam-namespace-annotate
|
|
|
|
---
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
|
|
|
kind: ClusterRole
|
|
|
|
metadata:
|
|
|
|
labels:
|
2020-05-19 10:28:38 +00:00
|
|
|
{{ include "kubezero-lib.labels" . | indent 4 }}
|
2020-05-18 17:12:02 +00:00
|
|
|
name: kiam-namespace-annotate
|
|
|
|
rules:
|
|
|
|
- apiGroups:
|
|
|
|
- ""
|
|
|
|
resources:
|
|
|
|
- namespaces
|
|
|
|
verbs:
|
2020-05-18 17:25:41 +00:00
|
|
|
- get
|
|
|
|
- list
|
2020-05-18 17:12:02 +00:00
|
|
|
- update
|
|
|
|
- patch
|
|
|
|
---
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
|
|
|
kind: ClusterRoleBinding
|
|
|
|
metadata:
|
|
|
|
labels:
|
2020-05-19 10:28:38 +00:00
|
|
|
{{ include "kubezero-lib.labels" . | indent 4 }}
|
2020-05-18 17:12:02 +00:00
|
|
|
name: kiam-namespace-annotate
|
|
|
|
roleRef:
|
|
|
|
apiGroup: rbac.authorization.k8s.io
|
|
|
|
kind: ClusterRole
|
|
|
|
name: kiam-namespace-annotate
|
|
|
|
subjects:
|
|
|
|
- kind: ServiceAccount
|
|
|
|
name: kiam-namespace-annotate
|
|
|
|
namespace: kube-system
|
|
|
|
---
|
2020-05-18 15:24:57 +00:00
|
|
|
apiVersion: batch/v1
|
|
|
|
kind: Job
|
|
|
|
metadata:
|
|
|
|
name: kiam-kube-system-ns-annotation
|
|
|
|
namespace: kube-system
|
|
|
|
annotations:
|
2020-05-19 10:28:38 +00:00
|
|
|
argocd.argoproj.io/hook: Sync
|
2020-05-18 15:24:57 +00:00
|
|
|
argocd.argoproj.io/hook-delete-policy: HookSucceeded
|
|
|
|
labels:
|
2020-05-19 10:28:38 +00:00
|
|
|
{{ include "kubezero-lib.labels" . | indent 4 }}
|
2020-05-18 15:24:57 +00:00
|
|
|
spec:
|
|
|
|
template:
|
|
|
|
spec:
|
2020-05-18 17:12:02 +00:00
|
|
|
serviceAccountName: kiam-namespace-annotate
|
2020-05-18 15:24:57 +00:00
|
|
|
containers:
|
|
|
|
- name: kubectl
|
|
|
|
image: "bitnami/kubectl:latest"
|
|
|
|
imagePullPolicy: "IfNotPresent"
|
|
|
|
command:
|
|
|
|
- /bin/sh
|
|
|
|
- -c
|
|
|
|
- kubectl annotate --overwrite namespace kube-system 'iam.amazonaws.com/permitted=.*'
|
|
|
|
restartPolicy: Never
|
2020-06-30 13:56:20 +00:00
|
|
|
tolerations:
|
|
|
|
- effect: NoSchedule
|
|
|
|
key: node-role.kubernetes.io/master
|
2020-09-18 15:18:59 +00:00
|
|
|
{{- end }}
|