apiVersion: apps/v1 kind: Deployment metadata: name: escape-game labels: app: escape-game spec: replicas: 2 selector: matchLabels: app: escape-game template: metadata: labels: app: escape-game spec: containers: - name: server image: ${IMAGE_NAME} imagePullPolicy: Always ports: - containerPort: 8080 name: http protocol: TCP env: - name: REDIS_ADDR value: "redis:6379" - name: NATS_URL value: "nats://nats:4222" - name: TOTAL_REPLICAS value: "2" - name: POD_NAME valueFrom: fieldRef: fieldPath: metadata.name livenessProbe: httpGet: path: /health port: 8080 initialDelaySeconds: 10 periodSeconds: 30 timeoutSeconds: 5 readinessProbe: httpGet: path: /health port: 8080 initialDelaySeconds: 5 periodSeconds: 10 timeoutSeconds: 3 resources: requests: memory: "128Mi" cpu: "250m" limits: memory: "512Mi" cpu: "250m" volumeMounts: - name: assets mountPath: /root/cmd/client/web/assets volumes: - name: assets persistentVolumeClaim: claimName: game-assets-pvc --- apiVersion: v1 kind: Service metadata: name: escape-game labels: app: escape-game spec: type: ClusterIP selector: app: escape-game ports: - name: http port: 80 targetPort: 8080 protocol: TCP sessionAffinity: ClientIP sessionAffinityConfig: clientIP: timeoutSeconds: 3600