Add support for deploying Qdrant vector database and Ollama embedding service as optional helm chart dependencies. Enables semantic search capabilities for Nextcloud content with flexible deployment options. Chart Dependencies: - Add Qdrant v0.9.0 from qdrant/qdrant-helm (conditional) - Add Ollama v1.33.0 from otwld/ollama-helm (conditional) - Both dependencies only deploy when enabled Configuration (values.yaml): - vectorSync: Background sync settings (interval, workers, queue size) - qdrant: Subchart config with persistence, resources, clustering - ollama: Subchart config with model pull, persistence, resources - Support for external Ollama via ollama.url (no subchart deployment) - openai: Alternative embedding provider (OpenAI or compatible API) Environment Variables (deployment.yaml): - VECTOR_SYNC_* variables when vectorSync.enabled - QDRANT_URL, QDRANT_COLLECTION when qdrant.enabled - OLLAMA_BASE_URL, OLLAMA_EMBEDDING_MODEL when ollama enabled or URL set - OPENAI_API_KEY when openai.enabled Documentation: - README: New "Vector Search & Semantic Capabilities" section - README: Example 5 showing three deployment patterns - NOTES.txt: Conditional guidance when vector features enabled - Secret template for OpenAI API key management All features disabled by default for backward compatibility. Tested with helm template and helm lint. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
235 lines
9.6 KiB
YAML
235 lines
9.6 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "nextcloud-mcp-server.fullname" . }}
|
|
labels:
|
|
{{- include "nextcloud-mcp-server.labels" . | nindent 4 }}
|
|
spec:
|
|
{{- if not .Values.autoscaling.enabled }}
|
|
replicas: {{ .Values.replicaCount }}
|
|
{{- end }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "nextcloud-mcp-server.selectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
annotations:
|
|
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
|
|
{{- with .Values.podAnnotations }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "nextcloud-mcp-server.labels" . | nindent 8 }}
|
|
{{- with .Values.podLabels }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
spec:
|
|
{{- with .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
serviceAccountName: {{ include "nextcloud-mcp-server.serviceAccountName" . }}
|
|
securityContext:
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
{{- with .Values.initContainers }}
|
|
initContainers:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
containers:
|
|
- name: {{ .Chart.Name }}
|
|
securityContext:
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
image: "{{ .Values.image.repository }}:{{ include "nextcloud-mcp-server.imageTag" . }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
args:
|
|
- "--transport"
|
|
- "{{ .Values.mcp.transport }}"
|
|
{{- if eq .Values.auth.mode "oauth" }}
|
|
- "--oauth"
|
|
- "--oauth-token-type"
|
|
- "{{ .Values.auth.oauth.tokenType }}"
|
|
{{- end }}
|
|
{{- with .Values.mcp.extraArgs }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
ports:
|
|
- name: http
|
|
containerPort: {{ include "nextcloud-mcp-server.port" . }}
|
|
protocol: TCP
|
|
env:
|
|
# Nextcloud connection
|
|
- name: NEXTCLOUD_HOST
|
|
value: {{ .Values.nextcloud.host | quote }}
|
|
{{- if eq .Values.auth.mode "basic" }}
|
|
# Basic auth mode
|
|
- name: NEXTCLOUD_USERNAME
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ include "nextcloud-mcp-server.basicAuthSecretName" . }}
|
|
key: {{ .Values.auth.basic.usernameKey }}
|
|
- name: NEXTCLOUD_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ include "nextcloud-mcp-server.basicAuthSecretName" . }}
|
|
key: {{ .Values.auth.basic.passwordKey }}
|
|
{{- else if eq .Values.auth.mode "oauth" }}
|
|
# OAuth mode
|
|
- name: NEXTCLOUD_MCP_SERVER_URL
|
|
value: {{ include "nextcloud-mcp-server.mcpServerUrl" . | quote }}
|
|
- name: NEXTCLOUD_PUBLIC_ISSUER_URL
|
|
value: {{ include "nextcloud-mcp-server.publicIssuerUrl" . | quote }}
|
|
- name: NEXTCLOUD_OIDC_SCOPES
|
|
value: {{ .Values.auth.oauth.scopes | quote }}
|
|
{{- if .Values.auth.oauth.clientId }}
|
|
- name: NEXTCLOUD_OIDC_CLIENT_ID
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ include "nextcloud-mcp-server.oauthSecretName" . }}
|
|
key: {{ .Values.auth.oauth.clientIdKey }}
|
|
- name: NEXTCLOUD_OIDC_CLIENT_SECRET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ include "nextcloud-mcp-server.oauthSecretName" . }}
|
|
key: {{ .Values.auth.oauth.clientSecretKey }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.documentProcessing.enabled }}
|
|
# Document processing
|
|
- name: ENABLE_DOCUMENT_PROCESSING
|
|
value: {{ .Values.documentProcessing.enabled | quote }}
|
|
- name: DOCUMENT_PROCESSOR
|
|
value: {{ .Values.documentProcessing.defaultProcessor | quote }}
|
|
- name: PROGRESS_INTERVAL
|
|
value: {{ .Values.documentProcessing.progressInterval | quote }}
|
|
{{- if .Values.documentProcessing.unstructured.enabled }}
|
|
- name: ENABLE_UNSTRUCTURED
|
|
value: "true"
|
|
- name: UNSTRUCTURED_API_URL
|
|
value: {{ .Values.documentProcessing.unstructured.apiUrl | quote }}
|
|
- name: UNSTRUCTURED_TIMEOUT
|
|
value: {{ .Values.documentProcessing.unstructured.timeout | quote }}
|
|
- name: UNSTRUCTURED_STRATEGY
|
|
value: {{ .Values.documentProcessing.unstructured.strategy | quote }}
|
|
- name: UNSTRUCTURED_LANGUAGES
|
|
value: {{ .Values.documentProcessing.unstructured.languages | quote }}
|
|
{{- end }}
|
|
{{- if .Values.documentProcessing.tesseract.enabled }}
|
|
- name: ENABLE_TESSERACT
|
|
value: "true"
|
|
{{- if .Values.documentProcessing.tesseract.cmd }}
|
|
- name: TESSERACT_CMD
|
|
value: {{ .Values.documentProcessing.tesseract.cmd | quote }}
|
|
{{- end }}
|
|
- name: TESSERACT_LANG
|
|
value: {{ .Values.documentProcessing.tesseract.lang | quote }}
|
|
{{- end }}
|
|
{{- if .Values.documentProcessing.custom.enabled }}
|
|
- name: ENABLE_CUSTOM_PROCESSOR
|
|
value: "true"
|
|
- name: CUSTOM_PROCESSOR_NAME
|
|
value: {{ .Values.documentProcessing.custom.name | quote }}
|
|
- name: CUSTOM_PROCESSOR_URL
|
|
value: {{ .Values.documentProcessing.custom.url | quote }}
|
|
{{- if .Values.documentProcessing.custom.apiKey }}
|
|
- name: CUSTOM_PROCESSOR_API_KEY
|
|
value: {{ .Values.documentProcessing.custom.apiKey | quote }}
|
|
{{- end }}
|
|
- name: CUSTOM_PROCESSOR_TIMEOUT
|
|
value: {{ .Values.documentProcessing.custom.timeout | quote }}
|
|
- name: CUSTOM_PROCESSOR_TYPES
|
|
value: {{ .Values.documentProcessing.custom.types | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
# Vector Sync
|
|
- name: VECTOR_SYNC_ENABLED
|
|
value: {{ .Values.vectorSync.enabled | quote }}
|
|
{{- if .Values.vectorSync.enabled }}
|
|
- name: VECTOR_SYNC_SCAN_INTERVAL
|
|
value: {{ .Values.vectorSync.scanInterval | quote }}
|
|
- name: VECTOR_SYNC_PROCESSOR_WORKERS
|
|
value: {{ .Values.vectorSync.processorWorkers | quote }}
|
|
- name: VECTOR_SYNC_QUEUE_MAX_SIZE
|
|
value: {{ .Values.vectorSync.queueMaxSize | quote }}
|
|
{{- end }}
|
|
# Qdrant Vector Database
|
|
{{- if .Values.qdrant.enabled }}
|
|
- name: QDRANT_URL
|
|
value: "http://{{ .Release.Name }}-qdrant:6333"
|
|
- name: QDRANT_COLLECTION
|
|
value: "nextcloud_content"
|
|
{{- if .Values.qdrant.apiKey }}
|
|
- name: QDRANT_API_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ .Release.Name }}-qdrant
|
|
key: api-key
|
|
{{- end }}
|
|
{{- end }}
|
|
# Ollama Embedding Service
|
|
{{- if or .Values.ollama.enabled .Values.ollama.url }}
|
|
- name: OLLAMA_BASE_URL
|
|
value: {{ .Values.ollama.url | default (printf "http://%s-ollama:11434" .Release.Name) | quote }}
|
|
- name: OLLAMA_EMBEDDING_MODEL
|
|
value: {{ .Values.ollama.embeddingModel | quote }}
|
|
- name: OLLAMA_VERIFY_SSL
|
|
value: {{ .Values.ollama.verifySsl | quote }}
|
|
{{- end }}
|
|
# OpenAI Embedding Provider (alternative to Ollama)
|
|
{{- if .Values.openai.enabled }}
|
|
- name: OPENAI_API_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ .Values.openai.existingSecret | default (printf "%s-openai" (include "nextcloud-mcp-server.fullname" .)) }}
|
|
key: {{ .Values.openai.secretKey }}
|
|
{{- if .Values.openai.baseUrl }}
|
|
- name: OPENAI_BASE_URL
|
|
value: {{ .Values.openai.baseUrl | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- with .Values.extraEnv }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.extraEnvFrom }}
|
|
envFrom:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
livenessProbe:
|
|
{{- toYaml .Values.livenessProbe | nindent 12 }}
|
|
readinessProbe:
|
|
{{- toYaml .Values.readinessProbe | nindent 12 }}
|
|
resources:
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
volumeMounts:
|
|
- name: tmp
|
|
mountPath: /tmp
|
|
{{- if and (eq .Values.auth.mode "oauth") .Values.auth.oauth.persistence.enabled }}
|
|
- name: oauth-storage
|
|
mountPath: /app/.oauth
|
|
{{- end }}
|
|
{{- with .Values.volumeMounts }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
volumes:
|
|
- name: tmp
|
|
emptyDir: {}
|
|
{{- if and (eq .Values.auth.mode "oauth") .Values.auth.oauth.persistence.enabled }}
|
|
- name: oauth-storage
|
|
persistentVolumeClaim:
|
|
claimName: {{ include "nextcloud-mcp-server.oauthPvcName" . }}
|
|
{{- end }}
|
|
{{- with .Values.volumes }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.nodeSelector }}
|
|
nodeSelector:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.affinity }}
|
|
affinity:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|