# EN: Order Service - Order Processing & POS API (SignalR WebSocket for POS/KDS) # VI: Order Service - Xu ly Order & POS API (SignalR WebSocket cho POS/KDS) apiVersion: apps/v1 kind: Deployment metadata: name: order-service namespace: production labels: app: order-service environment: production platform: goodgo tier: backend spec: replicas: 3 selector: matchLabels: app: order-service strategy: type: RollingUpdate rollingUpdate: maxSurge: 1 maxUnavailable: 0 template: metadata: labels: app: order-service environment: production spec: affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 podAffinityTerm: labelSelector: matchExpressions: - key: app operator: In values: - order-service topologyKey: kubernetes.io/hostname containers: - name: order-service image: goodgo/order-service-net:IMAGE_TAG imagePullPolicy: Always ports: - containerPort: 8080 protocol: TCP envFrom: - configMapRef: name: goodgo-config - secretRef: name: goodgo-secrets env: - name: ConnectionStrings__DefaultConnection valueFrom: secretKeyRef: name: goodgo-secrets key: ORDER_DATABASE_URL - name: IamService__ServiceName value: "order-service" # EN: Inter-service communication # VI: Giao tiep giua cac service - name: CatalogService__BaseUrl value: "http://catalog-service:8080" - name: InventoryService__BaseUrl value: "http://inventory-service:8080" - name: WalletService__BaseUrl value: "http://wallet-service:8080" resources: requests: memory: "512Mi" cpu: "500m" limits: memory: "1Gi" cpu: "1000m" livenessProbe: httpGet: path: /health/live port: 8080 initialDelaySeconds: 30 periodSeconds: 10 timeoutSeconds: 5 failureThreshold: 3 readinessProbe: httpGet: path: /health/ready port: 8080 initialDelaySeconds: 10 periodSeconds: 5 timeoutSeconds: 3 failureThreshold: 3 startupProbe: httpGet: path: /health/live port: 8080 initialDelaySeconds: 5 periodSeconds: 5 failureThreshold: 12 --- apiVersion: v1 kind: Service metadata: name: order-service namespace: production labels: app: order-service environment: production spec: selector: app: order-service ports: - name: http protocol: TCP port: 8080 targetPort: 8080 type: ClusterIP --- apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: order-service-hpa namespace: production labels: app: order-service spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: order-service minReplicas: 3 maxReplicas: 10 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 70 - type: Resource resource: name: memory target: type: Utilization averageUtilization: 80