From a8bbb4a4c9caece6259193b097d6e5282172ee32 Mon Sep 17 00:00:00 2001 From: Marty Fox Date: Tue, 7 Jan 2025 15:56:11 +0000 Subject: [PATCH] Adding recipes-frontend config, adding deployment to demo for backend and frontend components to test shared infra --- apps/cnp/demo/base/kustomization.yaml | 4 ++++ apps/cnp/recipes-backend/aat.yaml | 2 +- ...cipe-backend.yaml => recipes-backend.yaml} | 11 ++++++++++ apps/cnp/recipes-frontend/aat.yaml | 9 ++++++++ apps/cnp/recipes-frontend/demo.yaml | 9 ++++++++ apps/cnp/recipes-frontend/image-policy.yaml | 7 +++++++ apps/cnp/recipes-frontend/image-repo.yaml | 6 ++++++ apps/cnp/recipes-frontend/ithc.yaml | 9 ++++++++ apps/cnp/recipes-frontend/perftest.yaml | 10 +++++++++ apps/cnp/recipes-frontend/prod.yaml | 9 ++++++++ .../recipes-frontend/recipes-frontend.yaml | 21 +++++++++++++++++++ apps/cnp/recipes-frontend/sbox.yaml | 11 ++++++++++ apps/cnp/sbox/base/kustomization.yaml | 2 -- 13 files changed, 107 insertions(+), 3 deletions(-) rename apps/cnp/recipes-backend/{recipe-backend.yaml => recipes-backend.yaml} (52%) create mode 100644 apps/cnp/recipes-frontend/aat.yaml create mode 100644 apps/cnp/recipes-frontend/demo.yaml create mode 100644 apps/cnp/recipes-frontend/image-policy.yaml create mode 100644 apps/cnp/recipes-frontend/image-repo.yaml create mode 100644 apps/cnp/recipes-frontend/ithc.yaml create mode 100644 apps/cnp/recipes-frontend/perftest.yaml create mode 100644 apps/cnp/recipes-frontend/prod.yaml create mode 100644 apps/cnp/recipes-frontend/recipes-frontend.yaml create mode 100644 apps/cnp/recipes-frontend/sbox.yaml diff --git a/apps/cnp/demo/base/kustomization.yaml b/apps/cnp/demo/base/kustomization.yaml index 08ed060d7561..995f5620f802 100644 --- a/apps/cnp/demo/base/kustomization.yaml +++ b/apps/cnp/demo/base/kustomization.yaml @@ -2,9 +2,13 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - ../../base + - ../../recipes-frontend/recipes-frontend.yaml + - ../../recipes-backend/recipes-backend.yaml namespace: cnp patches: - path: ../../plum-frontend/demo.yaml - path: ../../plum-recipe-backend/demo.yaml - path: ../../plum-recipe-receiver/demo.yaml - path: ../../serviceaccount/demo.yaml + - path: ../../recipes-frontend/sbox.yaml + - path: ../../recipes-backend/sbox.yaml diff --git a/apps/cnp/recipes-backend/aat.yaml b/apps/cnp/recipes-backend/aat.yaml index b8dc6ca414ed..2f528bbdb7fe 100644 --- a/apps/cnp/recipes-backend/aat.yaml +++ b/apps/cnp/recipes-backend/aat.yaml @@ -9,6 +9,6 @@ spec: ingressHost: recipes-backend-aat.service.core-compute-aat.internal testsConfig: environment: - TEST_URL: http://recipse-backend-java + TEST_URL: http://recipes-backend-java SLACK_CHANNEL: "platops-build-notices" SLACK_NOTIFY_SUCCESS: "false" diff --git a/apps/cnp/recipes-backend/recipe-backend.yaml b/apps/cnp/recipes-backend/recipes-backend.yaml similarity index 52% rename from apps/cnp/recipes-backend/recipe-backend.yaml rename to apps/cnp/recipes-backend/recipes-backend.yaml index a1d10473e79b..afd0e6b4c784 100644 --- a/apps/cnp/recipes-backend/recipe-backend.yaml +++ b/apps/cnp/recipes-backend/recipes-backend.yaml @@ -15,3 +15,14 @@ spec: values: java: image: hmctspublic.azurecr.io/recipes/backend:prod-27f0bf4-20241217163623 # {"$imagepolicy": "flux-system:recipes-backend"} + keyVaults: + "recipeskv": + secrets: + - name: recipes-backend-POSTGRES-DATABASE-CFT + alias: POSTGRES_DATABASE + - name: recipes-backend-POSTGRES-HOST + alias: POSTGRES_HOST + - name: recipes-backend-POSTGRES-USER + alias: POSTGRES_USER + - name: recipes-backend-POSTGRES-PASS + alias: POSTGRES_PASSWORD diff --git a/apps/cnp/recipes-frontend/aat.yaml b/apps/cnp/recipes-frontend/aat.yaml new file mode 100644 index 000000000000..37ec7174f826 --- /dev/null +++ b/apps/cnp/recipes-frontend/aat.yaml @@ -0,0 +1,9 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: recipes-frontend +spec: + values: + nodejs: + ingressHost: recipes.aat.platform.hmcts.net diff --git a/apps/cnp/recipes-frontend/demo.yaml b/apps/cnp/recipes-frontend/demo.yaml new file mode 100644 index 000000000000..7ca9514edd4e --- /dev/null +++ b/apps/cnp/recipes-frontend/demo.yaml @@ -0,0 +1,9 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: recipes-frontend +spec: + values: + nodejs: + ingressHost: recipes.demo.platform.hmcts.net diff --git a/apps/cnp/recipes-frontend/image-policy.yaml b/apps/cnp/recipes-frontend/image-policy.yaml new file mode 100644 index 000000000000..056dd646e04b --- /dev/null +++ b/apps/cnp/recipes-frontend/image-policy.yaml @@ -0,0 +1,7 @@ +apiVersion: image.toolkit.fluxcd.io/v1beta1 +kind: ImagePolicy +metadata: + name: recipes-frontend +spec: + imageRepositoryRef: + name: recipes-frontend diff --git a/apps/cnp/recipes-frontend/image-repo.yaml b/apps/cnp/recipes-frontend/image-repo.yaml new file mode 100644 index 000000000000..69c9103290d4 --- /dev/null +++ b/apps/cnp/recipes-frontend/image-repo.yaml @@ -0,0 +1,6 @@ +apiVersion: image.toolkit.fluxcd.io/v1beta2 +kind: ImageRepository +metadata: + name: recipes-frontend +spec: + image: hmctspublic.azurecr.io/recipes/frontend diff --git a/apps/cnp/recipes-frontend/ithc.yaml b/apps/cnp/recipes-frontend/ithc.yaml new file mode 100644 index 000000000000..d6620241a5e1 --- /dev/null +++ b/apps/cnp/recipes-frontend/ithc.yaml @@ -0,0 +1,9 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: recipes-frontend +spec: + values: + nodejs: + ingressHost: recipes.ithc.platform.hmcts.net diff --git a/apps/cnp/recipes-frontend/perftest.yaml b/apps/cnp/recipes-frontend/perftest.yaml new file mode 100644 index 000000000000..505581ca9ecf --- /dev/null +++ b/apps/cnp/recipes-frontend/perftest.yaml @@ -0,0 +1,10 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: recipes-frontend +spec: + values: + nodejs: + replicas: 4 + ingressHost: recipes.perftest.platform.hmcts.net diff --git a/apps/cnp/recipes-frontend/prod.yaml b/apps/cnp/recipes-frontend/prod.yaml new file mode 100644 index 000000000000..f8cf8d562f15 --- /dev/null +++ b/apps/cnp/recipes-frontend/prod.yaml @@ -0,0 +1,9 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: recipes-frontend +spec: + values: + nodejs: + ingressHost: recipes.platform.hmcts.net diff --git a/apps/cnp/recipes-frontend/recipes-frontend.yaml b/apps/cnp/recipes-frontend/recipes-frontend.yaml new file mode 100644 index 000000000000..4c7190447f2a --- /dev/null +++ b/apps/cnp/recipes-frontend/recipes-frontend.yaml @@ -0,0 +1,21 @@ +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: recipes-frontend +spec: + releaseName: recipes-frontend + chart: + spec: + chart: ./stable/recipes-frontend + sourceRef: + kind: GitRepository + name: hmcts-charts + namespace: flux-system + interval: 1m + values: + nodejs: + image: hmctspublic.azurecr.io/recipes/frontend:prod-80e4f49-20250107102118 # {"$imagepolicy": "flux-system:recipes-frontend"} + useWorkloadIdentity: true + workloadClientID: ${WORKLOAD_IDENTITY_ID} + environment: + RECIPE_BACKEND_URL: http://recipes-backend-java diff --git a/apps/cnp/recipes-frontend/sbox.yaml b/apps/cnp/recipes-frontend/sbox.yaml new file mode 100644 index 000000000000..304d150d2698 --- /dev/null +++ b/apps/cnp/recipes-frontend/sbox.yaml @@ -0,0 +1,11 @@ +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: recipes-frontend +spec: + values: + nodejs: + ingressHost: recipes.sandbox.platform.hmcts.net + replicas: 2 + autoscaling: + minReplicas: 1 diff --git a/apps/cnp/sbox/base/kustomization.yaml b/apps/cnp/sbox/base/kustomization.yaml index bcfecbc89f90..ae66ccb7e44f 100644 --- a/apps/cnp/sbox/base/kustomization.yaml +++ b/apps/cnp/sbox/base/kustomization.yaml @@ -3,7 +3,6 @@ kind: Kustomization resources: - ../../base - ../../plum-batch/plum-batch.yaml - - ../../recipes-backend/recipe-backend.yaml - test-ingress-redirect.yaml - descheduler-cronjob.yaml - descheduler-helmrepo.yaml @@ -15,4 +14,3 @@ patches: - path: ../../plum-batch/sbox.yaml - path: ../../serviceaccount/sbox.yaml - path: namespace.yaml - - path: ../../recipes-backend/sbox.yaml