# deployment/manifests/deployment.yaml.fixed apiVersion: apps/v1 kind: Deployment metadata: name: vector-api labels: app: vector-api spec: replicas: 1 selector: matchLabels: app: vector-api template: metadata: labels: app: vector-api spec: # ๐Ÿ”ง ๋ณผ๋ฅจ ๊ถŒํ•œ ์„ค์ •์„ ์œ„ํ•œ initContainer initContainers: - name: volume-permissions image: busybox:1.35 command: - /bin/sh - -c - | echo "=== ๋ณผ๋ฅจ ๊ถŒํ•œ ์„ค์ • ์‹œ์ž‘ ===" mkdir -p /app/vectordb chown -R 1000:1000 /app/vectordb chmod -R 755 /app/vectordb echo "=== ๋ณผ๋ฅจ ๊ถŒํ•œ ์„ค์ • ์™„๋ฃŒ ===" volumeMounts: - name: vector-db-storage mountPath: /app/vectordb securityContext: runAsUser: 0 containers: - name: vector-api image: acrdigitalgarage03.azurecr.io/vector-api:latest imagePullPolicy: Always ports: - containerPort: 8000 # ๐Ÿ”ง ๋ณด์•ˆ ์ปจํ…์ŠคํŠธ securityContext: runAsNonRoot: true runAsUser: 1000 runAsGroup: 1000 allowPrivilegeEscalation: false readOnlyRootFilesystem: false # ๐Ÿ”ง ๋ฆฌ์†Œ์Šค ์„ค์ • resources: requests: memory: "4Gi" cpu: "1000m" limits: memory: "8Gi" cpu: "2000m" # ๐Ÿฅ ํ—ฌ์Šค์ฒดํฌ ์„ค์ • livenessProbe: httpGet: path: /health port: 8000 initialDelaySeconds: 120 periodSeconds: 30 timeoutSeconds: 15 failureThreshold: 3 readinessProbe: httpGet: path: /health port: 8000 initialDelaySeconds: 60 periodSeconds: 10 timeoutSeconds: 10 failureThreshold: 3 # ๐Ÿ“‚ ๋ณผ๋ฅจ ๋งˆ์šดํŠธ volumeMounts: - name: vector-db-storage mountPath: /app/vectordb # ConfigMap ํ™˜๊ฒฝ ๋ณ€์ˆ˜ envFrom: - configMapRef: name: vector-api-config # ๐ŸŒ ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์„ค์ • (์ธ์ฆ ํ•„๋“œ ์ œ๊ฑฐ) env: - name: PYTHONUNBUFFERED value: "1" - name: PYTHONDONTWRITEBYTECODE value: "1" # ๐Ÿ”ง ChromaDB ๊ธฐ๋ณธ ์„ค์ • (์ธ์ฆ ํ•„๋“œ ์ œ๊ฑฐ) - name: ANONYMIZED_TELEMETRY value: "False" - name: CHROMA_DB_IMPL value: "duckdb+parquet" - name: ALLOW_RESET value: "True" # ๐Ÿ”ง ๋กœ๊ทธ ๋ ˆ๋ฒจ - name: LOG_LEVEL value: "info" # ๐Ÿ”ง Claude API (ConfigMap์—์„œ ๊ฐ€์ ธ์˜ค๊ธฐ) - name: CLAUDE_API_KEY valueFrom: secretKeyRef: name: vector-api-secret key: CLAUDE_API_KEY - name: CLAUDE_MODEL valueFrom: configMapKeyRef: name: vector-api-config key: CLAUDE_MODEL # ๐Ÿ”ง ๊ธฐํƒ€ ์„ค์ • (ConfigMap์—์„œ ๊ฐ€์ ธ์˜ค๊ธฐ) - name: APP_TITLE valueFrom: configMapKeyRef: name: vector-api-config key: APP_TITLE - name: APP_VERSION valueFrom: configMapKeyRef: name: vector-api-config key: APP_VERSION # ๐Ÿ“ฆ ๋ณผ๋ฅจ ์„ค์ • volumes: - name: vector-db-storage persistentVolumeClaim: claimName: vector-db-pvc # ๐Ÿ” ์ด๋ฏธ์ง€ Pull Secret imagePullSecrets: - name: acr-secret # ๐ŸŽฏ ๋…ธ๋“œ ์„ ํƒ ๋ฐ ๋ฐฐ์น˜ ์„ค์ • nodeSelector: agentpool: aipool tolerations: - key: "dedicated" operator: "Equal" value: "aipool" effect: "NoSchedule" affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 podAffinityTerm: labelSelector: matchExpressions: - key: app operator: In values: - vector-api topologyKey: kubernetes.io/hostname restartPolicy: Always dnsPolicy: ClusterFirst