diff --git a/argocd/dev/ra/request-consumables/app.yaml b/argocd/dev/ra/request-consumables/app.yaml new file mode 100644 index 00000000..7088e286 --- /dev/null +++ b/argocd/dev/ra/request-consumables/app.yaml @@ -0,0 +1,31 @@ +apiVersion: argoproj.io/v1alpha1 +kind: ApplicationSet +metadata: + name: request-consumables + namespace: argocd +spec: + goTemplate: true + goTemplateOptions: ["missingkey=error"] + generators: + - clusters: + selector: + matchLabels: + appEnvironment: dev + ignoreApplicationDifferences: + - jsonPointers: + - /spec/syncPolicy + template: + metadata: + name: '{{.name}}-request-consumables' + spec: + project: r-a-project + source: + path: components/ra/request-consumables/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 diff --git a/components/ra/request-consumables/base/deployment.yaml b/components/ra/request-consumables/base/deployment.yaml new file mode 100644 index 00000000..5e76cc20 --- /dev/null +++ b/components/ra/request-consumables/base/deployment.yaml @@ -0,0 +1,57 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: request-consumables +spec: + replicas: 1 + template: + metadata: + annotations: + co.elastic.logs/processors.add_fields.target: "" + co.elastic.logs/processors.add_fields.fields.application.name: "request-consumables" + co.elastic.logs/processors.add_fields.fields.application.domain: "request-consumables" + co.elastic.logs/processors.add_fields.fields.application.tier: "service" + co.elastic.logs/processors.add_fields.fields.application.language: "javascript" + co.elastic.logs/processors.dissect.tokenizer: "[%{?timestamp}] %{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: request-consumables + imagePullPolicy: Always + ports: + - containerPort: 3000 + env: + - name: CONFIG_PATH + value: /FBS/.env + volumeMounts: + - name: env-config + mountPath: "/FBS" + readOnly: true + - name: common-views + mountPath: "/app/build/common-views" + readOnly: true + - name: common-js + mountPath: "/app/build/common-public/js" + readOnly: true + readinessProbe: + httpGet: + path: /consumables/health/ready + port: 3000 + initialDelaySeconds: 10 + periodSeconds: 5 + imagePullSecrets: + - name: registry-creds + volumes: + - name: env-config + secret: + secretName: request-consumables-environment + - name: common-views + configMap: + name: common-pug-views + - name: common-js + configMap: + name: common-pug-content-js diff --git a/components/ra/request-consumables/base/httproute.yaml b/components/ra/request-consumables/base/httproute.yaml new file mode 100644 index 00000000..e3464844 --- /dev/null +++ b/components/ra/request-consumables/base/httproute.yaml @@ -0,0 +1,19 @@ +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: request-consumables +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: /consumables + backendRefs: + - name: request-consumables + port: 3000 diff --git a/components/ra/request-consumables/base/kustomize.yaml b/components/ra/request-consumables/base/kustomize.yaml new file mode 100644 index 00000000..1dd73be8 --- /dev/null +++ b/components/ra/request-consumables/base/kustomize.yaml @@ -0,0 +1,12 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +commonLabels: + app: request-consumables + +namespace: apps + +resources: + - deployment.yaml + - httproute.yaml + - service.yaml diff --git a/components/ra/request-consumables/base/service.yaml b/components/ra/request-consumables/base/service.yaml new file mode 100644 index 00000000..c20f4e97 --- /dev/null +++ b/components/ra/request-consumables/base/service.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Service +metadata: + name: request-consumables +spec: + ports: + - protocol: TCP + port: 3000 + targetPort: 3000 diff --git a/components/ra/request-consumables/overlays/dev/deployment.yaml b/components/ra/request-consumables/overlays/dev/deployment.yaml new file mode 100644 index 00000000..35731279 --- /dev/null +++ b/components/ra/request-consumables/overlays/dev/deployment.yaml @@ -0,0 +1,17 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: request-consumables +spec: + template: + spec: + containers: + - name: request-consumables + image: ghcr.io/isisbusapps/request-consumables@sha256:3cfbda0bc1227f2e51fcdba61fc2dc86466cdf604159d9af908e66ca85883384 + env: + - name: NODE_ENV + value: development + envFrom: + - secretRef: + name: request-consumables + \ No newline at end of file diff --git a/components/ra/request-consumables/overlays/dev/kustomization.yaml b/components/ra/request-consumables/overlays/dev/kustomization.yaml new file mode 100644 index 00000000..6365c013 --- /dev/null +++ b/components/ra/request-consumables/overlays/dev/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../../base + - static-secret.yaml + +namespace: apps + +patches: + - path: deployment.yaml \ No newline at end of file diff --git a/components/ra/request-consumables/overlays/dev/static-secret.yaml b/components/ra/request-consumables/overlays/dev/static-secret.yaml new file mode 100644 index 00000000..99ffa305 --- /dev/null +++ b/components/ra/request-consumables/overlays/dev/static-secret.yaml @@ -0,0 +1,16 @@ +apiVersion: secrets.hashicorp.com/v1beta1 +kind: VaultStaticSecret +metadata: + name: request-consumables + namespace: apps +spec: + type: kv-v2 + refreshAfter: 30s + vaultAuthRef: static-auth + + mount: reviews_and_allocations + path: dev/request-consumables + destination: + name: request-consumables + overwrite: true + create: true