Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable otel collector when configurations.otelUrl is set #636

Merged
merged 1 commit into from
Mar 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions charts/kubescape-operator/assets/host-scanner-definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ spec:
- name: OTEL_COLLECTOR_SVC
value: "otel-collector.kubescape.svc:4318"
{{- end }}
{{- if .Values.configurations.otelUrl }}
- name: OTEL_COLLECTOR_SVC
value: {{ .Values.configurations.otelUrl }}
{{- end }}
ports:
- name: scanner # Do not change port name
containerPort: 7888
Expand Down
2 changes: 1 addition & 1 deletion charts/kubescape-operator/templates/_common.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ nodeAgent:
operator:
enabled: true
otelCollector:
enabled: {{ or $configurations.ksOtel $configurations.otel }}
enabled: {{ and $configurations.ksOtel (not $configurations.otel) }}
serviceDiscovery:
enabled: {{ $configurations.submit }}
storage:
Expand Down
4 changes: 4 additions & 0 deletions charts/kubescape-operator/templates/kubescape/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ spec:
- name: OTEL_COLLECTOR_SVC
value: "otel-collector:4318"
{{- end }}
{{- if .Values.configurations.otelUrl }}
- name: OTEL_COLLECTOR_SVC
value: {{ .Values.configurations.otelUrl }}
{{- end }}
{{- if ne .Values.global.httpsProxy "" }}
- name: HTTPS_PROXY
value: "{{ .Values.global.httpsProxy }}"
Expand Down
4 changes: 4 additions & 0 deletions charts/kubescape-operator/templates/kubevuln/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ spec:
- name: OTEL_COLLECTOR_SVC
value: "otel-collector:4318"
{{- end }}
{{- if .Values.configurations.otelUrl }}
- name: OTEL_COLLECTOR_SVC
value: {{ .Values.configurations.otelUrl }}
{{- end }}
{{- if ne .Values.global.httpsProxy "" }}
- name: HTTPS_PROXY
value: "{{ .Values.global.httpsProxy }}"
Expand Down
4 changes: 4 additions & 0 deletions charts/kubescape-operator/templates/node-agent/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ spec:
- name: OTEL_COLLECTOR_SVC
value: "otel-collector:4318"
{{- end }}
{{- if .Values.configurations.otelUrl }}
- name: OTEL_COLLECTOR_SVC
value: {{ .Values.configurations.otelUrl }}
{{- end }}
{{- if $components.clamAV.enabled }}
- name: CLAMAV_SOCKET
value: "/clamav/clamd.sock"
Expand Down
4 changes: 4 additions & 0 deletions charts/kubescape-operator/templates/operator/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ spec:
- name: OTEL_COLLECTOR_SVC
value: "otel-collector:4318"
{{- end }}
{{- if .Values.configurations.otelUrl }}
- name: OTEL_COLLECTOR_SVC
value: {{ .Values.configurations.otelUrl }}
{{- end }}
{{- if ne .Values.global.httpsProxy "" }}
- name: HTTPS_PROXY
value: "{{ .Values.global.httpsProxy }}"
Expand Down
4 changes: 4 additions & 0 deletions charts/kubescape-operator/templates/storage/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ spec:
- name: OTEL_COLLECTOR_SVC
value: "otel-collector:4318"
{{- end }}
{{- if .Values.configurations.otelUrl }}
- name: OTEL_COLLECTOR_SVC
value: {{ .Values.configurations.otelUrl }}
{{- end }}
{{- if not $configurations.virtualCrds }}
- name: DISABLE_VIRTUAL_CRDS
value: "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ spec:
- name: OTEL_COLLECTOR_SVC
value: "otel-collector:4318"
{{- end }}
{{- if .Values.configurations.otelUrl }}
- name: OTEL_COLLECTOR_SVC
value: {{ .Values.configurations.otelUrl }}
{{- end }}
{{- if ne .Values.global.httpsProxy "" }}
- name: HTTPS_PROXY
value: "{{ .Values.global.httpsProxy }}"
Expand Down
718 changes: 131 additions & 587 deletions charts/kubescape-operator/tests/__snapshot__/snapshot_test.yaml.snap

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions charts/kubescape-operator/tests/snapshot_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ tests:
admissionController: enable
manageWorkloads: enable
server: api.armosec.io
configurations.otelUrl: "otelCollector:4317"
configurations.otelUrl: "otelCollector.svc.monitoring:4317"
clusterName: kind-kind
includeNamespaces: "my-namespace"
global:
Expand Down Expand Up @@ -87,7 +87,7 @@ tests:
- batch/v1
set:
unittest: true
configurations.otelUrl: "otelCollector:4317"
configurations.otelUrl: "otelCollector.svc.monitoring:4317"
clusterName: kind-kind
excludeNamespaces: ""
includeNamespaces: ""
Expand Down Expand Up @@ -134,7 +134,6 @@ tests:
prometheusExporter: disable
admissionController: disable
server: api.armosec.io
configurations.otelUrl: "otelCollector:4317"
clusterName: kind-kind
excludeNamespaces: "kubescape,kube-system,kube-public,kube-node-lease,kubeconfig,gmp-system,gmp-public"
global:
Expand Down Expand Up @@ -166,7 +165,7 @@ tests:
- batch/v1
set:
unittest: true
configurations.otelUrl: "otelCollector:4317"
configurations.otelUrl: "otelCollector.svc.monitoring:4317"
clusterName: kind-kind
imageScanning:
privateRegistries:
Expand All @@ -189,7 +188,7 @@ tests:
- batch/v1
set:
unittest: true
configurations.otelUrl: "otelCollector:4317"
configurations.otelUrl: "otelCollector.svc.monitoring:4317"
clusterName: kind-kind
imageScanning:
privateRegistries:
Expand Down Expand Up @@ -217,7 +216,7 @@ tests:
- batch/v1
set:
unittest: true
configurations.otelUrl: "otelCollector:4317"
configurations.otelUrl: "otelCollector.svc.monitoring:4317"
clusterName: kind-kind
imagePullSecrets: quay-secret
imagePullSecret:
Expand Down
Loading