From 62492ad091a17bbe5226c1229b0ef867f5e8ddba Mon Sep 17 00:00:00 2001 From: William-Edwards-STFC Date: Wed, 9 Sep 2026 15:14:10 +0100 Subject: [PATCH 1/3] Add argocd dev --- argocd/dev/ra/safetytest-api/app.yaml | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 argocd/dev/ra/safetytest-api/app.yaml diff --git a/argocd/dev/ra/safetytest-api/app.yaml b/argocd/dev/ra/safetytest-api/app.yaml new file mode 100644 index 00000000..965ed796 --- /dev/null +++ b/argocd/dev/ra/safetytest-api/app.yaml @@ -0,0 +1,32 @@ +apiVersion: argoproj.io/v1alpha1 +kind: ApplicationSet +metadata: + name: safetytest-api + namespace: argocd +spec: + goTemplate: true + goTemplateOptions: ["missingkey=error"] + generators: + - clusters: + selector: + matchLabels: + appEnvironment: dev + ignoreApplicationDifferences: + - jsonPointers: + - /spec/syncPolicy + template: + metadata: + name: '{{.name}}-safetytest-api' + spec: + project: r-a-project + source: + path: components/ra/safetytest-api/overlays/dev + repoURL: 'https://github.com/isisbusapps/gitops' + targetRevision: main + destination: + namespace: apps + name: '{{.name}}' + syncPolicy: + automated: + selfHeal: true #https://argo-cd.readthedocs.io/en/stable/user-guide/auto_sync/#automatic-self-healing + \ No newline at end of file From e331024651051923b8862f21438dd4d3c43a7562 Mon Sep 17 00:00:00 2001 From: William-Edwards-STFC Date: Wed, 9 Sep 2026 15:14:19 +0100 Subject: [PATCH 2/3] Add argocd prod --- argocd/prod/ra/safetytest-api/app.yaml | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 argocd/prod/ra/safetytest-api/app.yaml diff --git a/argocd/prod/ra/safetytest-api/app.yaml b/argocd/prod/ra/safetytest-api/app.yaml new file mode 100644 index 00000000..3aa0013a --- /dev/null +++ b/argocd/prod/ra/safetytest-api/app.yaml @@ -0,0 +1,32 @@ +apiVersion: argoproj.io/v1alpha1 +kind: ApplicationSet +metadata: + name: safetytest-api + namespace: argocd +spec: + goTemplate: true + goTemplateOptions: ["missingkey=error"] + generators: + - clusters: + selector: + matchLabels: + appEnvironment: dev + ignoreApplicationDifferences: + - jsonPointers: + - /spec/syncPolicy + template: + metadata: + name: '{{.name}}-safetytest-api' + spec: + project: r-a-project + source: + path: components/ra/safetytest-api/overlays/prod + repoURL: 'https://github.com/isisbusapps/gitops' + targetRevision: main + destination: + namespace: apps + name: '{{.name}}' + syncPolicy: + automated: + selfHeal: true #https://argo-cd.readthedocs.io/en/stable/user-guide/auto_sync/#automatic-self-healing + \ No newline at end of file From c1fb8f46bdc48bb21a9e3bf14f197801ee31a329 Mon Sep 17 00:00:00 2001 From: William-Edwards-STFC Date: Wed, 9 Sep 2026 15:14:29 +0100 Subject: [PATCH 3/3] Add components files --- .../ra/safetytest-api/base/deployment.yaml | 37 +++++++++++++++++++ .../ra/safetytest-api/base/httproute.yaml | 19 ++++++++++ .../ra/safetytest-api/base/kustomization.yaml | 12 ++++++ .../ra/safetytest-api/base/service.yaml | 10 +++++ .../overlays/dev/deployment.yaml | 10 +++++ .../overlays/dev/kustomization.yaml | 12 ++++++ .../overlays/dev/static-secret.yaml | 16 ++++++++ .../overlays/prod/deployment.yaml | 10 +++++ .../overlays/prod/kustomization.yaml | 11 ++++++ .../overlays/prod/static-secret.yaml | 16 ++++++++ 10 files changed, 153 insertions(+) create mode 100644 components/ra/safetytest-api/base/deployment.yaml create mode 100644 components/ra/safetytest-api/base/httproute.yaml create mode 100644 components/ra/safetytest-api/base/kustomization.yaml create mode 100644 components/ra/safetytest-api/base/service.yaml create mode 100644 components/ra/safetytest-api/overlays/dev/deployment.yaml create mode 100644 components/ra/safetytest-api/overlays/dev/kustomization.yaml create mode 100644 components/ra/safetytest-api/overlays/dev/static-secret.yaml create mode 100644 components/ra/safetytest-api/overlays/prod/deployment.yaml create mode 100644 components/ra/safetytest-api/overlays/prod/kustomization.yaml create mode 100644 components/ra/safetytest-api/overlays/prod/static-secret.yaml diff --git a/components/ra/safetytest-api/base/deployment.yaml b/components/ra/safetytest-api/base/deployment.yaml new file mode 100644 index 00000000..ae1d550e --- /dev/null +++ b/components/ra/safetytest-api/base/deployment.yaml @@ -0,0 +1,37 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: safetytest-api +spec: + replicas: 1 + template: + metadata: + annotations: + co.elastic.logs/processors.add_fields.target: "" + co.elastic.logs/processors.add_fields.fields.application.name: "safetytest-api" + co.elastic.logs/processors.add_fields.fields.application.domain: "safetytest-api" + co.elastic.logs/processors.add_fields.fields.application.tier: web + co.elastic.logs/processors.add_fields.fields.application.language: "typescript" + # Extract log_level, class, and log_message as separate fields for elastic + co.elastic.logs/processors.dissect.tokenizer: "%{?date} %{?time} %{log_level->} %{log_message}" + co.elastic.logs/processors.dissect.target_prefix: "" + co.elastic.logs/multiline.pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}" + co.elastic.logs/multiline.negate: "true" + co.elastic.logs/multiline.match: "after" + spec: + containers: + - name: safetytest-api + imagePullPolicy: Always + ports: + - containerPort: 8080 + envFrom: + - secretRef: + name: safetytest-api + readinessProbe: + httpGet: + path: /safetytest-api/health/ready + port: 8080 + initialDelaySeconds: 10 + periodSeconds: 5 + imagePullSecrets: + - name: registry-creds diff --git a/components/ra/safetytest-api/base/httproute.yaml b/components/ra/safetytest-api/base/httproute.yaml new file mode 100644 index 00000000..7a60f2f2 --- /dev/null +++ b/components/ra/safetytest-api/base/httproute.yaml @@ -0,0 +1,19 @@ +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: safetytest-api +spec: + parentRefs: + - name: envoy-gateway + namespace: envoy-gateway-system + hostnames: + - "*.developers.facilities.rl.ac.uk" + - "*.facilities.rl.ac.uk" + rules: + - matches: + - path: + type: PathPrefix + value: /safetytest-api + backendRefs: + - name: safetytest-api + port: 8080 diff --git a/components/ra/safetytest-api/base/kustomization.yaml b/components/ra/safetytest-api/base/kustomization.yaml new file mode 100644 index 00000000..2036c20c --- /dev/null +++ b/components/ra/safetytest-api/base/kustomization.yaml @@ -0,0 +1,12 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +commonLabels: + app: safetytest-api + +namespace: apps + +resources: + - deployment.yaml + - service.yaml + - httproute.yaml diff --git a/components/ra/safetytest-api/base/service.yaml b/components/ra/safetytest-api/base/service.yaml new file mode 100644 index 00000000..1ebc7cf0 --- /dev/null +++ b/components/ra/safetytest-api/base/service.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Service +metadata: + name: safetytest-api +spec: + ports: + - name: https + protocol: TCP + port: 8080 + targetPort: 8080 diff --git a/components/ra/safetytest-api/overlays/dev/deployment.yaml b/components/ra/safetytest-api/overlays/dev/deployment.yaml new file mode 100644 index 00000000..91607abe --- /dev/null +++ b/components/ra/safetytest-api/overlays/dev/deployment.yaml @@ -0,0 +1,10 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: safetytest-api +spec: + template: + spec: + containers: + - name: safetytest-api + image: ghcr.io/isisbusapps/safetytest-api diff --git a/components/ra/safetytest-api/overlays/dev/kustomization.yaml b/components/ra/safetytest-api/overlays/dev/kustomization.yaml new file mode 100644 index 00000000..b62a6bc6 --- /dev/null +++ b/components/ra/safetytest-api/overlays/dev/kustomization.yaml @@ -0,0 +1,12 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +bases: + - ../../base + - static-secret.yaml + +namespace: apps + +patches: + - path: deployment.yaml + \ No newline at end of file diff --git a/components/ra/safetytest-api/overlays/dev/static-secret.yaml b/components/ra/safetytest-api/overlays/dev/static-secret.yaml new file mode 100644 index 00000000..bc1e07e7 --- /dev/null +++ b/components/ra/safetytest-api/overlays/dev/static-secret.yaml @@ -0,0 +1,16 @@ +apiVersion: secrets.hashicorp.com/v1beta1 +kind: VaultStaticSecret +metadata: + name: safetytest-api + namespace: apps +spec: + type: kv-v2 + refreshAfter: 30s + vaultAuthRef: static-auth + + mount: reviews_and_allocations + path: dev/safetytest-api + destination: + name: safetytest-api + overwrite: true + create: true \ No newline at end of file diff --git a/components/ra/safetytest-api/overlays/prod/deployment.yaml b/components/ra/safetytest-api/overlays/prod/deployment.yaml new file mode 100644 index 00000000..9dd2dcbe --- /dev/null +++ b/components/ra/safetytest-api/overlays/prod/deployment.yaml @@ -0,0 +1,10 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: safetytest-api +spec: + template: + spec: + containers: + - name: user-claims-backend + image: ghcr.io/isisbusapps/safetytest-api:1.0 diff --git a/components/ra/safetytest-api/overlays/prod/kustomization.yaml b/components/ra/safetytest-api/overlays/prod/kustomization.yaml new file mode 100644 index 00000000..4856d542 --- /dev/null +++ b/components/ra/safetytest-api/overlays/prod/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +bases: + - ../../base + - static-secret.yaml + +namespace: apps + +patches: + - path: deployment.yaml diff --git a/components/ra/safetytest-api/overlays/prod/static-secret.yaml b/components/ra/safetytest-api/overlays/prod/static-secret.yaml new file mode 100644 index 00000000..e73a76d3 --- /dev/null +++ b/components/ra/safetytest-api/overlays/prod/static-secret.yaml @@ -0,0 +1,16 @@ +apiVersion: secrets.hashicorp.com/v1beta1 +kind: VaultStaticSecret +metadata: + name: safetytest-api + namespace: apps +spec: + type: kv-v2 + refreshAfter: 30s + vaultAuthRef: static-auth + + mount: reviews_and_allocations + path: prod/safetytest-api + destination: + name: safetytest-api + overwrite: true + create: true \ No newline at end of file