Skip to content

Commit 4bf9758

Browse files
feat(kspm-collector): Enable annotations on kspm collector deployment pods (#1346)
Co-authored-by: Marco Vito Moscaritolo <[email protected]>
1 parent f068f72 commit 4bf9758

File tree

5 files changed

+45
-1
lines changed

5 files changed

+45
-1
lines changed

charts/kspm-collector/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: kspm-collector
33
description: Sysdig KSPM collector
44

5-
version: 0.8.5
5+
version: 0.9.0
66
appVersion: 1.34.0
77

88
keywords:

charts/kspm-collector/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ The following table lists the configurable parameters of the Sysdig KSPM Collect
7171
| `os` | Specifies the allowed operating systems for scheduling. | `[ linux ]` |
7272
| `affinity` | Specifies the node affinities. Overrides `arch` and `os` values. | `{}` |
7373
| `labels` | Specifies the KSPM collector specific labels as a multi-line templated string map or as YAML. | `{}` |
74+
| `podAnnotations` | Specifies the pod annotations as a multi-line templated string map or as YAML. | `{}` |
7475
| `port` | Specifies the KSPM collector port for health checks. | `8080` |
7576
| `psp.create` | Creates Pod Security Policy to allow the KSPM collector running in PSP-enabled clusters. | `true` |
7677
| `readinessProbe.enabled` | Specifies whether KSPM collector readinessProbe is enabled or not. | `true` |

charts/kspm-collector/templates/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ spec:
1616
metadata:
1717
labels:
1818
app.kubernetes.io/name: {{ include "kspmCollector.name" . }}
19+
{{- with .Values.podAnnotations }}
20+
annotations:
21+
{{- toYaml . | nindent 8 }}
22+
{{- end }}
1923
{{ include "kspmCollector.labels" . | indent 8 }}
2024
spec:
2125
serviceAccountName: {{ template "kspmCollector.serviceAccountName" .}}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
suite: Pod annotation test
2+
templates:
3+
- deployment.yaml
4+
tests:
5+
- it: check that the deployment do not have any custom annotation in the pod if not specified
6+
set:
7+
sysdig:
8+
accessKey: AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE
9+
asserts:
10+
- isNull:
11+
path: spec.template.metadata.annotations
12+
13+
- it: check that the deployment include the pod annotation
14+
set:
15+
sysdig:
16+
accessKey: AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE
17+
podAnnotations:
18+
my-annotation: my-value
19+
asserts:
20+
- exists:
21+
path: spec.template.metadata.annotations
22+
23+
- it: check that the deployment include the pod annotation match the value we specified
24+
set:
25+
sysdig:
26+
accessKey: AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE
27+
podAnnotations:
28+
my-annotation-1: my-value-1
29+
my-annotation-2: my-value-2
30+
asserts:
31+
- equal:
32+
path: spec.template.metadata.annotations['my-annotation-1']
33+
value: my-value-1
34+
35+
- equal:
36+
path: spec.template.metadata.annotations['my-annotation-2']
37+
value: my-value-2

charts/kspm-collector/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ affinity: {}
172172

173173
labels: {}
174174

175+
podAnnotations: {}
176+
175177
ssl:
176178
ca:
177179
# For outbound connections (secure backend, proxy,...)

0 commit comments

Comments
 (0)