From eb6f1222b7e6799843dc1f5aed8b7175f7e912ff Mon Sep 17 00:00:00 2001 From: Simo Lin Date: Sat, 21 Mar 2026 16:49:18 -0700 Subject: [PATCH 1/3] fix(helm): correct CLI flag names and defaults in chart templates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit What changed: - deploy/helm/smg/templates/_helpers.tpl: - --eviction-interval-secs → --eviction-interval (field: eviction_interval, main.rs:169) - --postgres-pool-max → --postgres-pool-max-size (field: postgres_pool_max_size, main.rs:529) - --redis-pool-max → --redis-pool-max-size (field: redis_pool_max_size, main.rs:538) - --oracle-connect-descriptor → --oracle-dsn (field: oracle_dsn, main.rs:491) - --oracle-username → --oracle-user (field: oracle_user, main.rs:495) - deploy/helm/smg/Chart.yaml: - appVersion: "0.7.0" → "1.3.3" (latest release tag v1.3.3) - deploy/helm/smg/values.schema.json: - Added missing policy enum values: consistent_hashing, prefix_hash, bucket (all present in PolicyConfig enum in config/types.rs:247-320) - deploy/helm/smg/values.yaml: - evictionIntervalSecs: 60 → 120 (matches default_value_t = 120, main.rs:168) - Updated policy comment to list all 8 valid values Why: The Helm chart generated incorrect CLI flags that would cause the SMG binary to reject them at startup. Five flag names did not match the actual clap field names in CliArgs, the eviction interval default was wrong, the appVersion was stale, and three routing policies were missing from the schema validation. How: Cross-referenced every --flag-name in _helpers.tpl against the CliArgs struct fields in model_gateway/src/main.rs (clap converts field snake_case to --kebab-case). Verified all default values in values.yaml against default_value_t annotations. Checked PolicyConfig enum variants in config/types.rs against values.schema.json. Validated with helm lint and helm template rendering for all backend types (postgres, redis, oracle). Signed-off-by: Simo Lin --- deploy/helm/smg/Chart.yaml | 2 +- deploy/helm/smg/templates/_helpers.tpl | 10 +++++----- deploy/helm/smg/values.schema.json | 2 +- deploy/helm/smg/values.yaml | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/deploy/helm/smg/Chart.yaml b/deploy/helm/smg/Chart.yaml index a1ff3fba53..6d3c707fae 100644 --- a/deploy/helm/smg/Chart.yaml +++ b/deploy/helm/smg/Chart.yaml @@ -3,7 +3,7 @@ name: smg description: "Shepherd Model Gateway - high-performance inference router for LLM deployments" type: application version: 0.1.0 -appVersion: "0.7.0" +appVersion: "1.3.3" kubeVersion: ">=1.26.0-0" home: https://github.com/lightseekorg/smg sources: diff --git a/deploy/helm/smg/templates/_helpers.tpl b/deploy/helm/smg/templates/_helpers.tpl index dec613015e..40d7abe798 100644 --- a/deploy/helm/smg/templates/_helpers.tpl +++ b/deploy/helm/smg/templates/_helpers.tpl @@ -117,7 +117,7 @@ Called from the router Deployment template. - {{ .Values.router.balanceAbsThreshold | quote }} - "--balance-rel-threshold" - {{ .Values.router.balanceRelThreshold | quote }} -- "--eviction-interval-secs" +- "--eviction-interval" - {{ .Values.router.evictionIntervalSecs | quote }} - "--max-tree-size" - {{ int .Values.router.maxTreeSize | quote }} @@ -198,7 +198,7 @@ Called from the router Deployment template. - "--postgres-db-url" - {{ .Values.history.postgres.url | quote }} {{- end }} -- "--postgres-pool-max" +- "--postgres-pool-max-size" - {{ .Values.history.postgres.poolMax | quote }} {{- end }} {{- if eq .Values.history.backend "redis" }} @@ -206,18 +206,18 @@ Called from the router Deployment template. - "--redis-url" - {{ .Values.history.redis.url | quote }} {{- end }} -- "--redis-pool-max" +- "--redis-pool-max-size" - {{ .Values.history.redis.poolMax | quote }} {{- end }} {{- if eq .Values.history.backend "oracle" }} {{- if .Values.history.oracle.dsn }} -- "--oracle-connect-descriptor" +- "--oracle-dsn" - {{ .Values.history.oracle.dsn | quote }} {{- end }} - "--oracle-pool-max" - {{ .Values.history.oracle.poolMax | quote }} {{- if .Values.history.oracle.user }} -- "--oracle-username" +- "--oracle-user" - {{ .Values.history.oracle.user | quote }} {{- end }} {{- if .Values.history.oracle.password }} diff --git a/deploy/helm/smg/values.schema.json b/deploy/helm/smg/values.schema.json index 191b0803a7..afe1329672 100644 --- a/deploy/helm/smg/values.schema.json +++ b/deploy/helm/smg/values.schema.json @@ -7,7 +7,7 @@ "properties": { "policy": { "type": "string", - "enum": ["cache_aware", "round_robin", "power_of_two", "manual", "random"] + "enum": ["cache_aware", "round_robin", "power_of_two", "manual", "random", "consistent_hashing", "prefix_hash", "bucket"] }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "replicas": { "type": "integer", "minimum": 1 }, diff --git a/deploy/helm/smg/values.yaml b/deploy/helm/smg/values.yaml index 50c472ede7..db56238a66 100644 --- a/deploy/helm/smg/values.yaml +++ b/deploy/helm/smg/values.yaml @@ -17,7 +17,7 @@ global: router: replicas: 1 - # -- Routing policy: cache_aware, round_robin, power_of_two, manual, random + # -- Routing policy: cache_aware, round_robin, power_of_two, manual, random, consistent_hashing, prefix_hash, bucket policy: cache_aware # -- Explicit worker URLs @@ -43,7 +43,7 @@ router: cacheThreshold: 0.3 balanceAbsThreshold: 64 balanceRelThreshold: 1.5 - evictionIntervalSecs: 60 + evictionIntervalSecs: 120 maxTreeSize: 67108864 blockSize: 16 From b379ea1b497311fe1d4d67487b6484386f632ad6 Mon Sep 17 00:00:00 2001 From: Simo Lin Date: Sat, 21 Mar 2026 16:52:53 -0700 Subject: [PATCH 2/3] fix(helm): remove consistent_hashing and bucket from policy schema The parse_policy function in main.rs (lines 795-826) lacks match arms for consistent_hashing and bucket, causing them to silently fall back to round_robin. Until the application code is fixed, excluding these from the Helm schema prevents users from selecting non-functional policies. prefix_hash is retained as it is correctly handled. Addresses review feedback from Gemini Code Assist and CodeRabbit. Signed-off-by: Simo Lin --- deploy/helm/smg/values.schema.json | 2 +- deploy/helm/smg/values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/helm/smg/values.schema.json b/deploy/helm/smg/values.schema.json index afe1329672..05c7e3aba7 100644 --- a/deploy/helm/smg/values.schema.json +++ b/deploy/helm/smg/values.schema.json @@ -7,7 +7,7 @@ "properties": { "policy": { "type": "string", - "enum": ["cache_aware", "round_robin", "power_of_two", "manual", "random", "consistent_hashing", "prefix_hash", "bucket"] + "enum": ["cache_aware", "round_robin", "power_of_two", "manual", "random", "prefix_hash"] }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "replicas": { "type": "integer", "minimum": 1 }, diff --git a/deploy/helm/smg/values.yaml b/deploy/helm/smg/values.yaml index db56238a66..b0ed4db78e 100644 --- a/deploy/helm/smg/values.yaml +++ b/deploy/helm/smg/values.yaml @@ -17,7 +17,7 @@ global: router: replicas: 1 - # -- Routing policy: cache_aware, round_robin, power_of_two, manual, random, consistent_hashing, prefix_hash, bucket + # -- Routing policy: cache_aware, round_robin, power_of_two, manual, random, prefix_hash policy: cache_aware # -- Explicit worker URLs From a7701c4f0a26a151ac792ff459ddfcfc0811cb33 Mon Sep 17 00:00:00 2001 From: Simo Lin Date: Sat, 21 Mar 2026 17:05:00 -0700 Subject: [PATCH 3/3] fix(helm): quote custom labels and fix default securityContext Custom labels on ServiceMonitor and Grafana dashboard ConfigMap were rendered via toYaml, which does not quote numeric-like values (e.g. grafana_dashboard: 1). Kubernetes rejects non-string label values, causing installation failures when users pass --set with numeric labels. Changed label rendering to use range with explicit quoting so that values like "1" are always emitted as strings. Also changed the default securityContext.runAsNonRoot from true to false because the lightseekorg/smg image runs as root, which caused CreateContainerConfigError on every fresh install. What changed: - deploy/helm/smg/templates/grafana-dashboard.yaml: replace toYaml with range+quote for custom labels - deploy/helm/smg/templates/servicemonitor.yaml: same label quoting fix - deploy/helm/smg/values.yaml: set runAsNonRoot default to false Signed-off-by: Simon Olin Signed-off-by: Simo Lin --- deploy/helm/smg/templates/grafana-dashboard.yaml | 4 ++-- deploy/helm/smg/templates/servicemonitor.yaml | 4 ++-- deploy/helm/smg/values.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/deploy/helm/smg/templates/grafana-dashboard.yaml b/deploy/helm/smg/templates/grafana-dashboard.yaml index 70f2f5a644..4688d8f218 100644 --- a/deploy/helm/smg/templates/grafana-dashboard.yaml +++ b/deploy/helm/smg/templates/grafana-dashboard.yaml @@ -5,8 +5,8 @@ metadata: name: {{ include "smg.fullname" . }}-grafana-dashboard labels: {{- include "smg.labels" . | nindent 4 }} - {{- with .Values.grafana.dashboard.labels }} - {{- toYaml . | nindent 4 }} + {{- range $key, $value := .Values.grafana.dashboard.labels }} + {{ $key }}: {{ $value | quote }} {{- end }} data: smg-dashboard.json: | diff --git a/deploy/helm/smg/templates/servicemonitor.yaml b/deploy/helm/smg/templates/servicemonitor.yaml index da8f20bd97..29c0a59d40 100644 --- a/deploy/helm/smg/templates/servicemonitor.yaml +++ b/deploy/helm/smg/templates/servicemonitor.yaml @@ -5,8 +5,8 @@ metadata: name: {{ include "smg.fullname" . }}-router labels: {{- include "smg.labels" . | nindent 4 }} - {{- with .Values.router.metrics.serviceMonitor.labels }} - {{- toYaml . | nindent 4 }} + {{- range $key, $value := .Values.router.metrics.serviceMonitor.labels }} + {{ $key }}: {{ $value | quote }} {{- end }} spec: selector: diff --git a/deploy/helm/smg/values.yaml b/deploy/helm/smg/values.yaml index b0ed4db78e..1b963bf9de 100644 --- a/deploy/helm/smg/values.yaml +++ b/deploy/helm/smg/values.yaml @@ -154,7 +154,7 @@ router: # -- Security context for router container securityContext: readOnlyRootFilesystem: true - runAsNonRoot: true + runAsNonRoot: false allowPrivilegeEscalation: false # -- Liveness probe tuning