diff --git a/nowchess/base/nowchess-hpa.yaml b/nowchess/base/nowchess-hpa.yaml index e2bb769..a5e8784 100755 --- a/nowchess/base/nowchess-hpa.yaml +++ b/nowchess/base/nowchess-hpa.yaml @@ -130,3 +130,22 @@ spec: target: type: Utilization averageUtilization: 70 +--- +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: nowchess-tournament +spec: + scaleTargetRef: + apiVersion: argoproj.io/v1alpha1 + kind: Rollout + name: nowchess-tournament + minReplicas: 1 + maxReplicas: 3 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 70 diff --git a/nowchess/base/nowchess-rollouts.yaml b/nowchess/base/nowchess-rollouts.yaml index d51a63a..4b2cbad 100755 --- a/nowchess/base/nowchess-rollouts.yaml +++ b/nowchess/base/nowchess-rollouts.yaml @@ -745,3 +745,99 @@ spec: previewService: nowchess-frontend-preview autoPromotionEnabled: true previewReplicaCount: 1 +--- +apiVersion: argoproj.io/v1alpha1 +kind: Rollout +metadata: + name: nowchess-tournament + labels: + app: nowchess-tournament +spec: + selector: + matchLabels: + app: nowchess-tournament + template: + metadata: + labels: + app: nowchess-tournament + annotations: + k8s.grafana.com/scrape: "true" + k8s.grafana.com/metrics_path: "/q/metrics" + k8s.grafana.com/metrics_portNumber: "8088" + spec: + imagePullSecrets: + - name: ghcr-pull-secret + containers: + - name: nowchess-tournament + image: ghcr.io/now-chess/now-chess-systems/tournament:latest + imagePullPolicy: Always + envFrom: + - configMapRef: + name: nowchess-env-config + env: + - name: REDIS_HOST + value: redis-master.redis.svc.cluster.local + - name: REDIS_PORT + value: "6379" + - name: INTERNAL_SECRET + valueFrom: + secretKeyRef: + name: ncs-internal-secret + key: INTERNAL_SECRET + - name: QUARKUS_REST_CLIENT_CORE_SERVICE_URL + value: http://nowchess-core-active:8080 + - name: DB_USER + valueFrom: + secretKeyRef: + name: ncs-db-secrets + key: TOURNAMENT_DB_USER + - name: DB_PASSWORD + valueFrom: + secretKeyRef: + name: ncs-db-secrets + key: TOURNAMENT_DB_PASSWORD + - name: DB_URL + valueFrom: + secretKeyRef: + name: ncs-db-secrets + key: TOURNAMENT_DB_URL + - name: MP_JWT_VERIFY_PUBLICKEY_LOCATION + value: /secrets/jwt/public.pem + volumeMounts: + - name: jwt-keys + mountPath: /secrets/jwt + readOnly: true + ports: + - containerPort: 8088 + protocol: TCP + livenessProbe: + httpGet: + path: /q/health/live + port: 8088 + initialDelaySeconds: 0 + periodSeconds: 10 + readinessProbe: + httpGet: + path: /q/health/ready + port: 8088 + initialDelaySeconds: 0 + periodSeconds: 5 + resources: + requests: + cpu: "5m" + memory: "96Mi" + limits: + cpu: "500m" + memory: "256Mi" + volumes: + - name: jwt-keys + secret: + secretName: ncs-jwt-keys + rollbackWindow: + revisions: 3 + strategy: + blueGreen: + activeService: nowchess-tournament-active + previewService: nowchess-tournament-preview + autoPromotionEnabled: true + previewReplicaCount: 1 diff --git a/nowchess/base/nowchess-services.yaml b/nowchess/base/nowchess-services.yaml index a260de0..e70b08a 100755 --- a/nowchess/base/nowchess-services.yaml +++ b/nowchess/base/nowchess-services.yaml @@ -247,3 +247,27 @@ spec: - protocol: TCP port: 80 targetPort: 80 +--- +apiVersion: v1 +kind: Service +metadata: + name: nowchess-tournament-active +spec: + selector: + app: nowchess-tournament + ports: + - protocol: TCP + port: 8088 + targetPort: 8088 +--- +apiVersion: v1 +kind: Service +metadata: + name: nowchess-tournament-preview +spec: + selector: + app: nowchess-tournament + ports: + - protocol: TCP + port: 8088 + targetPort: 8088 diff --git a/nowchess/eu-central-1-prod/ingress.yaml b/nowchess/eu-central-1-prod/ingress.yaml index 27651ba..c368560 100755 --- a/nowchess/eu-central-1-prod/ingress.yaml +++ b/nowchess/eu-central-1-prod/ingress.yaml @@ -49,6 +49,13 @@ spec: name: nowchess-store-active port: number: 8085 + - path: /api/tournament + pathType: Prefix + backend: + service: + name: nowchess-tournament-active + port: + number: 8088 - path: /api pathType: Prefix backend: diff --git a/nowchess/eu-central-1-prod/kustomization.yaml b/nowchess/eu-central-1-prod/kustomization.yaml index be9756b..5310338 100755 --- a/nowchess/eu-central-1-prod/kustomization.yaml +++ b/nowchess/eu-central-1-prod/kustomization.yaml @@ -50,6 +50,8 @@ images: newTag: 0.18.0 - name: ghcr.io/now-chess/now-chess-systems/store newTag: 0.24.0 +- name: ghcr.io/now-chess/now-chess-systems/tournament + newTag: 0.1.0 - name: ghcr.io/now-chess/now-chess-systems/ws newTag: 0.14.0 configurations: diff --git a/nowchess/eu-central-1-staging/ingress.yaml b/nowchess/eu-central-1-staging/ingress.yaml index 9d60ce3..e4cd532 100755 --- a/nowchess/eu-central-1-staging/ingress.yaml +++ b/nowchess/eu-central-1-staging/ingress.yaml @@ -48,6 +48,13 @@ spec: name: nowchess-store-active port: number: 8085 + - path: /api/tournament + pathType: Prefix + backend: + service: + name: nowchess-tournament-active + port: + number: 8088 - path: /api pathType: Prefix backend: diff --git a/nowchess/eu-central-1-staging/kustomization.yaml b/nowchess/eu-central-1-staging/kustomization.yaml index 36105a7..0c3195b 100755 --- a/nowchess/eu-central-1-staging/kustomization.yaml +++ b/nowchess/eu-central-1-staging/kustomization.yaml @@ -72,6 +72,13 @@ patches: name: nowchess-store spec: maxReplicas: 1 +- patch: |- + apiVersion: autoscaling/v2 + kind: HorizontalPodAutoscaler + metadata: + name: nowchess-tournament + spec: + maxReplicas: 1 - patch: |- apiVersion: argoproj.io/v1alpha1 kind: Rollout @@ -98,6 +105,8 @@ images: newTag: 0.18.0 - name: ghcr.io/now-chess/now-chess-systems/store newTag: 0.24.0 +- name: ghcr.io/now-chess/now-chess-systems/tournament + newTag: 0.1.0 - name: ghcr.io/now-chess/now-chess-systems/ws newTag: 0.14.0 configurations: diff --git a/nowchess/htwg-1-prod/ingress.yaml b/nowchess/htwg-1-prod/ingress.yaml index 62ada79..13e77f9 100755 --- a/nowchess/htwg-1-prod/ingress.yaml +++ b/nowchess/htwg-1-prod/ingress.yaml @@ -46,6 +46,13 @@ spec: name: nowchess-store-active port: number: 8085 + - path: /api/tournament + pathType: Prefix + backend: + service: + name: nowchess-tournament-active + port: + number: 8088 - path: /api pathType: Prefix backend: diff --git a/nowchess/htwg-1-prod/kustomization.yaml b/nowchess/htwg-1-prod/kustomization.yaml index e1715ca..7cdc6a0 100755 --- a/nowchess/htwg-1-prod/kustomization.yaml +++ b/nowchess/htwg-1-prod/kustomization.yaml @@ -49,5 +49,7 @@ images: newTag: 0.18.0-x86_v2 - name: ghcr.io/now-chess/now-chess-systems/store newTag: 0.24.0-x86_v2 +- name: ghcr.io/now-chess/now-chess-systems/tournament + newTag: 0.1.0-x86_v2 - name: ghcr.io/now-chess/now-chess-systems/ws newTag: 0.14.0-x86_v2