Skip to content
Merged
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
31 changes: 31 additions & 0 deletions argocd/dev/ra/settings-tool/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: settings-tool
namespace: argocd
spec:
goTemplate: true
goTemplateOptions: ["missingkey=error"]
generators:
- clusters:
selector:
matchLabels:
appEnvironment: dev
ignoreApplicationDifferences:
- jsonPointers:
- /spec/syncPolicy
template:
metadata:
name: '{{.name}}-settings-tool'
spec:
project: r-a-project
source:
path: components/ra/settings-tool/overlays/dev
repoURL: 'https://github.com/isisbusapps/gitops'
targetRevision: develop
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/settings-tool/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: settings-tool
namespace: argocd
spec:
goTemplate: true
goTemplateOptions: ["missingkey=error"]
generators:
- clusters:
selector:
matchLabels:
appEnvironment: prod
template:
metadata:
name: '{{.name}}-settings-tool'
spec:
project: r-a-project
source:
path: components/ra/settings-tool/overlays/prod
repoURL: 'https://github.com/isisbusapps/gitops'
targetRevision: master
destination:
namespace: apps
name: '{{.name}}'
ignoreDifferences:
- group: apps
kind: Deployment
jqPathExpressions:
- .spec.template.spec.containers[0].image
syncPolicy:
automated: {}
50 changes: 50 additions & 0 deletions components/ra/settings-tool/base/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: settings-tool-service
spec:
replicas: 1
template:
metadata:
annotations:
co.elastic.logs/processors.add_fields.target: ""
co.elastic.logs/processors.add_fields.fields.application.name: "settings-tool-service"
co.elastic.logs/processors.add_fields.fields.application.domain: "settings"
co.elastic.logs/processors.add_fields.fields.application.tier: "service"
co.elastic.logs/processors.add_fields.fields.application.language: "java"
# Remove ANSI colour codes. Their inclusion in Payara logs and the [ they contain messes up the dissect pattern.
co.elastic.logs/processors.1.script.lang: "javascript"
co.elastic.logs/processors.1.script.source: >
function process(event) {
event.Put("message", event.Get("message").replace(/\x1B\[[0-9;]{1,4}m/g, ""))
}
# Extract log_level, class, and log_message as separate fields for elastic from payara log entries
co.elastic.logs/processors.2.dissect.tokenizer: "[%{?timestamp}] [%{?oragnization}] [%{log_level}] [%{?message_id}] [%{class}] [%{?thread}] [%{?unixMilliseconds}] [%{?levelValue}] %{log_message}"
co.elastic.logs/processors.2.dissect.target_prefix: ""
co.elastic.logs/processors.2.dissect.ignore_failure: "true"
# Extract log_level, class, and log_message as separate fields for elastic from app log4j entries
co.elastic.logs/processors.3.dissect.tokenizer: "%{?date} %{?time} %{log_level->} [%{class}] %{log_message}"
co.elastic.logs/processors.3.dissect.target_prefix: ""
co.elastic.logs/processors.3.dissect.ignore_failure: "true"
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: settings-tool-service
imagePullPolicy: Always
ports:
- containerPort: 8080
env:
- name: LOG4J_CONFIGURATION_FILE
value: /FBS/config/log4j2.xml
volumeMounts:
- name: settings-tool-config
mountPath: "/FBS/config"
readOnly: true
imagePullSecrets:
- name: registry-creds
volumes:
- name: settings-tool-config
secret:
secretName: settings-tool-config
19 changes: 19 additions & 0 deletions components/ra/settings-tool/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: settings-tool-service
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: /SettingsToolService
backendRefs:
- name: settings-tool-service
port: 8080
12 changes: 12 additions & 0 deletions components/ra/settings-tool/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: settings-tool-service

namespace: apps

resources:
- deployment.yaml
- service.yaml
- httproute.yaml
10 changes: 10 additions & 0 deletions components/ra/settings-tool/base/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: Service
metadata:
name: settings-tool-service
spec:
ports:
- name: https
protocol: TCP
port: 8080
targetPort: 8080
15 changes: 15 additions & 0 deletions components/ra/settings-tool/overlays/dev/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: settings-tool-service
spec:
template:
spec:
containers:
- name: settings-tool-service
image: ghcr.io/isisbusapps/settings-tool-service@sha256:03f2f107a4aa9cfd570021cd11b015705fd6be9bfd71515f9b06cf21f935582f
ports:
- containerPort: 7005
env:
- name: JAVA_TOOL_OPTIONS
value: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:7005 -Denvironment=dev
11 changes: 11 additions & 0 deletions components/ra/settings-tool/overlays/dev/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../base

namespace: apps

patches:
- path: deployment.yaml
- path: service.yaml
10 changes: 10 additions & 0 deletions components/ra/settings-tool/overlays/dev/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: Service
metadata:
name: settings-tool-service
spec:
ports:
- name: debug
protocol: TCP
port: 7005
targetPort: 7005
13 changes: 13 additions & 0 deletions components/ra/settings-tool/overlays/prod/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: settings-tool-service
spec:
template:
spec:
containers:
- name: settings-tool-service
image: ghcr.io/isisbusapps/settings-tool-service:2.5.1
env:
- name: JAVA_TOOL_OPTIONS
value: -Denvironment=prod
10 changes: 10 additions & 0 deletions components/ra/settings-tool/overlays/prod/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../base

namespace: apps

patches:
- path: deployment.yaml
Loading