Skip to content

Commit 86244ec

Browse files
authored
Merge pull request #636 from kubescape/otel
disable otel collector when configurations.otelUrl is set
2 parents 55f3d36 + 939c00f commit 86244ec

File tree

10 files changed

+165
-594
lines changed

10 files changed

+165
-594
lines changed

charts/kubescape-operator/assets/host-scanner-definition.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ spec:
6767
- name: OTEL_COLLECTOR_SVC
6868
value: "otel-collector.kubescape.svc:4318"
6969
{{- end }}
70+
{{- if .Values.configurations.otelUrl }}
71+
- name: OTEL_COLLECTOR_SVC
72+
value: {{ .Values.configurations.otelUrl }}
73+
{{- end }}
7074
ports:
7175
- name: scanner # Do not change port name
7276
containerPort: 7888

charts/kubescape-operator/templates/_common.tpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ nodeAgent:
6969
operator:
7070
enabled: true
7171
otelCollector:
72-
enabled: {{ or $configurations.ksOtel $configurations.otel }}
72+
enabled: {{ and $configurations.ksOtel (not $configurations.otel) }}
7373
serviceDiscovery:
7474
enabled: {{ $configurations.submit }}
7575
storage:

charts/kubescape-operator/templates/kubescape/deployment.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ spec:
150150
- name: OTEL_COLLECTOR_SVC
151151
value: "otel-collector:4318"
152152
{{- end }}
153+
{{- if .Values.configurations.otelUrl }}
154+
- name: OTEL_COLLECTOR_SVC
155+
value: {{ .Values.configurations.otelUrl }}
156+
{{- end }}
153157
{{- if ne .Values.global.httpsProxy "" }}
154158
- name: HTTPS_PROXY
155159
value: "{{ .Values.global.httpsProxy }}"

charts/kubescape-operator/templates/kubevuln/deployment.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ spec:
9191
- name: OTEL_COLLECTOR_SVC
9292
value: "otel-collector:4318"
9393
{{- end }}
94+
{{- if .Values.configurations.otelUrl }}
95+
- name: OTEL_COLLECTOR_SVC
96+
value: {{ .Values.configurations.otelUrl }}
97+
{{- end }}
9498
{{- if ne .Values.global.httpsProxy "" }}
9599
- name: HTTPS_PROXY
96100
value: "{{ .Values.global.httpsProxy }}"

charts/kubescape-operator/templates/node-agent/daemonset.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ spec:
165165
- name: OTEL_COLLECTOR_SVC
166166
value: "otel-collector:4318"
167167
{{- end }}
168+
{{- if .Values.configurations.otelUrl }}
169+
- name: OTEL_COLLECTOR_SVC
170+
value: {{ .Values.configurations.otelUrl }}
171+
{{- end }}
168172
{{- if $components.clamAV.enabled }}
169173
- name: CLAMAV_SOCKET
170174
value: "/clamav/clamd.sock"

charts/kubescape-operator/templates/operator/deployment.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ spec:
104104
- name: OTEL_COLLECTOR_SVC
105105
value: "otel-collector:4318"
106106
{{- end }}
107+
{{- if .Values.configurations.otelUrl }}
108+
- name: OTEL_COLLECTOR_SVC
109+
value: {{ .Values.configurations.otelUrl }}
110+
{{- end }}
107111
{{- if ne .Values.global.httpsProxy "" }}
108112
- name: HTTPS_PROXY
109113
value: "{{ .Values.global.httpsProxy }}"

charts/kubescape-operator/templates/storage/deployment.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ spec:
8181
- name: OTEL_COLLECTOR_SVC
8282
value: "otel-collector:4318"
8383
{{- end }}
84+
{{- if .Values.configurations.otelUrl }}
85+
- name: OTEL_COLLECTOR_SVC
86+
value: {{ .Values.configurations.otelUrl }}
87+
{{- end }}
8488
{{- if not $configurations.virtualCrds }}
8589
- name: DISABLE_VIRTUAL_CRDS
8690
value: "true"

charts/kubescape-operator/templates/synchronizer/deployment.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ spec:
8686
- name: OTEL_COLLECTOR_SVC
8787
value: "otel-collector:4318"
8888
{{- end }}
89+
{{- if .Values.configurations.otelUrl }}
90+
- name: OTEL_COLLECTOR_SVC
91+
value: {{ .Values.configurations.otelUrl }}
92+
{{- end }}
8993
{{- if ne .Values.global.httpsProxy "" }}
9094
- name: HTTPS_PROXY
9195
value: "{{ .Values.global.httpsProxy }}"

charts/kubescape-operator/tests/__snapshot__/snapshot_test.yaml.snap

+131-587
Large diffs are not rendered by default.

charts/kubescape-operator/tests/snapshot_test.yaml

+5-6
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ tests:
4848
admissionController: enable
4949
manageWorkloads: enable
5050
server: api.armosec.io
51-
configurations.otelUrl: "otelCollector:4317"
51+
configurations.otelUrl: "otelCollector.svc.monitoring:4317"
5252
clusterName: kind-kind
5353
includeNamespaces: "my-namespace"
5454
global:
@@ -87,7 +87,7 @@ tests:
8787
- batch/v1
8888
set:
8989
unittest: true
90-
configurations.otelUrl: "otelCollector:4317"
90+
configurations.otelUrl: "otelCollector.svc.monitoring:4317"
9191
clusterName: kind-kind
9292
excludeNamespaces: ""
9393
includeNamespaces: ""
@@ -134,7 +134,6 @@ tests:
134134
prometheusExporter: disable
135135
admissionController: disable
136136
server: api.armosec.io
137-
configurations.otelUrl: "otelCollector:4317"
138137
clusterName: kind-kind
139138
excludeNamespaces: "kubescape,kube-system,kube-public,kube-node-lease,kubeconfig,gmp-system,gmp-public"
140139
global:
@@ -166,7 +165,7 @@ tests:
166165
- batch/v1
167166
set:
168167
unittest: true
169-
configurations.otelUrl: "otelCollector:4317"
168+
configurations.otelUrl: "otelCollector.svc.monitoring:4317"
170169
clusterName: kind-kind
171170
imageScanning:
172171
privateRegistries:
@@ -189,7 +188,7 @@ tests:
189188
- batch/v1
190189
set:
191190
unittest: true
192-
configurations.otelUrl: "otelCollector:4317"
191+
configurations.otelUrl: "otelCollector.svc.monitoring:4317"
193192
clusterName: kind-kind
194193
imageScanning:
195194
privateRegistries:
@@ -217,7 +216,7 @@ tests:
217216
- batch/v1
218217
set:
219218
unittest: true
220-
configurations.otelUrl: "otelCollector:4317"
219+
configurations.otelUrl: "otelCollector.svc.monitoring:4317"
221220
clusterName: kind-kind
222221
imagePullSecrets: quay-secret
223222
imagePullSecret:

0 commit comments

Comments
 (0)