diff --git a/smarketing-ai/deployments/smarketing-ai/smarketing-ai-deployment.yaml b/smarketing-ai/deployments/smarketing-ai/smarketing-ai-deployment.yaml new file mode 100644 index 0000000..d1f450f --- /dev/null +++ b/smarketing-ai/deployments/smarketing-ai/smarketing-ai-deployment.yaml @@ -0,0 +1,110 @@ +# ConfigMap +apiVersion: v1 +kind: ConfigMap +metadata: + name: smarketing-config + namespace: smarketing +data: + SERVER_HOST: "0.0.0.0" + SERVER_PORT: "5001" + UPLOAD_FOLDER: "/app/uploads" + MAX_CONTENT_LENGTH: "16777216" + ALLOWED_EXTENSIONS: "png,jpg,jpeg,gif,webp" + AZURE_STORAGE_CONTAINER_NAME: "ai-content" +--- +# Secret +apiVersion: v1 +kind: Secret +metadata: + name: smarketing-secret + namespace: smarketing +type: Opaque +stringData: + SECRET_KEY: "your-secret-key-here" + CLAUDE_API_KEY: "your-claude-api-key-here" + OPENAI_API_KEY: "your-openai-api-key-here" + AZURE_STORAGE_ACCOUNT_NAME: "your-azure-storage-account" + AZURE_STORAGE_ACCOUNT_KEY: "your-azure-storage-key" +--- +# Deployment +apiVersion: apps/v1 +kind: Deployment +metadata: + name: smarketing-ai + namespace: smarketing + labels: + app: smarketing-ai +spec: + replicas: 1 + selector: + matchLabels: + app: smarketing-ai + template: + metadata: + labels: + app: smarketing-ai + spec: + imagePullSecrets: + - name: acr-secret + containers: + - name: smarketing-ai + image: acrdigitalgarage02.azurecr.io/won/smarketing-ai:latest + imagePullPolicy: Always + ports: + - containerPort: 5001 + resources: + requests: + cpu: 256m + memory: 512Mi + limits: + cpu: 1024m + memory: 2048Mi + envFrom: + - configMapRef: + name: smarketing-config + - secretRef: + name: smarketing-secret + volumeMounts: + - name: upload-storage + mountPath: /app/uploads + - name: temp-storage + mountPath: /app/uploads/temp + livenessProbe: + httpGet: + path: /health + port: 5001 + initialDelaySeconds: 30 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 3 + readinessProbe: + httpGet: + path: /health + port: 5001 + initialDelaySeconds: 5 + periodSeconds: 5 + timeoutSeconds: 3 + failureThreshold: 3 + volumes: + - name: upload-storage + emptyDir: {} + - name: temp-storage + emptyDir: {} +--- +# Service (LoadBalancer type for External IP) +apiVersion: v1 +kind: Service +metadata: + name: smarketing-ai-service + namespace: smarketing + labels: + app: smarketing-ai +spec: + type: LoadBalancer + ports: + - port: 5001 + targetPort: 5001 + protocol: TCP + name: http + selector: + app: smarketing-ai