From 541b9794293a49db212162fb29335e181c6ec1b4 Mon Sep 17 00:00:00 2001 From: Vicky <90204593+vicky-playground@users.noreply.github.com> Date: Tue, 12 Aug 2025 00:13:54 -0400 Subject: [PATCH] =?UTF-8?q?fix(helm):=20remove=20legacy=20migration=20job?= =?UTF-8?q?=20and=20references;=20deprecate=20migration.*=20=E2=80=94=20cl?= =?UTF-8?q?oses=20#383?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Vicky <90204593+vicky-playground@users.noreply.github.com> --- .../templates/deployment-mcpgateway.yaml | 22 ------ charts/mcp-stack/templates/job-migration.yaml | 76 ------------------- charts/mcp-stack/values.schema.json | 4 +- charts/mcp-stack/values.yaml | 2 +- 4 files changed, 3 insertions(+), 101 deletions(-) delete mode 100644 charts/mcp-stack/templates/job-migration.yaml diff --git a/charts/mcp-stack/templates/deployment-mcpgateway.yaml b/charts/mcp-stack/templates/deployment-mcpgateway.yaml index 0b6b8e791..660cede9b 100644 --- a/charts/mcp-stack/templates/deployment-mcpgateway.yaml +++ b/charts/mcp-stack/templates/deployment-mcpgateway.yaml @@ -88,32 +88,10 @@ spec: ################################################################ # HEALTH & READINESS PROBES ################################################################ - {{- if .Values.migration.enabled }} - startupProbe: - exec: - command: - - /bin/sh - - -c - - | - # Check if migration check already passed - if [ -f /tmp/migration_check_done ]; then - exit 0 - fi - # Wait for database to be ready (implies migration completed) - python3 /app/mcpgateway/utils/db_isready.py --max-tries 1 --interval 1 --timeout 2 || exit 1 - # Mark check as done to avoid repeated database calls - touch /tmp/migration_check_done - exit 0 - initialDelaySeconds: 10 - periodSeconds: 5 - timeoutSeconds: 10 - failureThreshold: 60 # Allow up to 5 minutes for migration to complete - {{- else }} {{- with .Values.mcpContextForge.probes.startup }} startupProbe: {{- include "helpers.renderProbe" (dict "probe" . "root" $) | nindent 12 }} {{- end }} - {{- end }} {{- with .Values.mcpContextForge.probes.readiness }} readinessProbe: diff --git a/charts/mcp-stack/templates/job-migration.yaml b/charts/mcp-stack/templates/job-migration.yaml deleted file mode 100644 index 0f510bb37..000000000 --- a/charts/mcp-stack/templates/job-migration.yaml +++ /dev/null @@ -1,76 +0,0 @@ -{{- if .Values.migration.enabled }} -apiVersion: batch/v1 -kind: Job -metadata: - name: {{ include "mcp-stack.fullname" . }}-migration - labels: - {{- include "mcp-stack.labels" . | nindent 4 }} - app.kubernetes.io/component: migration -spec: - # Job configuration - backoffLimit: {{ .Values.migration.backoffLimit }} - activeDeadlineSeconds: {{ .Values.migration.activeDeadlineSeconds }} - - template: - metadata: - labels: - {{- include "mcp-stack.labels" . | nindent 8 }} - app.kubernetes.io/component: migration - spec: - restartPolicy: {{ .Values.migration.restartPolicy }} - - containers: - - name: migration - image: "{{ .Values.migration.image.repository }}:{{ .Values.migration.image.tag }}" - imagePullPolicy: {{ .Values.migration.image.pullPolicy }} - - # Migration workflow: wait for DB → run migrations - command: ["/bin/sh"] - args: - - -c - - | - set -e - echo "🔍 Waiting for database to be ready..." - {{ .Values.migration.command.waitForDb }} - echo "✅ Database is ready!" - echo "🚀 Running database migrations..." - {{ .Values.migration.command.migrate }} - echo "✅ Migration job completed successfully!" - - env: - # ---------- POSTGRES ---------- - - name: POSTGRES_HOST - value: {{ printf "%s-postgres" (include "mcp-stack.fullname" .) }} - - name: POSTGRES_PORT - value: "{{ .Values.mcpContextForge.env.postgres.port }}" - - name: POSTGRES_DB - value: "{{ .Values.mcpContextForge.env.postgres.db }}" - - name: POSTGRES_USER - valueFrom: - secretKeyRef: - name: {{ include "mcp-stack.postgresSecretName" . | trim }} - key: POSTGRES_USER - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: {{ include "mcp-stack.postgresSecretName" . | trim }} - key: POSTGRES_PASSWORD - - # ---------- DERIVED URLS ---------- - - name: DATABASE_URL - value: >- - postgresql://$(POSTGRES_USER):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT)/$(POSTGRES_DB) - - # ---------- LOGGING ---------- - - name: LOG_LEVEL - value: "INFO" - - # Resource limits - resources: -{{- toYaml .Values.migration.resources | nindent 12 }} - - {{- if .Values.global.imagePullSecrets }} - imagePullSecrets: - {{- toYaml .Values.global.imagePullSecrets | nindent 8 }} - {{- end }} -{{- end }} diff --git a/charts/mcp-stack/values.schema.json b/charts/mcp-stack/values.schema.json index 9e79ef378..334f76d40 100644 --- a/charts/mcp-stack/values.schema.json +++ b/charts/mcp-stack/values.schema.json @@ -628,12 +628,12 @@ }, "migration": { "type": "object", - "description": "Database migration configuration", + "description": "DEPRECATED: no-op (migrations are automated now). Kept for backward compatibility.", "properties": { "enabled": { "type": "boolean", "description": "Enable database migrations", - "default": true + "default": false }, "restartPolicy": { "type": "string", diff --git a/charts/mcp-stack/values.yaml b/charts/mcp-stack/values.yaml index 989553711..15ac3669e 100644 --- a/charts/mcp-stack/values.yaml +++ b/charts/mcp-stack/values.yaml @@ -235,7 +235,7 @@ mcpContextForge: # Runs as a Job before mcpgateway deployment ######################################################################## migration: - enabled: true # Set to false to skip migrations + enabled: false # DEPRECATED: ignored; migrations are automated now. # Job configuration restartPolicy: Never # Job should not restart on failure