prod deployment (#1780)

This commit is contained in:
Deepak Prabhakara 2023-10-15 12:12:55 +01:00 committed by GitHub
parent a0103b7295
commit 1b52ce01e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 176 additions and 8 deletions

View File

@ -1,2 +1,2 @@
*-secrets.yaml
secrets.yaml
**/*-secrets.yaml
**/secrets.yaml

View File

@ -6,13 +6,13 @@ resources:
- ./secrets.yaml
- ./mocksaml-secrets.yaml
- ./mocksaml-deployment.yaml
- ./migratepg-job.yaml
patches:
- ./jackson-deployment.yaml
- ./migratepg-job.yaml
images:
- name: boxyhq/jackson
newTag: 1.13.0
newTag: 1.14.0
- name: boxyhq/mock-saml
newTag: 1.1.7

2
kustomize/overlays/prod-eu/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
**/*-secrets.yaml
**/secrets.yaml

View File

@ -0,0 +1,12 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: jackson
spec:
replicas: 1
template:
spec:
containers:
- name: jackson
image: boxyhq/jackson:tagwillbereplaced
imagePullPolicy: IfNotPresent

View File

@ -0,0 +1,18 @@
---
bases:
- ../../base
resources:
- ./secrets.yaml
- ./mocksaml-secrets.yaml
- ./mocksaml-deployment.yaml
- ./migratepg-job.yaml
patches:
- ./jackson-deployment.yaml
images:
- name: boxyhq/jackson
newTag: 1.14.0
- name: boxyhq/mock-saml
newTag: 1.1.7

View File

@ -0,0 +1,18 @@
apiVersion: batch/v1
kind: Job
metadata:
name: jackson-migrate-pg
spec:
template:
spec:
restartPolicy: 'OnFailure'
containers:
- name: db
image: boxyhq/jackson:tagwillbereplaced
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- migrate.sh
envFrom:
- secretRef:
name: jackson

View File

@ -0,0 +1,44 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mocksaml
spec:
selector:
matchLabels:
tier: mocksaml
replicas: 1
template:
metadata:
labels:
app: mocksaml
tier: mocksaml
spec:
containers:
- name: mocksaml
image: boxyhq/mock-saml:tagwillbereplaced
imagePullPolicy: IfNotPresent
startupProbe:
httpGet:
port: 4000
path: /api/health
periodSeconds: 10
failureThreshold: 5
readinessProbe:
httpGet:
port: 4000
path: /api/health
periodSeconds: 30
failureThreshold: 5
successThreshold: 2
ports:
- containerPort: 4000
name: http
protocol: TCP
envFrom:
- secretRef:
name: mocksaml
resources:
requests:
cpu: 100m
limits:
cpu: 500m

View File

@ -0,0 +1,26 @@
apiVersion: v1
kind: Service
metadata:
name: jackson
labels:
app: jackson
tier: jackson
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip
service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: 'arn:aws:acm:eu-central-1:511214097407:certificate/3fc4272a-d97c-4bf0-8f8a-3425fda27e31'
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: '443'
spec:
externalTrafficPolicy: Local
type: LoadBalancer
ports:
- name: http
port: 80
targetPort: 5225
- name: https
port: 443
targetPort: 5225
selector:
app: jackson
tier: jackson

View File

@ -0,0 +1,4 @@
---
bases:
- ./jackson-service.yaml
- ./mocksaml-service.yaml

View File

@ -0,0 +1,26 @@
apiVersion: v1
kind: Service
metadata:
name: mocksaml
labels:
app: mocksaml
tier: mocksaml
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: nlb
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip
service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: 'arn:aws:acm:eu-central-1:511214097407:certificate/3fc4272a-d97c-4bf0-8f8a-3425fda27e31'
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: '443'
spec:
externalTrafficPolicy: Local
type: LoadBalancer
ports:
- name: http
port: 80
targetPort: 4000
- name: https
port: 443
targetPort: 4000
selector:
app: mocksaml
tier: mocksaml

View File

@ -33,7 +33,8 @@ if (process.env.DB_SSL === 'true') {
};
}
const url = process.env.DB_URL || 'postgresql://postgres:postgres@localhost:5432/postgres';
const url =
process.env.DB_URL || process.env.DATABASE_URL || 'postgresql://postgres:postgres@localhost:5432/postgres';
let AppDataSource: DataSource;
@ -62,7 +63,10 @@ if (type === 'mssql') {
});
} else {
AppDataSource = new DataSource(<DataSourceOptions>{
url: process.env.DB_URL || 'postgresql://postgres:postgres@localhost:5432/postgres',
url:
process.env.DB_URL ||
process.env.DATABASE_URL ||
'postgresql://postgres:postgres@localhost:5432/postgres',
ssl,
...baseOpts,
});

View File

@ -31,8 +31,10 @@
"mariadb:skaffold": "skaffold dev -f skaffold-mariadb.yaml --status-check=false --force=true",
"mssql:skaffold": "skaffold dev -f skaffold-mssql.yaml --status-check=false --force=true",
"dynamodb:skaffold": "skaffold dev -f skaffold-dynamodb.yaml --status-check=false --force=true",
"demo:skaffold": "echo 'This is only meant for BoxyHQ internal use. Please use {dbname}:skaffold instead' && skaffold run -f skaffold-demo.yaml --status-check=false --force=true",
"demo-services:skaffold": "echo 'This is only meant for BoxyHQ internal use. Please use {dbname}:skaffold instead' && skaffold run -f skaffold-demo-services.yaml --status-check=false --force=true",
"demo:skaffold": "echo 'This is only meant for BoxyHQ internal use. Please use {dbname}:skaffold instead' && skaffold run -f skaffold-demo.yaml --status-check=false",
"demo-services:skaffold": "echo 'This is only meant for BoxyHQ internal use. Please use {dbname}:skaffold instead' && skaffold run -f skaffold-demo-services.yaml --status-check=false",
"prod-eu:skaffold": "echo 'This is only meant for BoxyHQ internal use. Please use {dbname}:skaffold instead' && skaffold run -f skaffold-prod-eu.yaml --status-check=false",
"prod-eu-services:skaffold": "echo 'This is only meant for BoxyHQ internal use. Please use {dbname}:skaffold instead' && skaffold run -f skaffold-prod-eu-services.yaml --status-check=false",
"start": "cross-env PORT=5225 NODE_OPTIONS=--dns-result-order=ipv4first node .next/standalone/server.js",
"swagger-jsdoc": "swagger-jsdoc -d swagger/swaggerDefinition.js npm/src/**/*.ts npm/src/**/**/*.ts -o swagger/swagger.json",
"redis": "cross-env JACKSON_API_KEYS=secret DB_ENGINE=redis DB_TYPE=redis DB_URL=redis://localhost:6379/redis npm run dev",

View File

@ -0,0 +1,6 @@
apiVersion: skaffold/v4beta6
kind: Config
manifests:
kustomize:
paths:
- ./kustomize/overlays/prod-eu/services

6
skaffold-prod-eu.yaml Normal file
View File

@ -0,0 +1,6 @@
apiVersion: skaffold/v4beta6
kind: Config
manifests:
kustomize:
paths:
- ./kustomize/overlays/prod-eu