From 0373f61ef734f5a509dda123dc73e84962874099 Mon Sep 17 00:00:00 2001 From: Janis Date: Mon, 15 Jun 2026 22:17:45 +0200 Subject: [PATCH] feat(nci-11): add Kubernetes manifests for nowchess-analysis service (#381) Add Argo Rollout (blueGreen), active/preview Services, and HPA for the new analysis service (port 8087). Wire image pins into all three overlay kustomizations and register the analysis Warehouse and freight entries in all three Kargo Stages (staging -> eu-central-1-prod / htwg-1-prod). Co-Authored-By: Claude Sonnet 4.6 --------- Co-authored-by: Janis Eccarius Reviewed-on: https://git.janis-eccarius.de/NowChess/GitOps/pulls/381 --- kargo-projects/nowchess/ncs-stage.yaml | 20 ++++++ kargo-projects/nowchess/ncs-warehouse.yaml | 15 +++++ nowchess/base/nowchess-hpa.yaml | 22 ++++++ nowchess/base/nowchess-rollouts.yaml | 67 +++++++++++++++++++ nowchess/base/nowchess-services.yaml | 30 +++++++++ nowchess/eu-central-1-prod/kustomization.yaml | 2 + .../eu-central-1-staging/kustomization.yaml | 9 +++ nowchess/htwg-1-prod/kustomization.yaml | 2 + 8 files changed, 167 insertions(+) diff --git a/kargo-projects/nowchess/ncs-stage.yaml b/kargo-projects/nowchess/ncs-stage.yaml index bd7d788..dc6d5cd 100755 --- a/kargo-projects/nowchess/ncs-stage.yaml +++ b/kargo-projects/nowchess/ncs-stage.yaml @@ -14,6 +14,12 @@ spec: - name: tagSuffix value: "" requestedFreight: + - origin: + kind: Warehouse + name: analysis + sources: + direct: true + requiredSoakTime: 5m0s - origin: kind: Warehouse name: account @@ -105,6 +111,13 @@ spec: - name: tagSuffix value: "" requestedFreight: + - origin: + kind: Warehouse + name: analysis + sources: + direct: false + stages: + - staging - origin: kind: Warehouse name: account @@ -204,6 +217,13 @@ spec: - name: tagSuffix value: "-x86_v2" requestedFreight: + - origin: + kind: Warehouse + name: analysis + sources: + direct: false + stages: + - staging - origin: kind: Warehouse name: account diff --git a/kargo-projects/nowchess/ncs-warehouse.yaml b/kargo-projects/nowchess/ncs-warehouse.yaml index 4731b47..b3d0c37 100755 --- a/kargo-projects/nowchess/ncs-warehouse.yaml +++ b/kargo-projects/nowchess/ncs-warehouse.yaml @@ -1,5 +1,20 @@ apiVersion: kargo.akuity.io/v1alpha1 kind: Warehouse +metadata: + name: analysis + namespace: nowchess-kargo +spec: + freightCreationPolicy: Automatic + interval: 5m0s + subscriptions: + - image: + discoveryLimit: 20 + imageSelectionStrategy: SemVer + repoURL: ghcr.io/now-chess/now-chess-systems/analysis + strictSemvers: true +--- +apiVersion: kargo.akuity.io/v1alpha1 +kind: Warehouse metadata: name: account namespace: nowchess-kargo diff --git a/nowchess/base/nowchess-hpa.yaml b/nowchess/base/nowchess-hpa.yaml index cc2bdb0..6b91ace 100755 --- a/nowchess/base/nowchess-hpa.yaml +++ b/nowchess/base/nowchess-hpa.yaml @@ -1,5 +1,27 @@ apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler +metadata: + name: nowchess-analysis + labels: + app.kubernetes.io/name: nowchess-analysis + app.kubernetes.io/part-of: nowchess +spec: + scaleTargetRef: + apiVersion: argoproj.io/v1alpha1 + kind: Rollout + name: nowchess-analysis + minReplicas: 1 + maxReplicas: 3 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 90 +--- +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler metadata: name: nowchess-account spec: diff --git a/nowchess/base/nowchess-rollouts.yaml b/nowchess/base/nowchess-rollouts.yaml index 4f9fa8f..11baa8b 100755 --- a/nowchess/base/nowchess-rollouts.yaml +++ b/nowchess/base/nowchess-rollouts.yaml @@ -755,6 +755,73 @@ spec: --- apiVersion: argoproj.io/v1alpha1 kind: Rollout +metadata: + name: nowchess-analysis + labels: + app: nowchess-analysis + app.kubernetes.io/name: nowchess-analysis + app.kubernetes.io/part-of: nowchess +spec: + selector: + matchLabels: + app: nowchess-analysis + template: + metadata: + labels: + app: nowchess-analysis + annotations: + k8s.grafana.com/scrape: "true" + k8s.grafana.com/metrics_path: "/q/metrics" + k8s.grafana.com/metrics_portNumber: "8087" + spec: + imagePullSecrets: + - name: ghcr-pull-secret + containers: + - name: nowchess-analysis + image: ghcr.io/now-chess/now-chess-systems/analysis:latest + imagePullPolicy: Always + envFrom: + - configMapRef: + name: nowchess-env-config + env: + - name: INTERNAL_SECRET + valueFrom: + secretKeyRef: + name: ncs-internal-secret + key: INTERNAL_SECRET + ports: + - containerPort: 8087 + protocol: TCP + livenessProbe: + httpGet: + path: /q/health/live + port: 8087 + initialDelaySeconds: 0 + periodSeconds: 10 + readinessProbe: + httpGet: + path: /q/health/ready + port: 8087 + initialDelaySeconds: 0 + periodSeconds: 5 + resources: + requests: + cpu: "5m" + memory: "96Mi" + limits: + cpu: "500m" + memory: "256Mi" + rollbackWindow: + revisions: 3 + strategy: + blueGreen: + activeService: nowchess-analysis-active + previewService: nowchess-analysis-preview + autoPromotionEnabled: true + previewReplicaCount: 1 +--- +apiVersion: argoproj.io/v1alpha1 +kind: Rollout metadata: name: nowchess-tournament labels: diff --git a/nowchess/base/nowchess-services.yaml b/nowchess/base/nowchess-services.yaml index e70b08a..19d4c1c 100755 --- a/nowchess/base/nowchess-services.yaml +++ b/nowchess/base/nowchess-services.yaml @@ -1,5 +1,35 @@ apiVersion: v1 kind: Service +metadata: + name: nowchess-analysis-active + labels: + app.kubernetes.io/name: nowchess-analysis + app.kubernetes.io/part-of: nowchess +spec: + selector: + app: nowchess-analysis + ports: + - protocol: TCP + port: 8087 + targetPort: 8087 +--- +apiVersion: v1 +kind: Service +metadata: + name: nowchess-analysis-preview + labels: + app.kubernetes.io/name: nowchess-analysis + app.kubernetes.io/part-of: nowchess +spec: + selector: + app: nowchess-analysis + ports: + - protocol: TCP + port: 8087 + targetPort: 8087 +--- +apiVersion: v1 +kind: Service metadata: name: nowchess-account-active spec: diff --git a/nowchess/eu-central-1-prod/kustomization.yaml b/nowchess/eu-central-1-prod/kustomization.yaml index 2c861e7..c5f6057 100755 --- a/nowchess/eu-central-1-prod/kustomization.yaml +++ b/nowchess/eu-central-1-prod/kustomization.yaml @@ -32,6 +32,8 @@ patches: kind: ConfigMap name: nowchess-frontend-env-config images: +- name: ghcr.io/now-chess/now-chess-systems/analysis + newTag: 0.1.0 - name: ghcr.io/now-chess/now-chess-systems/account newTag: 0.24.0 - name: ghcr.io/now-chess/now-chess-systems/bot-platform diff --git a/nowchess/eu-central-1-staging/kustomization.yaml b/nowchess/eu-central-1-staging/kustomization.yaml index c2c1b81..273a0d6 100755 --- a/nowchess/eu-central-1-staging/kustomization.yaml +++ b/nowchess/eu-central-1-staging/kustomization.yaml @@ -21,6 +21,13 @@ patches: target: kind: ConfigMap name: nowchess-env-config +- patch: |- + apiVersion: autoscaling/v2 + kind: HorizontalPodAutoscaler + metadata: + name: nowchess-analysis + spec: + maxReplicas: 1 - patch: |- apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler @@ -87,6 +94,8 @@ patches: spec: replicas: 1 images: +- name: ghcr.io/now-chess/now-chess-systems/analysis + newTag: 0.1.0 - name: ghcr.io/now-chess/now-chess-systems/account newTag: 0.24.0 - name: ghcr.io/now-chess/now-chess-systems/bot-platform diff --git a/nowchess/htwg-1-prod/kustomization.yaml b/nowchess/htwg-1-prod/kustomization.yaml index 7eb44b1..fdd8c1c 100755 --- a/nowchess/htwg-1-prod/kustomization.yaml +++ b/nowchess/htwg-1-prod/kustomization.yaml @@ -31,6 +31,8 @@ patches: kind: ConfigMap name: nowchess-frontend-env-config images: +- name: ghcr.io/now-chess/now-chess-systems/analysis + newTag: 0.1.0-x86_v2 - name: ghcr.io/now-chess/now-chess-systems/account newTag: 0.24.0-x86_v2 - name: ghcr.io/now-chess/now-chess-systems/bot-platform