Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(kspm-collector): Enable annotations on kspm collector deployment pods #1346

Merged
merged 4 commits into from
Oct 30, 2023
Merged
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/kspm-collector/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: kspm-collector
description: Sysdig KSPM collector

version: 0.8.5
version: 0.9.0
appVersion: 1.34.0

keywords:
Expand Down
1 change: 1 addition & 0 deletions charts/kspm-collector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ The following table lists the configurable parameters of the Sysdig KSPM Collect
| `os` | Specifies the allowed operating systems for scheduling. | `[ linux ]` |
| `affinity` | Specifies the node affinities. Overrides `arch` and `os` values. | `{}` |
| `labels` | Specifies the KSPM collector specific labels as a multi-line templated string map or as YAML. | `{}` |
| `podAnnotations` | Specifies the pod annotations as a multi-line templated string map or as YAML. | `{}` |
| `port` | Specifies the KSPM collector port for health checks. | `8080` |
| `psp.create` | Creates Pod Security Policy to allow the KSPM collector running in PSP-enabled clusters. | `true` |
| `readinessProbe.enabled` | Specifies whether KSPM collector readinessProbe is enabled or not. | `true` |
Expand Down
4 changes: 4 additions & 0 deletions charts/kspm-collector/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ spec:
metadata:
labels:
app.kubernetes.io/name: {{ include "kspmCollector.name" . }}
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{ include "kspmCollector.labels" . | indent 8 }}
spec:
serviceAccountName: {{ template "kspmCollector.serviceAccountName" .}}
Expand Down
37 changes: 37 additions & 0 deletions charts/kspm-collector/tests/pod_annotation_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
suite: Pod annotation test
templates:
- deployment.yaml
tests:
- it: check that the deployment do not have any custom annotation in the pod if not specified
set:
sysdig:
accessKey: AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE
asserts:
- isNull:
path: spec.template.metadata.annotations

- it: check that the deployment include the pod annotation
set:
sysdig:
accessKey: AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE
podAnnotations:
my-annotation: my-value
asserts:
- exists:
path: spec.template.metadata.annotations

- it: check that the deployment include the pod annotation match the value we specified
set:
sysdig:
accessKey: AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE
podAnnotations:
my-annotation-1: my-value-1
my-annotation-2: my-value-2
asserts:
- equal:
path: spec.template.metadata.annotations['my-annotation-1']
value: my-value-1

- equal:
path: spec.template.metadata.annotations['my-annotation-2']
value: my-value-2
2 changes: 2 additions & 0 deletions charts/kspm-collector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ affinity: {}

labels: {}

podAnnotations: {}

ssl:
ca:
# For outbound connections (secure backend, proxy,...)
Expand Down