aminghadersohi commented on code in PR #40507:
URL: https://github.com/apache/superset/pull/40507#discussion_r3493593843


##########
helm/superset/templates/deployment-mcp.yaml:
##########
@@ -0,0 +1,198 @@
+{{/*
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+*/}}
+
+{{- if .Values.supersetMcp.enabled -}}
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ template "superset.fullname" . }}-mcp
+  namespace: {{ .Release.Namespace }}
+  labels:
+    app: {{ template "superset.name" . }}-mcp
+    chart: {{ template "superset.chart" . }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+    {{- if .Values.extraLabels }}
+      {{- toYaml .Values.extraLabels | nindent 4 }}
+    {{- end }}
+    {{- if .Values.supersetMcp.deploymentLabels }}
+      {{- toYaml .Values.supersetMcp.deploymentLabels | nindent 4 }}
+    {{- end }}
+  {{- if .Values.supersetMcp.deploymentAnnotations }}
+  annotations: {{- toYaml .Values.supersetMcp.deploymentAnnotations | nindent 
4 }}
+  {{- end }}
+spec:
+  replicas: {{ .Values.supersetMcp.replicaCount }}
+  {{- if .Values.supersetMcp.strategy }}
+  strategy: {{- toYaml .Values.supersetMcp.strategy | nindent 4 }}
+  {{- end }}
+  selector:
+    matchLabels:
+    {{- include "supersetMcp.selectorLabels" . | nindent 6 }}
+  template:
+    metadata:
+      annotations:
+        checksum/superset_config.py: {{ include "superset-config" . | 
sha256sum }}
+        checksum/superset_bootstrap.sh: {{ tpl .Values.bootstrapScript . | 
sha256sum }}
+        checksum/connections: {{ .Values.supersetNode.connections | toYaml | 
sha256sum }}
+        checksum/extraConfigs: {{ .Values.extraConfigs | toYaml | sha256sum }}
+        checksum/extraSecrets: {{ .Values.extraSecrets | toYaml | sha256sum }}
+        checksum/extraSecretEnv: {{ .Values.extraSecretEnv | toYaml | 
sha256sum }}
+        checksum/configOverrides: {{ .Values.configOverrides | toYaml | 
sha256sum }}
+        checksum/configOverridesFiles: {{ .Values.configOverridesFiles | 
toYaml | sha256sum }}
+        {{- if .Values.supersetMcp.forceReload }}
+        # Optionally force the thing to reload
+        force-reload: {{ randAlphaNum 5 | quote }}
+        {{- end }}
+        {{- if .Values.supersetMcp.podAnnotations }}
+          {{- toYaml .Values.supersetMcp.podAnnotations | nindent 8 }}
+        {{- end }}
+      labels:
+        app: "{{ template "superset.name" . }}-mcp"
+        release: {{ .Release.Name }}
+        {{- if .Values.extraLabels }}
+          {{- toYaml .Values.extraLabels | nindent 8 }}
+        {{- end }}
+        {{- if .Values.supersetMcp.podLabels }}
+          {{- toYaml .Values.supersetMcp.podLabels | nindent 8 }}
+        {{- end }}
+    spec:
+      {{- if .Values.supersetWorker.deploymentAdditionalPodSpec }}
+      {{- tpl (toYaml .Values.supersetWorker.deploymentAdditionalPodSpec) . | 
nindent 6 }}

Review Comment:
   HIGH — Copy-paste bug: both the condition on line 76 and this `tpl` call 
reference `.Values.supersetWorker.deploymentAdditionalPodSpec` instead of 
`.Values.supersetMcp.deploymentAdditionalPodSpec`. When an operator populates 
`supersetWorker.deploymentAdditionalPodSpec`, those extra pod-spec fields bleed 
into MCP pods silently; the `supersetMcp.deploymentAdditionalPodSpec` value 
defined in values.yaml is never read.
   
   ```suggestion
         {{- tpl (toYaml .Values.supersetMcp.deploymentAdditionalPodSpec) . | 
nindent 6 }}
   ```



##########
helm/superset/templates/ingress.yaml:
##########
@@ -70,6 +70,15 @@ spec:
                 port:
                   name: ws
           {{- end }}
+          {{- if $.Values.supersetMcp.enabled }}

Review Comment:
   HIGH — There is no `supersetMcp.ingress.enabled` flag independent of 
`supersetMcp.enabled`. Enabling the MCP deployment automatically exposes `/mcp` 
on the public ingress with no auth annotations. The MCP server provides full 
Superset API access; unguarded public exposure is dangerous.
   
   Recommend one of:
   1. Add a `supersetMcp.ingress.enabled: false` flag (separate from 
`supersetMcp.enabled`) so operators opt in to ingress exposure explicitly.
   2. At minimum, add a values-level comment and a README section specifying 
that operators must configure an auth middleware (OAuth2 proxy, 
`nginx.ingress.kubernetes.io/auth-url`, or equivalent) before setting this to 
true in a public environment.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to