Skip to content

Commit 1d1e01f

Browse files
authored
Merge pull request #777 from snyk/feat/workload-events-orgs
feat: Helm flag to set the Orgs to use for workload auto import/delete
2 parents 513a728 + 09efa13 commit 1d1e01f

File tree

2 files changed

+36
-6
lines changed

2 files changed

+36
-6
lines changed

snyk-monitor/templates/configmap.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,35 @@ apiVersion: v1
33
kind: ConfigMap
44
metadata:
55
name: {{ .Release.Name }}-excluded-namespaces
6+
labels:
7+
app.kubernetes.io/name: {{ include "snyk-monitor.name" . }}
8+
helm.sh/chart: {{ include "snyk-monitor.chart" . }}
9+
app.kubernetes.io/instance: {{ .Release.Name }}
10+
app.kubernetes.io/managed-by: {{ .Release.Service }}
611
data:
712
excludedNamespaces: |-
813
{{- range .Values.excludedNamespaces }}
914
{{ . }}
1015
{{- end }}
1116
{{ end }}
17+
---
18+
apiVersion: v1
19+
kind: ConfigMap
20+
metadata:
21+
name: {{ .Values.workloadPoliciesMap }}
22+
labels:
23+
app.kubernetes.io/name: {{ include "snyk-monitor.name" . }}
24+
helm.sh/chart: {{ include "snyk-monitor.chart" . }}
25+
app.kubernetes.io/instance: {{ .Release.Name }}
26+
app.kubernetes.io/managed-by: {{ .Release.Service }}
27+
data:
28+
workload-events.rego: |-
29+
package snyk
30+
31+
orgs := {{ .Values.policyOrgs | toJson }}
32+
33+
default workload_events = false
34+
35+
workload_events {
36+
input.kind != "Job"
37+
}

snyk-monitor/values.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
monitorSecrets: snyk-monitor
88
certsConfigMap: snyk-monitor-certs
99
registriesConfConfigMap: snyk-monitor-registries-conf
10+
11+
# The ConfigMap to use for loading policies into snyk-monitor.
1012
workloadPoliciesMap: snyk-monitor-workload-policies
13+
# A list of Snyk Organization public IDs to let snyk-monitor know in which Organization to auto-import and auto-delete scanned images.
14+
policyOrgs:
1115

1216
# One of: Cluster, Namespaced
1317
# Cluster - creates a ClusterRole and ClusterRoleBinding with the ServiceAccount
@@ -60,22 +64,22 @@ rbac:
6064
# Node.js in-container process memory enhancements
6165
envs:
6266
- name: V8_MAX_OLD_SPACE_SIZE
63-
value: '2048'
67+
value: "2048"
6468
- name: UV_THREADPOOL_SIZE
65-
value: '24'
69+
value: "24"
6670
- name: NODE_OPTIONS
6771
value: --max_old_space_size=2048
6872

6973
extraCaCerts: /srv/app/certs/ca.pem
7074

7175
# CPU/Mem requests and limits for snyk-monitor
7276
requests:
73-
cpu: '250m'
74-
memory: '400Mi'
77+
cpu: "250m"
78+
memory: "400Mi"
7579

7680
limits:
77-
cpu: '1'
78-
memory: '2Gi'
81+
cpu: "1"
82+
memory: "2Gi"
7983

8084
http_proxy:
8185
https_proxy:

0 commit comments

Comments
 (0)