From c28b28d487de379811a197ce07bef394f8a9497b Mon Sep 17 00:00:00 2001 From: Michal Skwierczynski Date: Thu, 2 Jul 2026 15:34:05 +0200 Subject: [PATCH] Added possibility to add env variables to ado agent cleaner chart --- charts/ado-agent-cleaner/Chart.yaml | 2 +- charts/ado-agent-cleaner/templates/cronjob.yaml | 3 +++ charts/ado-agent-cleaner/values.yaml | 16 +++++++++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/charts/ado-agent-cleaner/Chart.yaml b/charts/ado-agent-cleaner/Chart.yaml index a73146b..e3ef69b 100644 --- a/charts/ado-agent-cleaner/Chart.yaml +++ b/charts/ado-agent-cleaner/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 description: Helper to clean up stale AKS Azure DevOps agents name: charts-ado-agent-cleaner -version: 1.0.1 +version: 1.1.0 appVersion: "1.0" \ No newline at end of file diff --git a/charts/ado-agent-cleaner/templates/cronjob.yaml b/charts/ado-agent-cleaner/templates/cronjob.yaml index bebfa7d..837a9c7 100644 --- a/charts/ado-agent-cleaner/templates/cronjob.yaml +++ b/charts/ado-agent-cleaner/templates/cronjob.yaml @@ -28,5 +28,8 @@ spec: env: - name: AZP_URL value: "{{ .Values.devopsOrgUrl }}" + {{- with .Values.extraEnv }} + {{- toYaml . | nindent 14 }} + {{- end }} resources: {{ toYaml .Values.resources | nindent 14 }} \ No newline at end of file diff --git a/charts/ado-agent-cleaner/values.yaml b/charts/ado-agent-cleaner/values.yaml index b4e4e15..40036ad 100644 --- a/charts/ado-agent-cleaner/values.yaml +++ b/charts/ado-agent-cleaner/values.yaml @@ -7,6 +7,18 @@ podName: agent-cleaner # Container Image Name for the Agent Cleaner imageName: aksagentcleaner:1.0.0 +# Additional environment variables to add to the Agent Cleaner container. +# By default nothing is added. Provide a list of standard Kubernetes env entries, e.g.: +# extraEnv: +# - name: MY_VAR +# value: "my-value" +# - name: MY_SECRET +# valueFrom: +# secretKeyRef: +# name: my-secret +# key: my-key +extraEnv: [] + # Settings specific for the CronJob cronSettings: schedule: "*/30 * * * *" @@ -23,4 +35,6 @@ resources: memory: 128Mi requests: cpu: 50m - memory: 64Mi \ No newline at end of file + memory: 64Mi + + \ No newline at end of file