Skip to content

Commit

Permalink
Add account to storage & node-agent (#324)
Browse files Browse the repository at this point in the history
* add account to storage & node-agent

Signed-off-by: Amir Malka <amirm@armosec.io>

* bump operator versions

Signed-off-by: Amir Malka <amirm@armosec.io>

* update snapshot

Signed-off-by: Amir Malka <amirm@armosec.io>

* load account from secret

Signed-off-by: Amir Malka <amirm@armosec.io>

---------

Signed-off-by: Amir Malka <amirm@armosec.io>
  • Loading branch information
amirmalka authored Nov 1, 2023
1 parent 8d8535e commit 23c8030
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.vscode

Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ spec:
value: "{{ .Values.logger.name }}"
{{- if $components.otelCollector.enabled }}
- name: ACCOUNT_ID
value: "{{ .Values.account }}"
valueFrom:
secretKeyRef:
name: {{ .Values.global.cloudSecret }}
key: account
- name: CLUSTER_NAME
value: "{{ regexReplaceAll "\\W+" .Values.clusterName "-" }}"
- name: OTEL_COLLECTOR_SVC
Expand Down
5 changes: 4 additions & 1 deletion charts/kubescape-operator/templates/gateway/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ spec:
value: "{{ .Values.gateway.httpService.port }}"
{{- if $components.otelCollector.enabled }}
- name: ACCOUNT_ID
value: "{{ .Values.account }}"
valueFrom:
secretKeyRef:
name: {{ .Values.global.cloudSecret }}
key: account
- name: OTEL_COLLECTOR_SVC
value: "otel-collector:4317"
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ spec:
fieldPath: metadata.namespace
{{- if $components.otelCollector.enabled }}
- name: ACCOUNT_ID
value: "{{ .Values.account }}"
valueFrom:
secretKeyRef:
name: {{ .Values.global.cloudSecret }}
key: account
- name: OTEL_COLLECTOR_SVC
value: "otel-collector:4317"
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ spec:
{{- end }}
{{- if $components.otelCollector.enabled }}
- name: ACCOUNT_ID
value: "{{ .Values.account }}"
valueFrom:
secretKeyRef:
name: {{ .Values.global.cloudSecret }}
key: account
- name: OTEL_COLLECTOR_SVC
value: "otel-collector:4317"
{{- end }}
Expand Down
5 changes: 4 additions & 1 deletion charts/kubescape-operator/templates/kubevuln/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ spec:
{{- end }}
{{- if $components.otelCollector.enabled }}
- name: ACCOUNT_ID
value: "{{ .Values.account }}"
valueFrom:
secretKeyRef:
name: {{ .Values.global.cloudSecret }}
key: account
- name: OTEL_COLLECTOR_SVC
value: "otel-collector:4317"
{{- end }}
Expand Down
6 changes: 6 additions & 0 deletions charts/kubescape-operator/templates/node-agent/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ spec:
automountServiceAccountToken: true
hostPID: true
volumes:
- name: {{ .Values.global.cloudSecret }}
secret:
secretName: {{ .Values.global.cloudSecret }}
- name: {{ .Values.global.cloudConfig }}
configMap:
name: {{ .Values.global.cloudConfig }}
Expand Down Expand Up @@ -127,6 +130,9 @@ spec:
seLinuxOptions:
type: spc_t
volumeMounts:
- name: {{ .Values.global.cloudSecret }}
mountPath: /etc/credentials
readOnly: true
- name: {{ .Values.global.cloudConfig }}
mountPath: /etc/config/clusterData.json
readOnly: true
Expand Down
5 changes: 5 additions & 0 deletions charts/kubescape-operator/templates/storage/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ spec:
- name: "GOMEMLIMIT"
value: "{{ .Values.storage.resources.requests.memory }}B"
{{- if $components.otelCollector.enabled }}
- name: ACCOUNT_ID
valueFrom:
secretKeyRef:
name: {{ .Values.global.cloudSecret }}
key: account
- name: OTEL_COLLECTOR_SVC
value: "otel-collector:4317"
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,10 @@ matches the snapshot:
- name: HTTP_PORT
value: "8002"
- name: ACCOUNT_ID
value: 9e6c0c2c-6bd0-4919-815b-55030de7c9a0
valueFrom:
secretKeyRef:
key: account
name: cloud-secret
- name: OTEL_COLLECTOR_SVC
value: otel-collector:4317
image: quay.io/kubescape/gateway:v0.1.17
Expand Down Expand Up @@ -575,7 +578,10 @@ matches the snapshot:
fieldRef:
fieldPath: metadata.namespace
- name: ACCOUNT_ID
value: 9e6c0c2c-6bd0-4919-815b-55030de7c9a0
valueFrom:
secretKeyRef:
key: account
name: cloud-secret
- name: OTEL_COLLECTOR_SVC
value: otel-collector:4317
- name: PRINT_REPORT
Expand Down Expand Up @@ -969,7 +975,10 @@ matches the snapshot:
- name: LARGE_CLUSTER_SIZE
value: "1500"
- name: ACCOUNT_ID
value: 9e6c0c2c-6bd0-4919-815b-55030de7c9a0
valueFrom:
secretKeyRef:
key: account
name: cloud-secret
- name: OTEL_COLLECTOR_SVC
value: otel-collector:4317
image: quay.io/kubescape/kubescape:v3.0.0
Expand Down Expand Up @@ -1095,7 +1104,10 @@ matches the snapshot:
- name: KS_LOGGER_NAME
value: "zap"
- name: ACCOUNT_ID
value: "9e6c0c2c-6bd0-4919-815b-55030de7c9a0"
valueFrom:
secretKeyRef:
name: cloud-secret
key: account
- name: CLUSTER_NAME
value: "kind-kind"
- name: OTEL_COLLECTOR_SVC
Expand Down Expand Up @@ -1414,7 +1426,10 @@ matches the snapshot:
- name: CA_MAX_VULN_SCAN_ROUTINES
value: "1"
- name: ACCOUNT_ID
value: 9e6c0c2c-6bd0-4919-815b-55030de7c9a0
valueFrom:
secretKeyRef:
key: account
name: cloud-secret
- name: OTEL_COLLECTOR_SVC
value: otel-collector:4317
image: quay.io/kubescape/kubevuln:v0.2.129
Expand Down Expand Up @@ -1700,7 +1715,7 @@ matches the snapshot:
- name: HOST_ROOT
value: /host
- name: NodeName
image: quay.io/kubescape/node-agent:v0.1.112
image: quay.io/kubescape/node-agent:v0.1.113
imagePullPolicy: IfNotPresent
name: node-agent
resources:
Expand All @@ -1725,6 +1740,9 @@ matches the snapshot:
seLinuxOptions:
type: spc_t
volumeMounts:
- mountPath: /etc/credentials
name: cloud-secret
readOnly: true
- mountPath: /etc/config/clusterData.json
name: ks-cloud-config
readOnly: true
Expand Down Expand Up @@ -1756,6 +1774,9 @@ matches the snapshot:
kubernetes.io/os: linux
serviceAccountName: node-agent
volumes:
- name: cloud-secret
secret:
secretName: cloud-secret
- configMap:
items:
- key: clusterData
Expand Down Expand Up @@ -1933,7 +1954,7 @@ matches the snapshot:
value: zap
- name: OTEL_COLLECTOR_SVC
value: otel-collector:4317
image: quay.io/kubescape/operator:v0.1.57
image: quay.io/kubescape/operator:v0.1.58
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
Expand Down Expand Up @@ -2545,9 +2566,14 @@ matches the snapshot:
- env:
- name: GOMEMLIMIT
value: 400MiB
- name: ACCOUNT_ID
valueFrom:
secretKeyRef:
key: account
name: cloud-secret
- name: OTEL_COLLECTOR_SVC
value: otel-collector:4317
image: quay.io/kubescape/storage:v0.0.30
image: quay.io/kubescape/storage:v0.0.32
imagePullPolicy: IfNotPresent
name: apiserver
resources:
Expand Down
6 changes: 3 additions & 3 deletions charts/kubescape-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ operator:
image:
# -- source code: https://github.com/kubescape/operator
repository: quay.io/kubescape/operator
tag: v0.1.57
tag: v0.1.58
pullPolicy: IfNotPresent

service:
Expand Down Expand Up @@ -513,7 +513,7 @@ storage:
replicaCount: 1
image:
repository: quay.io/kubescape/storage
tag: v0.0.30
tag: v0.0.32
pullPolicy: IfNotPresent

grypeOfflineDB:
Expand All @@ -538,7 +538,7 @@ nodeAgent:
name: node-agent
image:
repository: quay.io/kubescape/node-agent
tag: v0.1.112
tag: v0.1.113
pullPolicy: IfNotPresent

config:
Expand Down

0 comments on commit 23c8030

Please sign in to comment.