Skip to content

Commit 26e1c8a

Browse files
authored
feat(agent): convert alf config to secret (#2294)
1 parent 8d665ad commit 26e1c8a

File tree

7 files changed

+34
-36
lines changed

7 files changed

+34
-36
lines changed

charts/agent/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ sources:
3030
- https://app.sysdigcloud.com/#/settings/user
3131
- https://github.com/draios/sysdig
3232
type: application
33-
version: 2.0.0
33+
version: 2.1.0

charts/agent/templates/_helpers.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -618,9 +618,9 @@ true
618618
{{- end -}}
619619
{{- end -}}
620620
621-
{{/* Return the name of the local forwarder configmap */}}
622-
{{- define "agent.localForwarderConfigMapName" }}
623-
{{- include "agent.configmapName" . | trunc 46 | trimSuffix "-" | printf "%s-local-forwarder" }}
621+
{{/* Return the name of the local forwarder secret */}}
622+
{{- define "agent.localForwarderSecretName" }}
623+
{{- include "agent.fullname" . | trunc 46 | trimSuffix "-" | printf "%s-local-forwarder" }}
624624
{{- end }}
625625
626626
{{- define "agent.enableHttpProbes" }}

charts/agent/templates/configmap-local-forwarder.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

charts/agent/templates/daemonset.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,8 @@ spec:
393393
optional: true
394394
{{- if .Values.localForwarder.enabled }}
395395
- name: local-forwarder-config
396-
configMap:
397-
name: {{ include "agent.localForwarderConfigMapName" . }}
398-
optional: true
396+
secret:
397+
secretName: {{ include "agent.localForwarderSecretName" . }}
399398
{{- end }}
400399
- name: sysdig-agent-secrets
401400
secret:

charts/agent/templates/secrets.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,16 @@ type: Opaque
4949
data:
5050
{{ include "agent.httpProxyCredentials" . | indent 2 }}
5151
{{- end }}
52+
{{- if .Values.localForwarder.enabled }}
53+
---
54+
apiVersion: v1
55+
kind: Secret
56+
type: Opaque
57+
metadata:
58+
name: {{ include "agent.localForwarderSecretName" . }}
59+
namespace: {{ include "agent.namespace" . }}
60+
labels:
61+
{{ (include "agent.labels" .) | indent 4 }}
62+
data:
63+
local_forwarder_config.yaml: {{ pick .Values.localForwarder "integrations" | toYaml | b64enc | quote }}
64+
{{- end }}

charts/agent/tests/local_forwarder_test.yaml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
suite: Test enabling the agent local forwarder
22
templates:
33
- configmap.yaml
4-
- configmap-local-forwarder.yaml
4+
- secrets.yaml
55
- daemonset.yaml
66
kubernetesProvider:
77
scheme:
@@ -18,6 +18,11 @@ kubernetesProvider:
1818
status:
1919
nodeInfo:
2020
osImage: fake-os-image
21+
release:
22+
name: sysdig
23+
set:
24+
sysdig:
25+
accessKey: AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE
2126
tests:
2227
- it: Check the enabling the forwarder
2328
set:
@@ -32,16 +37,11 @@ tests:
3237
type: LOCAL
3338
asserts:
3439
- equal:
35-
path: data["local_forwarder_config.yaml"]
36-
value: |
37-
integrations:
38-
- channels:
39-
- SECURE_EVENTS_POLICIES
40-
- ACTIVITY_AUDIT
41-
configuration:
42-
output: stdout
43-
type: LOCAL
44-
template: configmap-local-forwarder.yaml
40+
path: data
41+
value:
42+
local_forwarder_config.yaml: aW50ZWdyYXRpb25zOgotIGNoYW5uZWxzOgogIC0gU0VDVVJFX0VWRU5UU19QT0xJQ0lFUwogIC0gQUNUSVZJVFlfQVVESVQKICBjb25maWd1cmF0aW9uOgogICAgb3V0cHV0OiBzdGRvdXQKICB0eXBlOiBMT0NBTA==
43+
documentIndex: 1
44+
template: secrets.yaml
4545
- matchRegex:
4646
path: data["dragent.yaml"]
4747
pattern: |
@@ -55,9 +55,8 @@ tests:
5555
path: spec.template.spec.volumes
5656
content:
5757
name: local-forwarder-config
58-
configMap:
59-
name: sysdig-agent-local-forwarder
60-
optional: true
58+
secret:
59+
secretName: sysdig-agent-local-forwarder
6160
template: daemonset.yaml
6261
- contains:
6362
path: spec.template.spec.containers[0].volumeMounts

charts/sysdig-deploy/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: sysdig-deploy
33
description: A chart with various Sysdig components for Kubernetes
44
type: application
5-
version: 1.86.1
5+
version: 1.87.0
66
maintainers:
77
- name: AlbertoBarba
88
@@ -26,7 +26,7 @@ dependencies:
2626
- name: agent
2727
# repository: https://charts.sysdig.com
2828
repository: file://../agent
29-
version: ~2.0.0
29+
version: ~2.1.0
3030
alias: agent
3131
condition: agent.enabled
3232
- name: common

0 commit comments

Comments
 (0)