[YUNIKORN-1681] Add ability to attach custom labels to pods (#133)
Signed-off-by: Rafał Boniecki <rafal@boniecki.cc>
Closes: #133
Signed-off-by: Craig Condit <ccondit@apache.org>
diff --git a/helm-charts/yunikorn/README.md b/helm-charts/yunikorn/README.md
index 2d29cbf..4824d97 100644
--- a/helm-charts/yunikorn/README.md
+++ b/helm-charts/yunikorn/README.md
@@ -72,6 +72,8 @@
| `pluginImage.repository` | Scheduler plugin image repository | `apache/yunikorn` |
| `pluginImage.tag` | Scheduler plugin image tag | `scheduler-plugin-latest` |
| `pluginImage.pullPolicy` | Scheduler plugin image pull policy | `Always` |
+| `podLabels` | Scheduler pod labels | `{}` |
+| `admissionController.podLabels` | Admission controller pod labels | `{}` |
| `admissionController.replicaCount` | Admission controller replicas to be deployed | `1` |
| `admissionController.serviceAccount` | Admission controller service account name | `yunikorn-admission-controller` |
| `admissionController.image.repository` | Admission controller image repository | `apache/yunikorn` |
diff --git a/helm-charts/yunikorn/templates/admission-controller-deployment.yaml b/helm-charts/yunikorn/templates/admission-controller-deployment.yaml
index 4e829e4..defc06d 100644
--- a/helm-charts/yunikorn/templates/admission-controller-deployment.yaml
+++ b/helm-charts/yunikorn/templates/admission-controller-deployment.yaml
@@ -43,6 +43,9 @@
app: yunikorn
component: yunikorn-admission-controller
release: {{ .Release.Name }}
+ {{- with .Values.admissionController.podLabels }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
spec:
{{- if .Values.admissionController.hostNetwork }}
hostNetwork: true
diff --git a/helm-charts/yunikorn/templates/deployment.yaml b/helm-charts/yunikorn/templates/deployment.yaml
index 2b9e2f2..bff9c81 100644
--- a/helm-charts/yunikorn/templates/deployment.yaml
+++ b/helm-charts/yunikorn/templates/deployment.yaml
@@ -41,6 +41,9 @@
app: yunikorn
component: yunikorn-scheduler
release: {{ .Release.Name }}
+ {{- with .Values.podLabels }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
spec:
{{- if .Values.hostNetwork }}
hostNetwork: true
diff --git a/helm-charts/yunikorn/values.yaml b/helm-charts/yunikorn/values.yaml
index 7f5107c..573aa8a 100644
--- a/helm-charts/yunikorn/values.yaml
+++ b/helm-charts/yunikorn/values.yaml
@@ -67,6 +67,7 @@
bypassNamespaces: null # deprecated; use admissionController.filtering.bypassNamespaces in yunikornDefaults
labelNamespaces: null # deprecated; use admissionController.filtering.labelNamespaces in yunikornDefaults
noLabelNamespaces: null # deprecated; use admissionController.filtering.noLabelNamespaces in yunikornDefaults
+ podLabels: {}
web:
image:
@@ -120,3 +121,5 @@
# When this flag is true, the scheduler will be deployed as Kubernetes scheduler plugin.
# When this flag is false, the scheduler will be deployed as a standalone scheduler.
enableSchedulerPlugin: false
+
+podLabels: {}