From 167e49788e40a4f5ed9426f23115e4f667abae82 Mon Sep 17 00:00:00 2001 From: Chris Coutinho Date: Sun, 9 Nov 2025 07:14:16 +0100 Subject: [PATCH] feat(helm): add Qdrant local mode support with three deployment options [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for three Qdrant deployment modes in Helm chart: 1. In-memory mode (:memory:) - Default, zero-config, ephemeral storage 2. Persistent local mode (path-based) - File-based storage with PVC 3. Network mode (URL-based) - Dedicated Qdrant service or external instance Changes: - Restructured qdrant configuration in values.yaml with mode selector - Added conditional environment variable logic in deployment.yaml - Created PVC template for persistent local mode with optional existingClaim - Added qdrantPvcName helper template in _helpers.tpl - Updated README.md with Helm registry URL (https://cbcoutinho.github.io/nextcloud-mcp-server) Breaking change: Default changed from requiring qdrant.enabled to using in-memory mode (:memory:) when no Qdrant configuration is provided. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- charts/nextcloud-mcp-server/README.md | 16 ++- .../templates/_helpers.tpl | 11 +++ .../templates/deployment.yaml | 35 +++++-- .../nextcloud-mcp-server/templates/pvc.yaml | 18 ++++ charts/nextcloud-mcp-server/values.yaml | 97 +++++++++++++------ 5 files changed, 138 insertions(+), 39 deletions(-) diff --git a/charts/nextcloud-mcp-server/README.md b/charts/nextcloud-mcp-server/README.md index 3082bbb..1c3d7b9 100644 --- a/charts/nextcloud-mcp-server/README.md +++ b/charts/nextcloud-mcp-server/README.md @@ -14,8 +14,12 @@ This Helm chart deploys the Nextcloud MCP (Model Context Protocol) Server on a K ### Quick Start with Basic Authentication ```bash +# Add the Helm repository +helm repo add nextcloud-mcp https://cbcoutinho.github.io/nextcloud-mcp-server +helm repo update + # Install with basic auth (recommended for most users) -helm install nextcloud-mcp ./helm/nextcloud-mcp-server \ +helm install nextcloud-mcp nextcloud-mcp/nextcloud-mcp-server \ --set nextcloud.host=https://cloud.example.com \ --set auth.basic.username=myuser \ --set auth.basic.password=mypassword @@ -47,7 +51,7 @@ resources: Install with your custom values: ```bash -helm install nextcloud-mcp ./helm/nextcloud-mcp-server -f custom-values.yaml +helm install nextcloud-mcp nextcloud-mcp/nextcloud-mcp-server -f custom-values.yaml ``` ### OAuth Authentication Mode (Experimental) @@ -529,13 +533,17 @@ openai: ### To upgrade an existing deployment: ```bash -helm upgrade nextcloud-mcp ./helm/nextcloud-mcp-server -f custom-values.yaml +# Update the repository +helm repo update + +# Upgrade with your custom values +helm upgrade nextcloud-mcp nextcloud-mcp/nextcloud-mcp-server -f custom-values.yaml ``` ### To upgrade with new values: ```bash -helm upgrade nextcloud-mcp ./helm/nextcloud-mcp-server \ +helm upgrade nextcloud-mcp nextcloud-mcp/nextcloud-mcp-server \ --set resources.limits.memory=1Gi ``` diff --git a/charts/nextcloud-mcp-server/templates/_helpers.tpl b/charts/nextcloud-mcp-server/templates/_helpers.tpl index b8616f1..d6656b3 100644 --- a/charts/nextcloud-mcp-server/templates/_helpers.tpl +++ b/charts/nextcloud-mcp-server/templates/_helpers.tpl @@ -94,6 +94,17 @@ Create the name of the PVC to use for OAuth storage {{- end }} {{- end }} +{{/* +Create the name of the PVC to use for Qdrant local persistent storage +*/}} +{{- define "nextcloud-mcp-server.qdrantPvcName" -}} +{{- if .Values.qdrant.localPersistence.existingClaim }} +{{- .Values.qdrant.localPersistence.existingClaim }} +{{- else }} +{{- include "nextcloud-mcp-server.fullname" . }}-qdrant-data +{{- end }} +{{- end }} + {{/* Return the MCP server port */}} diff --git a/charts/nextcloud-mcp-server/templates/deployment.yaml b/charts/nextcloud-mcp-server/templates/deployment.yaml index 51a4fbb..08c14fc 100644 --- a/charts/nextcloud-mcp-server/templates/deployment.yaml +++ b/charts/nextcloud-mcp-server/templates/deployment.yaml @@ -152,19 +152,33 @@ spec: value: {{ .Values.vectorSync.queueMaxSize | quote }} {{- end }} # Qdrant Vector Database - {{- if .Values.qdrant.enabled }} + {{- if eq .Values.qdrant.mode "network" }} + # Network mode: Use dedicated Qdrant service + {{- if .Values.qdrant.networkMode.deploySubchart }} - name: QDRANT_URL value: "http://{{ .Release.Name }}-qdrant:6333" - - name: QDRANT_COLLECTION - value: "nextcloud_content" - {{- if .Values.qdrant.apiKey }} + {{- else if .Values.qdrant.networkMode.externalUrl }} + - name: QDRANT_URL + value: {{ .Values.qdrant.networkMode.externalUrl | quote }} + {{- end }} + {{- if or .Values.qdrant.networkMode.apiKey .Values.qdrant.networkMode.existingSecret }} - name: QDRANT_API_KEY valueFrom: secretKeyRef: - name: {{ .Release.Name }}-qdrant - key: api-key + name: {{ .Values.qdrant.networkMode.existingSecret | default (printf "%s-qdrant" .Release.Name) }} + key: {{ .Values.qdrant.networkMode.secretKey }} {{- end }} + {{- else if eq .Values.qdrant.mode "persistent" }} + # Persistent local mode: File-based storage + - name: QDRANT_LOCATION + value: {{ .Values.qdrant.localPersistence.dataPath | quote }} + {{- else }} + # In-memory mode (default): Ephemeral storage + - name: QDRANT_LOCATION + value: ":memory:" {{- end }} + - name: QDRANT_COLLECTION + value: {{ .Values.qdrant.collection | quote }} # Ollama Embedding Service {{- if or .Values.ollama.enabled .Values.ollama.url }} - name: OLLAMA_BASE_URL @@ -206,6 +220,10 @@ spec: - name: oauth-storage mountPath: /app/.oauth {{- end }} + {{- if and (eq .Values.qdrant.mode "persistent") .Values.qdrant.localPersistence.enabled }} + - name: qdrant-data + mountPath: /app/data + {{- end }} {{- with .Values.volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} @@ -217,6 +235,11 @@ spec: persistentVolumeClaim: claimName: {{ include "nextcloud-mcp-server.oauthPvcName" . }} {{- end }} + {{- if and (eq .Values.qdrant.mode "persistent") .Values.qdrant.localPersistence.enabled }} + - name: qdrant-data + persistentVolumeClaim: + claimName: {{ include "nextcloud-mcp-server.qdrantPvcName" . }} + {{- end }} {{- with .Values.volumes }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/nextcloud-mcp-server/templates/pvc.yaml b/charts/nextcloud-mcp-server/templates/pvc.yaml index 0d722cd..fee7580 100644 --- a/charts/nextcloud-mcp-server/templates/pvc.yaml +++ b/charts/nextcloud-mcp-server/templates/pvc.yaml @@ -15,3 +15,21 @@ spec: requests: storage: {{ .Values.auth.oauth.persistence.size }} {{- end }} +--- +{{- if and (eq .Values.qdrant.mode "persistent") .Values.qdrant.localPersistence.enabled (not .Values.qdrant.localPersistence.existingClaim) }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "nextcloud-mcp-server.fullname" . }}-qdrant-data + labels: + {{- include "nextcloud-mcp-server.labels" . | nindent 4 }} +spec: + accessModes: + - {{ .Values.qdrant.localPersistence.accessMode }} + {{- if .Values.qdrant.localPersistence.storageClass }} + storageClassName: {{ .Values.qdrant.localPersistence.storageClass }} + {{- end }} + resources: + requests: + storage: {{ .Values.qdrant.localPersistence.size }} +{{- end }} diff --git a/charts/nextcloud-mcp-server/values.yaml b/charts/nextcloud-mcp-server/values.yaml index b407591..06a96df 100644 --- a/charts/nextcloud-mcp-server/values.yaml +++ b/charts/nextcloud-mcp-server/values.yaml @@ -277,37 +277,76 @@ vectorSync: # Maximum queue size for documents pending indexing queueMaxSize: 10000 -# Qdrant Vector Database -# Deployed as a subchart when enabled. All values are passed through to the qdrant/qdrant chart. -# See https://github.com/qdrant/qdrant-helm for full configuration options. +# Qdrant Vector Database Configuration +# Three deployment modes available: +# 1. Local In-Memory: Fast, ephemeral, zero-config (mode: "memory") +# 2. Local Persistent: File-based, survives restarts (mode: "persistent") +# 3. Network: Dedicated Qdrant service, production-ready (mode: "network") qdrant: - # Enable Qdrant subchart deployment - enabled: false - # Number of Qdrant replicas - replicaCount: 1 - image: - # Qdrant version - tag: v1.12.5 - # Optional API key for Qdrant authentication - apiKey: "" - config: - cluster: - # Enable distributed cluster mode - enabled: false - # Persistent storage for vector data - persistence: - size: 10Gi + # Qdrant mode: "memory", "persistent", or "network" + # - memory: In-memory storage (:memory:) - default, zero config, data lost on restart + # - persistent: Local file storage - data persists across restarts, suitable for small/medium deployments + # - network: Dedicated Qdrant service (see networkMode below) + mode: "memory" + + # Collection name for vector data + collection: "nextcloud_content" + + # Local persistent mode configuration (only used when mode: "persistent") + localPersistence: + # Enable persistent volume for local Qdrant data + enabled: true + # Storage class (leave empty for default) storageClass: "" - accessModes: - - ReadWriteOnce - # Resource limits and requests - resources: - requests: - cpu: 200m - memory: 512Mi - limits: - cpu: 1000m - memory: 2Gi + accessMode: ReadWriteOnce + # Size for local Qdrant storage + size: 1Gi + # Path where Qdrant data is stored (relative to /app/data) + # Default: /app/data/qdrant + dataPath: "/app/data/qdrant" + # Use existing PVC + existingClaim: "" + + # Network mode configuration (only used when mode: "network") + networkMode: + # Deploy Qdrant as a subchart (if true) or use external Qdrant (if false) + deploySubchart: false + # External Qdrant URL (used when deploySubchart: false) + # Example: "http://qdrant.default.svc.cluster.local:6333" + externalUrl: "" + # Optional API key for Qdrant authentication + apiKey: "" + # Use existing secret for API key + existingSecret: "" + secretKey: "api-key" + + # Qdrant subchart configuration (only used when mode: "network" and networkMode.deploySubchart: true) + # All values are passed through to the qdrant/qdrant chart. + # See https://github.com/qdrant/qdrant-helm for full configuration options. + subchart: + # Number of Qdrant replicas + replicaCount: 1 + image: + # Qdrant version + tag: v1.12.5 + config: + cluster: + # Enable distributed cluster mode + enabled: false + # Persistent storage for vector data + persistence: + size: 10Gi + storageClass: "" + accessModes: + - ReadWriteOnce + # Resource limits and requests + resources: + requests: + cpu: 200m + memory: 512Mi + limits: + cpu: 1000m + memory: 2Gi # Ollama Embedding Service # Deployed as a subchart when enabled. All values are passed through to the ollama/ollama chart.