apiVersion: apps/v1 kind: Deployment metadata: name: backtesting-service namespace: foxhunt labels: app: backtesting-service component: backtesting tier: backend version: v1 spec: replicas: 2 revisionHistoryLimit: 10 strategy: type: RollingUpdate rollingUpdate: maxUnavailable: 1 maxSurge: 1 selector: matchLabels: app: backtesting-service template: metadata: labels: app: backtesting-service component: backtesting tier: backend version: v1 annotations: prometheus.io/scrape: "true" prometheus.io/port: "9093" prometheus.io/path: "/metrics" spec: serviceAccountName: foxhunt-backtesting-service securityContext: runAsNonRoot: true runAsUser: 1000 runAsGroup: 1000 fsGroup: 1000 containers: - name: backtesting-service image: foxhunt/backtesting-service:latest imagePullPolicy: Always ports: - name: grpc containerPort: 50053 protocol: TCP - name: metrics containerPort: 9093 protocol: TCP - name: health containerPort: 8082 protocol: TCP env: - name: BACKTESTING_SERVICE_HOST value: "0.0.0.0" - name: BACKTESTING_SERVICE_PORT value: "50053" - name: METRICS_PORT value: "9093" - name: DATABASE_URL valueFrom: secretKeyRef: name: foxhunt-secrets key: database-url - name: REDIS_URL valueFrom: configMapKeyRef: name: foxhunt-config key: redis-url - name: VAULT_ADDR valueFrom: configMapKeyRef: name: foxhunt-config key: vault-addr - name: VAULT_TOKEN valueFrom: secretKeyRef: name: foxhunt-secrets key: vault-token - name: RUST_LOG value: "info,backtesting_service=debug" - name: RUST_BACKTRACE value: "1" resources: requests: cpu: "1000m" memory: "1Gi" limits: cpu: "2000m" memory: "2Gi" livenessProbe: httpGet: path: /health port: 8082 initialDelaySeconds: 30 periodSeconds: 10 timeoutSeconds: 5 successThreshold: 1 failureThreshold: 3 readinessProbe: httpGet: path: /ready port: 8082 initialDelaySeconds: 10 periodSeconds: 5 timeoutSeconds: 3 successThreshold: 1 failureThreshold: 3 volumeMounts: - name: config mountPath: /app/config readOnly: true - name: logs mountPath: /app/logs - name: data mountPath: /app/data - name: results mountPath: /app/results volumes: - name: config configMap: name: backtesting-service-config - name: logs emptyDir: {} - name: data persistentVolumeClaim: claimName: backtesting-data-pvc - name: results persistentVolumeClaim: claimName: backtesting-results-pvc affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 podAffinityTerm: labelSelector: matchExpressions: - key: app operator: In values: - backtesting-service topologyKey: kubernetes.io/hostname