apiVersion: apps/v1 kind: Deployment metadata: name: api-gateway namespace: foxhunt labels: app: api-gateway component: gateway tier: frontend version: v1 spec: replicas: 3 revisionHistoryLimit: 10 strategy: type: RollingUpdate rollingUpdate: maxUnavailable: 1 maxSurge: 1 selector: matchLabels: app: api-gateway template: metadata: labels: app: api-gateway component: gateway tier: frontend version: v1 annotations: prometheus.io/scrape: "true" prometheus.io/port: "9091" prometheus.io/path: "/metrics" spec: serviceAccountName: foxhunt-api-gateway securityContext: runAsNonRoot: true runAsUser: 1000 runAsGroup: 1000 fsGroup: 1000 containers: - name: api-gateway image: foxhunt/api-gateway:latest imagePullPolicy: Always ports: - name: grpc containerPort: 50051 protocol: TCP - name: metrics containerPort: 9091 protocol: TCP - name: health containerPort: 8080 protocol: TCP env: - name: API_GATEWAY_HOST value: "0.0.0.0" - name: API_GATEWAY_PORT value: "50051" - name: METRICS_PORT value: "9091" - name: JWT_SECRET valueFrom: secretKeyRef: name: foxhunt-secrets key: jwt-secret - name: DATABASE_URL valueFrom: secretKeyRef: name: foxhunt-secrets key: database-url - name: REDIS_URL valueFrom: configMapKeyRef: name: foxhunt-config key: redis-url - name: RUST_LOG value: "info,api_gateway=debug" - name: RUST_BACKTRACE value: "1" resources: requests: cpu: "1000m" memory: "512Mi" limits: cpu: "2000m" memory: "1Gi" livenessProbe: httpGet: path: /health/liveness port: 8080 initialDelaySeconds: 30 periodSeconds: 10 timeoutSeconds: 5 successThreshold: 1 failureThreshold: 3 readinessProbe: httpGet: path: /health/readiness port: 8080 initialDelaySeconds: 10 periodSeconds: 5 timeoutSeconds: 3 successThreshold: 1 failureThreshold: 3 startupProbe: httpGet: path: /health/startup port: 8080 initialDelaySeconds: 0 periodSeconds: 5 timeoutSeconds: 3 successThreshold: 1 failureThreshold: 30 volumeMounts: - name: config mountPath: /app/config readOnly: true - name: logs mountPath: /app/logs volumes: - name: config configMap: name: api-gateway-config - name: logs emptyDir: {} affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 podAffinityTerm: labelSelector: matchExpressions: - key: app operator: In values: - api-gateway topologyKey: kubernetes.io/hostname