Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions argocd/dev/ra/safetytest-api/app.yaml
Original file line number Diff line number Diff line change
@@ -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

32 changes: 32 additions & 0 deletions argocd/prod/ra/safetytest-api/app.yaml
Original file line number Diff line number Diff line change
@@ -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

37 changes: 37 additions & 0 deletions components/ra/safetytest-api/base/deployment.yaml
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions components/ra/safetytest-api/base/httproute.yaml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions components/ra/safetytest-api/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions components/ra/safetytest-api/base/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: Service
metadata:
name: safetytest-api
spec:
ports:
- name: https
protocol: TCP
port: 8080
targetPort: 8080
10 changes: 10 additions & 0 deletions components/ra/safetytest-api/overlays/dev/deployment.yaml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions components/ra/safetytest-api/overlays/dev/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

bases:
- ../../base
- static-secret.yaml

namespace: apps

patches:
- path: deployment.yaml

16 changes: 16 additions & 0 deletions components/ra/safetytest-api/overlays/dev/static-secret.yaml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions components/ra/safetytest-api/overlays/prod/deployment.yaml
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions components/ra/safetytest-api/overlays/prod/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

bases:
- ../../base
- static-secret.yaml

namespace: apps

patches:
- path: deployment.yaml
16 changes: 16 additions & 0 deletions components/ra/safetytest-api/overlays/prod/static-secret.yaml
Original file line number Diff line number Diff line change
@@ -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
Loading