Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/konnector/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.11
version: 1.0.12
appVersion: "1.0.0"
maintainers:
- name: Palo Alto Networks - Cortex KSPM team
Expand Down
39 changes: 35 additions & 4 deletions charts/konnector/templates/batch.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{{- $ns := .Values.namespace.name }}
{{- $konnectorJobName := printf "%s-job-revision-%d" .Chart.Name .Release.Revision }}
{{- $secret := .Values.system.secrets.distribution.name | default "distribution-id" }}
{{- include "common.validateImage" . }}

apiVersion: batch/v1
kind: Job
metadata:
name: "{{ .Chart.Name }}-job-revision-{{ .Release.Revision }}"
namespace: {{ .Values.namespace.name }}
name: {{ $konnectorJobName }}
namespace: {{ $ns }}
labels:
{{- include "common.labels" . | nindent 4 }}
{{- include "common.jobTemplate" . | nindent 0 }}
Expand All @@ -14,7 +17,7 @@ apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ .Chart.Name }}
namespace: {{ .Values.namespace.name }}
namespace: {{ $ns }}
labels:
{{- include "common.labels" . | nindent 4 }}
spec:
Expand All @@ -26,7 +29,7 @@ apiVersion: batch/v1
kind: Job
metadata:
name: delete-{{ .Values.system.K8sManager.ReleaseName }}
namespace: {{ .Values.namespace.name }}
namespace: {{ $ns }}
annotations:
"helm.sh/hook": pre-delete
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
Expand Down Expand Up @@ -56,3 +59,31 @@ spec:
echo -e "\033[33m{{ .Values.system.K8sManager.ReleaseName }} not found, skipping uninstall.\033[0m";
exit 0
fi
---
apiVersion: batch/v1
kind: Job
metadata:
name: delete-{{ .Values.system.secrets.distribution.name }}-secret
namespace: {{ $ns }}
annotations:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-weight": "5"
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
spec:
ttlSecondsAfterFinished: 60
backoffLimit: 0
template:
spec:
serviceAccountName: {{ .Values.system.serviceAccount.name }}
restartPolicy: "Never"
containers:
- name: kubectl
image: bitnami/kubectl:1.30
command: ["sh","-c"]
args:
- |
set -euo pipefail
kubectl -n {{ $ns }} get job "{{ $konnectorJobName }}" >/dev/null 2>&1 \
&& kubectl -n {{ $ns }} wait --for=condition=complete --timeout=2m "job/{{ $konnectorJobName }}" \
|| echo "Job {{ $konnectorJobName }} not found; continuing."
kubectl -n {{ $ns }} delete secret "{{ $secret }}" --ignore-not-found=true
2 changes: 1 addition & 1 deletion charts/konnector/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ data:
apiVersion: v1
kind: Secret
metadata:
name: distribution-id
name: {{ .Values.system.secrets.distribution.name }}
namespace: {{ .Values.namespace.name }}
labels:
{{- include "common.labels" . | nindent 4 }}
Expand Down
2 changes: 2 additions & 0 deletions charts/konnector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,5 @@ system:
name: backend-auth-secret # Secret holding backend authentication credentials (e.g. API tokens)
dockerSecret:
name: konnector-docker-secret # Secret for Docker credentials (e.g., for pulling private images)
distribution:
name: distribution-id