From 49beb63ae12c4936163ebcaf8dbc3ea0a0b5c256 Mon Sep 17 00:00:00 2001 From: Zuriel Levi Date: Mon, 15 Dec 2025 22:16:25 +0200 Subject: [PATCH 1/5] delete finished jobs after 30 minutes --- .github/workflows/lint-test.yaml | 2 +- charts/konnector/Chart.yaml | 2 +- charts/konnector/templates/_helpers.tpl | 1 + charts/konnector/values.yaml | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index 88c446c..d2d225e 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -21,7 +21,7 @@ jobs: - name: Set up Python uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1 with: - python-version: 3.x + python-version: 3.12 - name: Set up chart-testing uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b # v2.7.0 diff --git a/charts/konnector/Chart.yaml b/charts/konnector/Chart.yaml index 12af6b1..491a557 100644 --- a/charts/konnector/Chart.yaml +++ b/charts/konnector/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: konnector description: Deploys Palo Alto Networks' Cortex KSPM connector for advanced Kubernetes security posture management. type: application -version: 1.0.23 +version: 1.0.24 appVersion: "1.0.0" maintainers: - name: Palo Alto Networks - Cortex KSPM team diff --git a/charts/konnector/templates/_helpers.tpl b/charts/konnector/templates/_helpers.tpl index 9d6732e..fadacc2 100644 --- a/charts/konnector/templates/_helpers.tpl +++ b/charts/konnector/templates/_helpers.tpl @@ -41,6 +41,7 @@ app.kubernetes.io/author: {{ .Values.namespace.name }} {{- define "common.jobTemplate" -}} spec: backoffLimit: {{ .Values.system.batch.backoffLimit }} + ttlSecondsAfterFinished: {{ .Values.system.batch.ttlSecondsAfterFinished }} template: metadata: labels: diff --git a/charts/konnector/values.yaml b/charts/konnector/values.yaml index 58be2ac..0f08e95 100644 --- a/charts/konnector/values.yaml +++ b/charts/konnector/values.yaml @@ -50,6 +50,7 @@ system: # ========================== batch: backoffLimit: 4 # Maximum number of retries before the job is considered failed. After 4 attempts, the job will fail. + ttlSecondsAfterFinished: 1800 # Automatically delete the job 30 minutes (1800 seconds) after it completes # ========================== # Service Account Resources From d29ab3c0e2394eb14bd384652da75cb0a5e32ef9 Mon Sep 17 00:00:00 2001 From: Zuriel Levi Date: Mon, 15 Dec 2025 23:22:24 +0200 Subject: [PATCH 2/5] change jobsHistoryLimit to save only last success and failed job --- charts/konnector/templates/_helpers.tpl | 5 +++++ charts/konnector/templates/batch.yaml | 1 + charts/konnector/values.yaml | 1 - 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/charts/konnector/templates/_helpers.tpl b/charts/konnector/templates/_helpers.tpl index fadacc2..cea9129 100644 --- a/charts/konnector/templates/_helpers.tpl +++ b/charts/konnector/templates/_helpers.tpl @@ -38,6 +38,11 @@ app.kubernetes.io/author: {{ .Values.namespace.name }} {{- printf "%d */1 * * *" $minute -}} {{- end -}} +{{- define "common.jobsHistoryLimit" -}} +successfulJobsHistoryLimit: 1 +failedJobsHistoryLimit: 1 +{{- end -}} + {{- define "common.jobTemplate" -}} spec: backoffLimit: {{ .Values.system.batch.backoffLimit }} diff --git a/charts/konnector/templates/batch.yaml b/charts/konnector/templates/batch.yaml index e3b0813..d0e46ab 100644 --- a/charts/konnector/templates/batch.yaml +++ b/charts/konnector/templates/batch.yaml @@ -19,6 +19,7 @@ metadata: {{- include "common.labels" . | nindent 4 }} spec: schedule: {{ include "common.generateSchedule" . | quote }} + {{- include "common.jobsHistoryLimit" . | nindent 2 }} jobTemplate: {{- include "common.jobTemplate" . | nindent 4 }} --- diff --git a/charts/konnector/values.yaml b/charts/konnector/values.yaml index 0f08e95..58be2ac 100644 --- a/charts/konnector/values.yaml +++ b/charts/konnector/values.yaml @@ -50,7 +50,6 @@ system: # ========================== batch: backoffLimit: 4 # Maximum number of retries before the job is considered failed. After 4 attempts, the job will fail. - ttlSecondsAfterFinished: 1800 # Automatically delete the job 30 minutes (1800 seconds) after it completes # ========================== # Service Account Resources From b8c56f02277a65a59314016564b467a5f5a7292b Mon Sep 17 00:00:00 2001 From: Zuriel Levi Date: Wed, 17 Dec 2025 00:27:42 +0200 Subject: [PATCH 3/5] restore chart version --- charts/konnector/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/konnector/Chart.yaml b/charts/konnector/Chart.yaml index 491a557..12af6b1 100644 --- a/charts/konnector/Chart.yaml +++ b/charts/konnector/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: konnector description: Deploys Palo Alto Networks' Cortex KSPM connector for advanced Kubernetes security posture management. type: application -version: 1.0.24 +version: 1.0.23 appVersion: "1.0.0" maintainers: - name: Palo Alto Networks - Cortex KSPM team From a44935da6044e833aea65622efec13a8026df9f7 Mon Sep 17 00:00:00 2001 From: Zuriel Levi Date: Wed, 17 Dec 2025 02:05:11 +0200 Subject: [PATCH 4/5] update chart version --- charts/konnector/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/konnector/Chart.yaml b/charts/konnector/Chart.yaml index 12af6b1..0bc04a5 100644 --- a/charts/konnector/Chart.yaml +++ b/charts/konnector/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: konnector description: Deploys Palo Alto Networks' Cortex KSPM connector for advanced Kubernetes security posture management. type: application -version: 1.0.23 +version: 1.0.23-rc.46 appVersion: "1.0.0" maintainers: - name: Palo Alto Networks - Cortex KSPM team From d42af57e369cd82a0e04c423ad114d14c99ed46a Mon Sep 17 00:00:00 2001 From: Zuriel Levi Date: Thu, 18 Dec 2025 09:52:49 +0200 Subject: [PATCH 5/5] add ttlSecondsAfterFinished value --- charts/konnector/values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/konnector/values.yaml b/charts/konnector/values.yaml index 58be2ac..09ebe0e 100644 --- a/charts/konnector/values.yaml +++ b/charts/konnector/values.yaml @@ -50,6 +50,7 @@ system: # ========================== batch: backoffLimit: 4 # Maximum number of retries before the job is considered failed. After 4 attempts, the job will fail. + ttlSecondsAfterFinished: 3600 # Time-to-live for completed jobs, jobs will be automatically deleted 3600 seconds (1 hour) after completion # ========================== # Service Account Resources