Skip to content
This repository was archived by the owner on Sep 15, 2022. It is now read-only.

Commit 8832275

Browse files
author
David Wertenteil
committed
fixed kubectl image, add default vuln scheduler
1 parent 9a61b62 commit 8832275

File tree

4 files changed

+80
-16
lines changed

4 files changed

+80
-16
lines changed

charts/armo-components/templates/armo-collector-statefulset.yaml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,14 @@ spec:
3535
imagePullSecrets:
3636
- name: {{ toYaml .Values.imagePullSecrets }}
3737
{{- end }}
38-
# initContainers:
39-
# - image: bitnami/kubectl:1.24
40-
# name: disconnect-handle
41-
# command:
42-
# - bash
43-
# args:
44-
# - -c
45-
# - set -xv; kubectl delete deployment armo-collector -n armo-system; dep_exist=$?; echo $dep_exist; while [ $dep_exist -eq 0 ]; do kubectl get deployment armo-collector -n armo-system; dep_exist=$?; echo $dep_exist; done
46-
# resources:
47-
# limits:
48-
# cpu: 10m
49-
# memory: 40Mi
50-
# requests:
51-
# cpu: 10m
52-
# memory: 40Mi
38+
initContainers:
39+
- image: quay.io/armosec/kubectl
40+
name: disconnect-handle
41+
command:
42+
- bash
43+
args:
44+
- -c
45+
- set -xv; kubectl delete deployment armo-collector -n armo-system; dep_exist=$?; echo $dep_exist; while [ $dep_exist -eq 0 ]; do kubectl get deployment armo-collector -n armo-system; dep_exist=$?; echo $dep_exist; done
5346
containers:
5447
- name: {{ .Values.armoCollector.name }}
5548
image: "{{ .Values.armoCollector.image.repository }}:{{ .Values.armoCollector.image.tag }}"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{- if and .Values.armoVulnScanScheduler.enabled .Values.armoKubescape.enabled .Values.armoKubescape.submit }}
2+
kind: ConfigMap
3+
apiVersion: v1
4+
metadata:
5+
name: {{ .Values.armoVulnScanScheduler.name }}
6+
namespace: {{ .Values.armoNameSpace }}
7+
labels:
8+
app: {{ .Values.armoVulnScanScheduler.name }}
9+
tier: {{ .Values.global.namespaceTier }}
10+
data:
11+
request-body.json: |-
12+
{"commands":[{"commandName":"scan","designators":[{"designatorType":"Attributes","attributes":{"cluster":"dwertent","namespace":"systest-ns-ty8m"}}]}]}
13+
{{- end }}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{{- if and .Values.armoVulnScanScheduler.enabled .Values.armoKubescape.enabled .Values.armoKubescape.submit }}
2+
{{- if .Capabilities.APIVersions.Has "batch/v1/CronJob" }}
3+
apiVersion: batch/v1
4+
{{- else }}
5+
apiVersion: batch/v1beta1
6+
{{- end }}
7+
kind: CronJob
8+
metadata:
9+
name: {{ .Values.armoVulnScanScheduler.name }}
10+
namespace: {{ .Values.armoNameSpace }}
11+
labels:
12+
app: {{ .Values.armoVulnScanScheduler.name }}
13+
tier: {{ .Values.global.namespaceTier}}
14+
armo.tier: "kubescape-scan"
15+
spec:
16+
schedule: "{{ .Values.armoVulnScanScheduler.scanSchedule }}"
17+
jobTemplate:
18+
spec:
19+
template:
20+
metadata:
21+
labels:
22+
armo.tier: "kubescape-scan"
23+
spec:
24+
containers:
25+
- name: {{ .Values.armoVulnScanScheduler.name }}
26+
image: "{{ .Values.armoVulnScanScheduler.image.repository }}:{{ .Values.armoVulnScanScheduler.image.tag }}"
27+
imagePullPolicy: {{ .Values.armoVulnScanScheduler.image.pullPolicy }}
28+
args:
29+
- -method=post
30+
- -scheme=http
31+
- -host={{ .Values.armoWebsocket.name }}:{{ .Values.armoWebsocket.service.port }}
32+
- -path=v1/triggerAction
33+
- -headers="Content-Type:application/json"
34+
- -path-body=/home/ks/request-body.json
35+
volumeMounts:
36+
- name: {{ .Values.armoVulnScanScheduler.name }}
37+
mountPath: /home/ks/request-body.json
38+
subPath: request-body.json
39+
readOnly: true
40+
{{- if .Values.volumeMounts }}
41+
{{ toYaml .Values.volumeMounts | indent 14 }}
42+
{{- end }}
43+
{{- if .Values.armoVulnScanScheduler.volumeMounts }}
44+
{{ toYaml .Values.armoVulnScanScheduler.volumeMounts | indent 14 }}
45+
{{- end }}
46+
restartPolicy: Never
47+
automountServiceAccountToken: false
48+
volumes:
49+
- name: {{ .Values.armoVulnScanScheduler.name }}
50+
configMap:
51+
name: {{ .Values.armoVulnScanScheduler.name }}
52+
{{- if .Values.volumes }}
53+
{{ toYaml .Values.volumes | indent 10 }}
54+
{{- end }}
55+
{{- if .Values.armoVulnScanScheduler.volumes }}
56+
{{ toYaml .Values.armoVulnScanScheduler.volumes | indent 10 }}
57+
{{- end }}
58+
{{- end }}

charts/armo-components/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ global:
7171
beConfig: armo-be-config
7272
armoServiceAccountName: armo-scanner-service-account
7373
armoKubescapeServiceAccountName: armo-kubescape-service-account
74-
74+
7575
# kubescape scheduled scan using a CronJob
7676
armoKubescapeScanScheduler:
7777

0 commit comments

Comments
 (0)