Skip to content
Open
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: 2 additions & 2 deletions helm/robusta/templates/forwarder-service-account.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.kubewatch.createServiceAccount }}
{{- if and .Values.kubewatch.enabled .Values.kubewatch.createServiceAccount }}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
Expand Down Expand Up @@ -136,4 +136,4 @@ subjects:
- kind: ServiceAccount
name: {{ include "robusta.fullname" . }}-forwarder-service-account
namespace: {{ .Release.Namespace }}
{{- end }} # createServiceAccount
{{- end }} # createServiceAccount
2 changes: 2 additions & 0 deletions helm/robusta/templates/forwarder.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.kubewatch.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -144,3 +145,4 @@ spec:
targetLabels:
- target
{{ end }}
{{- end }}
4 changes: 3 additions & 1 deletion helm/robusta/templates/kubewatch-configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.kubewatch.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -7,5 +8,6 @@ data:
.kubewatch.yaml: |-
handler:
cloudevent:
url: "http://{{ include "robusta.fullname" . }}-runner:80/api/handle"
url: {{ default (printf "http://%s-runner:80/api/handle" (include "robusta.fullname" .)) .Values.kubewatch.overrideUrl | quote }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Prevent silent misrouting when runner is disabled.

Line 11 falls back to http://<release>-runner:80/api/handle even when runner.enabled=false (see helm/robusta/templates/runner.yaml Line 1). In multi-cluster mode this can silently route to a non-existent local service unless kubewatch.overrideUrl is set.

Proposed fail-fast validation
 {{- if .Values.kubewatch.enabled }}
+{{- if and (not .Values.runner.enabled) (empty .Values.kubewatch.overrideUrl) }}
+{{- fail "kubewatch.overrideUrl must be set when runner.enabled=false" }}
+{{- end }}
 apiVersion: v1
 kind: ConfigMap
 metadata:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@helm/robusta/templates/kubewatch-configmap.yaml` at line 11, The current
default in kubewatch-configmap.yaml unconditionally falls back to "http://{{
include "robusta.fullname" . }}-runner:80/api/handle", which silently routes to
a non-existent service when .Values.runner.enabled is false; change the url
logic to fail-fast or require an explicit override: update the url template (the
line using include "robusta.fullname" and .Values.kubewatch.overrideUrl) to
check .Values.runner.enabled and either (a) use the runner URL only when
.Values.runner.enabled is true, or (b) call required("kubewatch.overrideUrl must
be set when runner.enabled=false", .Values.kubewatch.overrideUrl) when
runner.enabled is false so Helm template rendering fails unless an explicit
override is provided; reference the include "robusta.fullname",
.Values.kubewatch.overrideUrl and .Values.runner.enabled symbols when making the
change.

{{ toYaml .Values.kubewatch.config | indent 4 }}
{{- end }}
2 changes: 2 additions & 0 deletions helm/robusta/templates/playbooks-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.runner.enabled }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -7,3 +8,4 @@ type: Opaque
data:
active_playbooks.yaml: |-
{{ include "robusta.configfile" . | b64enc }}
{{- end }}
4 changes: 2 additions & 2 deletions helm/robusta/templates/runner-service-account.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.runner.createServiceAccount }}
{{- if and .Values.runner.enabled .Values.runner.createServiceAccount }}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
Expand Down Expand Up @@ -588,4 +588,4 @@ roleRef:
kind: ClusterRole
name: cluster-monitoring-view
{{- end }}
{{- end }} # runner.createServiceAccount
{{- end }} # runner.createServiceAccount
3 changes: 2 additions & 1 deletion helm/robusta/templates/runner.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.runner.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -330,4 +331,4 @@ type: Opaque
stringData:
SENTRY_DSN: {{ $sentryDsn }}
{{- end }}

{{- end }}
3 changes: 3 additions & 0 deletions helm/robusta/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -630,11 +630,13 @@ image:

# parameters for the robusta forwarder deployment
kubewatch:
enabled: true
image: ~ # image can be used to override image.registry/imageName
imageName: kubewatch:v2.13.0
imagePullPolicy: IfNotPresent
revisionHistoryLimit: 10
pprof: True
overrideUrl: ""
resources:
requests:
cpu: 10m
Expand Down Expand Up @@ -713,6 +715,7 @@ runnerServiceAccount:

# parameters for the robusta runner
runner:
enabled: true
image: ~ # image can be used to override image.registry/imageName
imageName: robusta-runner:0.0.0
imagePullPolicy: IfNotPresent
Expand Down