feat: helm common labels for all resources

Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
This commit is contained in:
Amir Alavi 2023-11-29 17:06:55 -05:00
parent 01b086d2e1
commit ee243386b5
No known key found for this signature in database
GPG Key ID: 9BFF951CCD6037E7
13 changed files with 164 additions and 1 deletions

View File

@ -8,12 +8,21 @@
{{- default .Release.Namespace -}} {{- default .Release.Namespace -}}
{{- end -}} {{- end -}}
{{- define "karmada.commonLabels" -}}
{{- if .Values.global.commonLabels -}}
{{- range $key, $value := .Values.global.commonLabels }}
{{ $key }}: {{ $value | quote }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- define "karmada.apiserver.labels" -}} {{- define "karmada.apiserver.labels" -}}
{{- if .Values.apiServer.labels }} {{- if .Values.apiServer.labels }}
{{- range $key, $value := .Values.apiServer.labels }} {{- range $key, $value := .Values.apiServer.labels }}
{{ $key }}: {{ $value }} {{ $key }}: {{ $value }}
{{- end }} {{- end }}
{{- else}} {{- else}}
{{- include "karmada.commonLabels" . -}}
app: {{- include "karmada.name" .}}-apiserver app: {{- include "karmada.name" .}}-apiserver
{{- end }} {{- end }}
{{- end -}} {{- end -}}
@ -29,9 +38,10 @@ app: {{- include "karmada.name" .}}-apiserver
{{- define "karmada.etcd.labels" -}} {{- define "karmada.etcd.labels" -}}
{{- if .Values.etcd.labels }} {{- if .Values.etcd.labels }}
{{- range $key, $value := .Values.etcd.labels }} {{- range $key, $value := .Values.etcd.labels }}
{{ $key }}: {{ $value }} {{ $key }}: {{ $value | quote }}
{{- end }} {{- end }}
{{- else}} {{- else}}
{{- include "karmada.commonLabels" . -}}
app: etcd app: etcd
{{- end }} {{- end }}
{{- end -}} {{- end -}}
@ -52,6 +62,7 @@ app: etcd
{{- else}} {{- else}}
app: {{- include "karmada.name" .}}-aggregated-apiserver app: {{- include "karmada.name" .}}-aggregated-apiserver
{{- end }} {{- end }}
{{- include "karmada.commonLabels" . -}}
{{- end -}} {{- end -}}
{{- define "karmada.aggregatedApiServer.podLabels" -}} {{- define "karmada.aggregatedApiServer.podLabels" -}}
@ -88,6 +99,7 @@ app: {{- include "karmada.name" .}}-metrics-adapter
{{- else}} {{- else}}
app: {{- include "karmada.name" .}}-kube-controller-manager app: {{- include "karmada.name" .}}-kube-controller-manager
{{- end }} {{- end }}
{{- include "karmada.commonLabels" . -}}
{{- end -}} {{- end -}}
{{- define "karmada.kube-cm.podLabels" -}} {{- define "karmada.kube-cm.podLabels" -}}
@ -129,6 +141,7 @@ certificate-authority-data: {{ b64enc .Values.certs.custom.caCrt }}
{{- else -}} {{- else -}}
app: {{$name}}-controller-manager app: {{$name}}-controller-manager
{{- end -}} {{- end -}}
{{- include "karmada.commonLabels" . -}}
{{- end -}} {{- end -}}
{{- define "karmada.cm.podLabels" -}} {{- define "karmada.cm.podLabels" -}}
@ -149,6 +162,7 @@ app: {{$name}}-controller-manager
{{- else -}} {{- else -}}
app: {{$name}}-scheduler app: {{$name}}-scheduler
{{- end -}} {{- end -}}
{{- include "karmada.commonLabels" . -}}
{{- end -}} {{- end -}}
{{- define "karmada.scheduler.podLabels" -}} {{- define "karmada.scheduler.podLabels" -}}
@ -169,6 +183,7 @@ app: {{$name}}-scheduler
{{- else -}} {{- else -}}
app: {{$name}} app: {{$name}}
{{- end -}} {{- end -}}
{{- include "karmada.commonLabels" . -}}
{{- end -}} {{- end -}}
{{- define "karmada.descheduler.podLabels" -}} {{- define "karmada.descheduler.podLabels" -}}
@ -202,6 +217,7 @@ app: {{$name}}
{{- else}} {{- else}}
app: {{$name}}-webhook app: {{$name}}-webhook
{{- end }} {{- end }}
{{- include "karmada.commonLabels" . -}}
{{- end -}} {{- end -}}
{{- define "karmada.webhook.podLabels" -}} {{- define "karmada.webhook.podLabels" -}}
@ -221,6 +237,7 @@ app: {{$name}}-webhook
{{- else}} {{- else}}
app: {{$name}} app: {{$name}}
{{- end }} {{- end }}
{{- include "karmada.commonLabels" . -}}
{{- end -}} {{- end -}}
{{- define "karmada.agent.podLabels" -}} {{- define "karmada.agent.podLabels" -}}
@ -263,6 +280,7 @@ caBundle: {{ b64enc .Values.certs.custom.caCrt }}
{{ $key }}: {{ $value }} {{ $key }}: {{ $value }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- include "karmada.commonLabels" . -}}
{{- end -}} {{- end -}}
{{- define "karmada.search.labels" -}} {{- define "karmada.search.labels" -}}
@ -273,6 +291,7 @@ caBundle: {{ b64enc .Values.certs.custom.caCrt }}
{{- else}} {{- else}}
app: {{- include "karmada.name" .}}-search app: {{- include "karmada.name" .}}-search
{{- end }} {{- end }}
{{- include "karmada.commonLabels" . -}}
{{- end -}} {{- end -}}
{{- define "karmada.search.podLabels" -}} {{- define "karmada.search.podLabels" -}}
@ -283,6 +302,18 @@ app: {{- include "karmada.name" .}}-search
{{- end }} {{- end }}
{{- end -}} {{- end -}}
{{- define "karmada.preInstallJob.labels" -}}
{{- include "karmada.commonLabels" . -}}
{{- end -}}
{{- define "karmada.postInstallJob.labels" -}}
{{- include "karmada.commonLabels" . -}}
{{- end -}}
{{- define "karmada.postDeleteJob.labels" -}}
{{- include "karmada.commonLabels" . -}}
{{- end -}}
{{- define "karmada.search.kubeconfig.volume" -}} {{- define "karmada.search.kubeconfig.volume" -}}
{{ $name := include "karmada.name" . }} {{ $name := include "karmada.name" . }}
{{- if eq .Values.installMode "host" -}} {{- if eq .Values.installMode "host" -}}

View File

@ -14,6 +14,7 @@ metadata:
kubernetes.io/bootstrapping: rbac-defaults kubernetes.io/bootstrapping: rbac-defaults
# used to aggregate rules to view clusterrole # used to aggregate rules to view clusterrole
rbac.authorization.k8s.io/aggregate-to-view: "true" rbac.authorization.k8s.io/aggregate-to-view: "true"
{{- include "karmada.commonLabels" . | nindent 4 }}
name: karmada-view name: karmada-view
rules: rules:
- apiGroups: - apiGroups:
@ -83,6 +84,7 @@ metadata:
kubernetes.io/bootstrapping: rbac-defaults kubernetes.io/bootstrapping: rbac-defaults
# used to aggregate rules to view clusterrole # used to aggregate rules to view clusterrole
rbac.authorization.k8s.io/aggregate-to-edit: "true" rbac.authorization.k8s.io/aggregate-to-edit: "true"
{{- include "karmada.commonLabels" . | nindent 4 }}
name: karmada-edit name: karmada-edit
rules: rules:
- apiGroups: - apiGroups:

View File

@ -10,6 +10,7 @@ metadata:
labels: labels:
app: {{ $name }}-aggregated-apiserver app: {{ $name }}-aggregated-apiserver
apiserver: "true" apiserver: "true"
{{- include "karmada.commonLabels" . | nindent 4 }}
spec: spec:
{{- include "karmada.apiserver.caBundle" . | nindent 2 }} {{- include "karmada.apiserver.caBundle" . | nindent 2 }}
group: cluster.karmada.io group: cluster.karmada.io
@ -25,6 +26,9 @@ kind: Service
metadata: metadata:
name: {{ $name }}-aggregated-apiserver name: {{ $name }}-aggregated-apiserver
namespace: {{ $systemNamespace }} namespace: {{ $systemNamespace }}
labels:
app: {{ $name }}-aggregated-apiserver
{{- include "karmada.commonLabels" . | nindent 4 }}
spec: spec:
type: ExternalName type: ExternalName
externalName: {{ $name }}-aggregated-apiserver.{{ include "karmada.namespace" . }}.svc.{{ .Values.clusterDomain }} externalName: {{ $name }}-aggregated-apiserver.{{ include "karmada.namespace" . }}.svc.{{ .Values.clusterDomain }}
@ -98,6 +102,7 @@ metadata:
labels: labels:
app: {{ $name }}-search app: {{ $name }}-search
apiserver: "true" apiserver: "true"
{{- include "karmada.commonLabels" . | nindent 4 }}
spec: spec:
{{- include "karmada.apiserver.caBundle" . | nindent 2 }} {{- include "karmada.apiserver.caBundle" . | nindent 2 }}
group: search.karmada.io group: search.karmada.io
@ -113,6 +118,9 @@ kind: Service
metadata: metadata:
name: {{ $name }}-search name: {{ $name }}-search
namespace: {{ $systemNamespace }} namespace: {{ $systemNamespace }}
labels:
app: {{ $name }}-search
{{- include "karmada.commonLabels" . | nindent 4 }}
spec: spec:
type: ExternalName type: ExternalName
externalName: {{ $name }}-search.{{ include "karmada.namespace" . }}.svc.{{ .Values.clusterDomain }} externalName: {{ $name }}-search.{{ include "karmada.namespace" . }}.svc.{{ .Values.clusterDomain }}

View File

@ -7,6 +7,10 @@ kind: ConfigMap
metadata: metadata:
name: cluster-info name: cluster-info
namespace: kube-public namespace: kube-public
{{- if "karmada.commonLabels" }}
labels:
{{- include "karmada.commonLabels" . | nindent 4 }}
{{- end }}
data: data:
kubeconfig: | kubeconfig: |
apiVersion: v1 apiVersion: v1
@ -21,6 +25,10 @@ kind: Role
metadata: metadata:
name: karmada:bootstrap-signer-clusterinfo name: karmada:bootstrap-signer-clusterinfo
namespace: kube-public namespace: kube-public
{{- if "karmada.commonLabels" }}
labels:
{{- include "karmada.commonLabels" . | nindent 4 }}
{{- end }}
rules: rules:
- apiGroups: - apiGroups:
- "" - ""
@ -36,6 +44,10 @@ kind: RoleBinding
metadata: metadata:
name: karmada:bootstrap-signer-clusterinfo name: karmada:bootstrap-signer-clusterinfo
namespace: kube-public namespace: kube-public
{{- if "karmada.commonLabels" }}
labels:
{{- include "karmada.commonLabels" . | nindent 4 }}
{{- end }}
roleRef: roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
kind: Role kind: Role
@ -49,6 +61,10 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding kind: ClusterRoleBinding
metadata: metadata:
name: karmada:agent-bootstrap name: karmada:agent-bootstrap
{{- if "karmada.commonLabels" }}
labels:
{{- include "karmada.commonLabels" . | nindent 4 }}
{{- end }}
roleRef: roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
kind: ClusterRole kind: ClusterRole
@ -62,6 +78,10 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding kind: ClusterRoleBinding
metadata: metadata:
name: karmada:agent-autoapprove-bootstrap name: karmada:agent-autoapprove-bootstrap
{{- if "karmada.commonLabels" }}
labels:
{{- include "karmada.commonLabels" . | nindent 4 }}
{{- end }}
roleRef: roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
kind: ClusterRole kind: ClusterRole
@ -75,6 +95,10 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding kind: ClusterRoleBinding
metadata: metadata:
name: karmada:agent-autoapprove-certificate-rotation name: karmada:agent-autoapprove-certificate-rotation
{{- if "karmada.commonLabels" }}
labels:
{{- include "karmada.commonLabels" . | nindent 4 }}
{{- end }}
roleRef: roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
kind: ClusterRole kind: ClusterRole
@ -88,6 +112,10 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole kind: ClusterRole
metadata: metadata:
name: system:karmada:agent name: system:karmada:agent
{{- if "karmada.commonLabels" }}
labels:
{{- include "karmada.commonLabels" . | nindent 4 }}
{{- end }}
rules: rules:
- apiGroups: - apiGroups:
- authentication.k8s.io - authentication.k8s.io
@ -191,6 +219,10 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding kind: ClusterRoleBinding
metadata: metadata:
name: system:karmada:agent name: system:karmada:agent
{{- if "karmada.commonLabels" }}
labels:
{{- include "karmada.commonLabels" . | nindent 4 }}
{{- end }}
roleRef: roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
kind: ClusterRole kind: ClusterRole

View File

@ -5,6 +5,10 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole kind: ClusterRole
metadata: metadata:
name: {{ $name }}-cluster-proxy-admin name: {{ $name }}-cluster-proxy-admin
{{- if "karmada.commonLabels" }}
labels:
{{- include "karmada.commonLabels" . | nindent 4 }}
{{- end }}
rules: rules:
- apiGroups: - apiGroups:
- 'cluster.karmada.io' - 'cluster.karmada.io'
@ -17,6 +21,10 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding kind: ClusterRoleBinding
metadata: metadata:
name: {{ $name }}-cluster-proxy-admin name: {{ $name }}-cluster-proxy-admin
{{- if "karmada.commonLabels" }}
labels:
{{- include "karmada.commonLabels" . | nindent 4 }}
{{- end }}
roleRef: roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
kind: ClusterRole kind: ClusterRole

View File

@ -4,9 +4,17 @@ apiVersion: v1
kind: Namespace kind: Namespace
metadata: metadata:
name: {{ .Values.systemNamespace }} name: {{ .Values.systemNamespace }}
{{- if "karmada.commonLabels" }}
labels:
{{- include "karmada.commonLabels" . | nindent 4 }}
{{- end }}
--- ---
apiVersion: v1 apiVersion: v1
kind: Namespace kind: Namespace
metadata: metadata:
name: karmada-cluster name: karmada-cluster
{{- if "karmada.commonLabels" }}
labels:
{{- include "karmada.commonLabels" . | nindent 4 }}
{{- end }}
{{- end -}} {{- end -}}

View File

@ -8,6 +8,7 @@ metadata:
name: mutating-config name: mutating-config
labels: labels:
app: mutating-config app: mutating-config
{{- include "karmada.commonLabels" . | nindent 4 }}
webhooks: webhooks:
- name: propagationpolicy.karmada.io - name: propagationpolicy.karmada.io
rules: rules:
@ -86,6 +87,7 @@ metadata:
name: validating-config name: validating-config
labels: labels:
app: validating-config app: validating-config
{{- include "karmada.commonLabels" . | nindent 4 }}
webhooks: webhooks:
- name: propagationpolicy.karmada.io - name: propagationpolicy.karmada.io
rules: rules:

View File

@ -8,6 +8,10 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition kind: CustomResourceDefinition
metadata: metadata:
name: clusterresourcebindings.work.karmada.io name: clusterresourcebindings.work.karmada.io
{{- if "karmada.commonLabels" }}
labels:
{{- include "karmada.commonLabels" . | nindent 4 }}
{{- end }}
spec: spec:
conversion: conversion:
strategy: Webhook strategy: Webhook

View File

@ -8,6 +8,10 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition kind: CustomResourceDefinition
metadata: metadata:
name: resourcebindings.work.karmada.io name: resourcebindings.work.karmada.io
{{- if "karmada.commonLabels" }}
labels:
{{- include "karmada.commonLabels" . | nindent 4 }}
{{- end }}
spec: spec:
conversion: conversion:
strategy: Webhook strategy: Webhook

View File

@ -8,6 +8,7 @@ metadata:
namespace: {{ $namespace }} namespace: {{ $namespace }}
labels: labels:
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
{{- include "karmada.postDeleteJob.labels" . | nindent 4 }}
annotations: annotations:
# This is what defines this resource as a hook. Without this line, the # This is what defines this resource as a hook. Without this line, the
# job is considered part of the release. # job is considered part of the release.

View File

@ -11,6 +11,7 @@ metadata:
app.kubernetes.io/instance: {{ $name | quote }} app.kubernetes.io/instance: {{ $name | quote }}
app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
{{- include "karmada.postInstallJob.labels" . | nindent 4 }}
annotations: annotations:
# This is what defines this resource as a hook. Without this line, the # This is what defines this resource as a hook. Without this line, the
# job is considered part of the release. # job is considered part of the release.

View File

@ -10,6 +10,10 @@ metadata:
annotations: annotations:
"helm.sh/hook": pre-install "helm.sh/hook": pre-install
"helm.sh/hook-weight": "2" "helm.sh/hook-weight": "2"
{{- if "karmada.preInstallJob.labels" }}
labels:
{{- include "karmada.preInstallJob.labels" . | nindent 4 }}
{{- end }}
data: data:
{{ range $path, $bytes := .Files.Glob (printf "_crds/kustomization.yaml")}} {{ range $path, $bytes := .Files.Glob (printf "_crds/kustomization.yaml")}}
{{ $name := base $path }} {{ $name := base $path }}
@ -26,6 +30,10 @@ metadata:
annotations: annotations:
"helm.sh/hook": pre-install "helm.sh/hook": pre-install
"helm.sh/hook-weight": "2" "helm.sh/hook-weight": "2"
{{- if "karmada.preInstallJob.labels" }}
labels:
{{- include "karmada.preInstallJob.labels" . | nindent 4 }}
{{- end }}
data: data:
{{ range $path, $bytes := .Files.Glob (printf "_crds/bases/autoscaling/**")}} {{ range $path, $bytes := .Files.Glob (printf "_crds/bases/autoscaling/**")}}
{{ $name := base $path }} {{ $name := base $path }}
@ -42,6 +50,10 @@ metadata:
annotations: annotations:
"helm.sh/hook": pre-install "helm.sh/hook": pre-install
"helm.sh/hook-weight": "2" "helm.sh/hook-weight": "2"
{{- if "karmada.preInstallJob.labels" }}
labels:
{{- include "karmada.preInstallJob.labels" . | nindent 4 }}
{{- end }}
data: data:
{{ range $path, $bytes := .Files.Glob (printf "_crds/bases/config/**")}} {{ range $path, $bytes := .Files.Glob (printf "_crds/bases/config/**")}}
{{ $name := base $path }} {{ $name := base $path }}
@ -58,6 +70,10 @@ metadata:
annotations: annotations:
"helm.sh/hook": pre-install "helm.sh/hook": pre-install
"helm.sh/hook-weight": "2" "helm.sh/hook-weight": "2"
{{- if "karmada.preInstallJob.labels" }}
labels:
{{- include "karmada.preInstallJob.labels" . | nindent 4 }}
{{- end }}
data: data:
{{ range $path, $bytes := .Files.Glob (printf "_crds/bases/multicluster/**")}} {{ range $path, $bytes := .Files.Glob (printf "_crds/bases/multicluster/**")}}
{{ $name := base $path }} {{ $name := base $path }}
@ -74,6 +90,10 @@ metadata:
annotations: annotations:
"helm.sh/hook": pre-install "helm.sh/hook": pre-install
"helm.sh/hook-weight": "2" "helm.sh/hook-weight": "2"
{{- if "karmada.preInstallJob.labels" }}
labels:
{{- include "karmada.preInstallJob.labels" . | nindent 4 }}
{{- end }}
data: data:
{{ range $path, $bytes := .Files.Glob (printf "_crds/bases/networking/**")}} {{ range $path, $bytes := .Files.Glob (printf "_crds/bases/networking/**")}}
{{ $name := base $path }} {{ $name := base $path }}
@ -91,6 +111,10 @@ metadata:
annotations: annotations:
"helm.sh/hook": pre-install "helm.sh/hook": pre-install
"helm.sh/hook-weight": "2" "helm.sh/hook-weight": "2"
{{- if "karmada.preInstallJob.labels" }}
labels:
{{- include "karmada.preInstallJob.labels" . | nindent 4 }}
{{- end }}
data: data:
{{ range $path, $bytes := .Files.Glob (printf "_crds/bases/policy/**")}} {{ range $path, $bytes := .Files.Glob (printf "_crds/bases/policy/**")}}
{{ $name := base $path }} {{ $name := base $path }}
@ -107,6 +131,10 @@ metadata:
annotations: annotations:
"helm.sh/hook": pre-install "helm.sh/hook": pre-install
"helm.sh/hook-weight": "2" "helm.sh/hook-weight": "2"
{{- if "karmada.preInstallJob.labels" }}
labels:
{{- include "karmada.preInstallJob.labels" . | nindent 4 }}
{{- end }}
data: data:
{{ range $path, $bytes := .Files.Glob (printf "_crds/bases/work/**")}} {{ range $path, $bytes := .Files.Glob (printf "_crds/bases/work/**")}}
{{ $name := base $path }} {{ $name := base $path }}
@ -124,6 +152,10 @@ metadata:
annotations: annotations:
"helm.sh/hook": pre-install "helm.sh/hook": pre-install
"helm.sh/hook-weight": "2" "helm.sh/hook-weight": "2"
{{- if "karmada.preInstallJob.labels" }}
labels:
{{- include "karmada.preInstallJob.labels" . | nindent 4 }}
{{- end }}
data: data:
{{- print "webhook-configuration.yaml: " | nindent 6 }} |- {{- print "webhook-configuration.yaml: " | nindent 6 }} |-
{{- include "karmada.webhook.configuration" . | nindent 8 }} {{- include "karmada.webhook.configuration" . | nindent 8 }}
@ -146,6 +178,10 @@ metadata:
annotations: annotations:
"helm.sh/hook": pre-install "helm.sh/hook": pre-install
"helm.sh/hook-weight": "2" "helm.sh/hook-weight": "2"
{{- if "karmada.preInstallJob.labels" }}
labels:
{{- include "karmada.preInstallJob.labels" . | nindent 4 }}
{{- end }}
data: data:
{{- print "webhook_in_clusterresourcebindings.yaml: " | nindent 6 }} |- {{- print "webhook_in_clusterresourcebindings.yaml: " | nindent 6 }} |-
{{- include "karmada.crd.patch.webhook.clusterresourcebinding" . | nindent 8 }} {{- include "karmada.crd.patch.webhook.clusterresourcebinding" . | nindent 8 }}
@ -164,6 +200,10 @@ metadata:
annotations: annotations:
"helm.sh/hook": pre-install "helm.sh/hook": pre-install
"helm.sh/hook-weight": "2" "helm.sh/hook-weight": "2"
{{- if "karmada.preInstallJob.labels" }}
labels:
{{- include "karmada.preInstallJob.labels" . | nindent 4 }}
{{- end }}
data: data:
cert.yaml: |- cert.yaml: |-
apiVersion: v1 apiVersion: v1
@ -268,6 +308,10 @@ metadata:
"helm.sh/hook": pre-install "helm.sh/hook": pre-install
"helm.sh/hook-weight": "3" "helm.sh/hook-weight": "3"
"helm.sh/hook-delete-policy": hook-succeeded "helm.sh/hook-delete-policy": hook-succeeded
{{- if "karmada.preInstallJob.labels" }}
labels:
{{- include "karmada.preInstallJob.labels" . | nindent 4 }}
{{- end }}
spec: spec:
parallelism: 1 parallelism: 1
completions: 1 completions: 1
@ -370,6 +414,10 @@ metadata:
annotations: annotations:
"helm.sh/hook": pre-install "helm.sh/hook": pre-install
"helm.sh/hook-weight": "1" "helm.sh/hook-weight": "1"
{{- if "karmada.preInstallJob.labels" }}
labels:
{{- include "karmada.preInstallJob.labels" . | nindent 4 }}
{{- end }}
--- ---
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole kind: ClusterRole
@ -378,6 +426,10 @@ metadata:
annotations: annotations:
"helm.sh/hook": pre-install "helm.sh/hook": pre-install
"helm.sh/hook-weight": "1" "helm.sh/hook-weight": "1"
{{- if "karmada.preInstallJob.labels" }}
labels:
{{- include "karmada.preInstallJob.labels" . | nindent 4 }}
{{- end }}
rules: rules:
- apiGroups: ['*'] - apiGroups: ['*']
resources: ['*'] resources: ['*']
@ -392,6 +444,10 @@ metadata:
annotations: annotations:
"helm.sh/hook": pre-install "helm.sh/hook": pre-install
"helm.sh/hook-weight": "1" "helm.sh/hook-weight": "1"
{{- if "karmada.preInstallJob.labels" }}
labels:
{{- include "karmada.preInstallJob.labels" . | nindent 4 }}
{{- end }}
roleRef: roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
kind: ClusterRole kind: ClusterRole

View File

@ -11,6 +11,12 @@ global:
## - myRegistryKeySecretName ## - myRegistryKeySecretName
imagePullSecrets: [] imagePullSecrets: []
## #param global.commonLabels Common labels applied to all ressources
## E.g.
## commonLabels:
## team: infra
commonLabels: {}
## @karmadaImageVersion the image version of each karmada components ## @karmadaImageVersion the image version of each karmada components
## "latest" is a default value for local installation. ## "latest" is a default value for local installation.
## If update this anchors("&karmadaImageVersion"), also update hack/package-helm-chart.sh. ## If update this anchors("&karmadaImageVersion"), also update hack/package-helm-chart.sh.