Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce cpu/request limits + Adjust default Log Level #716

Merged
merged 4 commits into from
Feb 22, 2022
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
6 changes: 3 additions & 3 deletions api/.pipeline/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const phases = {
env: 'build',
tz: config.timezone.api,
branch: branch,
logLevel: 'debug'
logLevel: isStaticDeployment && 'info' || 'debug'
},
dev: {
namespace: 'af2668-dev',
Expand All @@ -86,7 +86,7 @@ const phases = {
certificateURL: config.certificateURL.dev,
replicas: 1,
maxReplicas: 2,
logLevel: 'debug'
logLevel: isStaticDeployment && 'info' || 'debug'
},
test: {
namespace: 'af2668-test',
Expand All @@ -104,7 +104,7 @@ const phases = {
certificateURL: config.certificateURL.test,
replicas: 3,
maxReplicas: 5,
logLevel: 'debug'
logLevel: 'info'
},
prod: {
namespace: 'af2668-prod',
Expand Down
34 changes: 17 additions & 17 deletions api/openshift/api.dc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,6 @@ parameters:
- name: KEYCLOAK_ADMIN_PASSWORD
description: keycloak host url
value: 'keycloak-admin-password'
- name: CPU_REQ
value: '100m'
- name: CPU_LIMIT
value: '750m'
- name: MEMORY_REQ
value: '512Mi'
- name: MEMORY_LIMIT
value: '2Gi'
- name: REPLICAS
value: '1'
- name: API_PORT_DEFAULT
value: '6100'
- name: API_PORT_DEFAULT_NAME
Expand All @@ -69,9 +59,6 @@ parameters:
- name: OBJECT_STORE_SECRETS
description: Secrets used to read and write to the S3 storage
value: 'biohubbc-object-store'
- name: REPLICA_MAX
required: true
value: '1'
- name: LOG_LEVEL
value: 'info'
- name: GCNOTIFY_API_SECRET
Expand All @@ -90,6 +77,19 @@ parameters:
value: https://api.notification.canada.ca/v2/notifications/email
- name: GCNOTIFY_SMS_URL
value: https://api.notification.canada.ca/v2/notifications/sms
- name: CPU_REQUEST
value: '100m'
- name: CPU_LIMIT
value: '500m'
- name: MEMORY_REQUEST
value: '512Mi'
- name: MEMORY_LIMIT
value: '2Gi'
- name: REPLICAS
value: '1'
- name: REPLICA_MAX
required: true
value: '1'
objects:
- apiVersion: image.openshift.io/v1
kind: ImageStream
Expand Down Expand Up @@ -130,8 +130,8 @@ objects:
cpu: ${CPU_LIMIT}
memory: ${MEMORY_LIMIT}
requests:
cpu: ${CPU_REQ}
memory: ${MEMORY_REQ}
cpu: ${CPU_REQUEST}
memory: ${MEMORY_REQUEST}
type: Rolling
template:
metadata:
Expand Down Expand Up @@ -239,8 +239,8 @@ objects:
cpu: ${CPU_LIMIT}
memory: ${MEMORY_LIMIT}
requests:
cpu: ${CPU_REQ}
memory: ${MEMORY_REQ}
cpu: ${CPU_REQUEST}
memory: ${MEMORY_REQUEST}
readinessProbe:
failureThreshold: 10
httpGet:
Expand Down
20 changes: 8 additions & 12 deletions app/openshift/app.dc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,6 @@ parameters:
- name: APP_PORT_DEFAULT_NAME
description: Default port resource name
value: '7100-tcp'
- name: CPU_REQUEST
description: CPU REQUEST for deployment config
value: '100m'
- name: CPU_LIMIT
description: CPU LIMIT for dc
value: '500m'
- name: MEMORY_REQUEST
description: MEMORY REQUEST for dc
value: '512Mi'
- name: MEMORY_LIMIT
description: MEMORY LIMIT for dc
value: '2Gi'
- name: SSO_URL
description: Key clock login url
value: 'https://oidc.gov.bc.ca/auth'
Expand All @@ -62,6 +50,14 @@ parameters:
- name: SSO_REALM
description: Realm identifier or name
value: 35r1iman
- name: CPU_REQUEST
value: '10m'
- name: CPU_LIMIT
value: '200m'
- name: MEMORY_REQUEST
value: '50Mi'
- name: MEMORY_LIMIT
value: '200Mi'
- name: REPLICAS
value: '1'
- name: REPLICA_MAX
Expand Down
8 changes: 4 additions & 4 deletions containers/n8n/n8n.dc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -523,19 +523,19 @@ parameters:
- name: CPU_REQUEST
description: Minimal CPU needed to run
displayName: CPU Request
value: 100m
value: 10m
- name: CPU_LIMIT
description: Maximum CPU allowed to use
displayName: CPU Limit
value: 500m
value: 200m
- name: MEMORY_REQUEST
description: Minimal amount of memory needed to run
displayName: Memory Request
value: 768Mi
value: 512Mi
- name: MEMORY_LIMIT
description: Maximum amount of memory allowed to use
displayName: Memory Limit
value: 1.0Gi
value: 1Gi
- name: PVC_SIZE
description: Amount of disk space needed for persistence
displayName: PVC Size
Expand Down
3 changes: 1 addition & 2 deletions database/.pipeline/lib/db.deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ module.exports = (settings) => {
POSTGRESQL_DATABASE: 'biohubbc',
TZ: phases[phase].tz,
IMAGE_STREAM_NAMESPACE: phases.build.namespace,
VOLUME_CAPACITY:
`${name}-postgresql${phases[phase].suffix}` === `${name}-postgresql-dev-deploy` ? '20Gi' : '3Gi'
VOLUME_CAPACITY: '3Gi'
}
})
);
Expand Down
14 changes: 8 additions & 6 deletions database/openshift/db.dc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,16 @@ parameters:
displayName: Flag to enable postgis PostgreSQL extension.
name: POSTGIS_EXTENSION
value: 'Y'
- name: CPU_LIMIT
value: '1000m'
- name: MEMORY_LIMIT
value: '2Gi'
- name: CPU_REQUEST
value: '100m'
value: '10m'
- name: CPU_LIMIT
value: '200m'
- name: MEMORY_REQUEST
value: '512Mi'
- name: MEMORY_LIMIT
value: '2Gi'
- name: REPLICAS
value: '1'
objects:
- apiVersion: v1
kind: Secret
Expand Down Expand Up @@ -144,7 +146,7 @@ objects:
template.alpha.openshift.io/wait-for-ready: 'true'
name: '${DATABASE_SERVICE_NAME}'
spec:
replicas: 1
replicas: '${{REPLICAS}}'
selector:
name: '${DATABASE_SERVICE_NAME}'
strategy:
Expand Down
12 changes: 5 additions & 7 deletions database/openshift/db.setup.dc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,14 @@ parameters:
description: Application Environment type variable
required: true
value: 'dev'
- name: CPU_REQ
value: '500m'
- name: CPU_REQUEST
value: '10m'
- name: CPU_LIMIT
value: '750m'
- name: MEMORY_REQ
value: '1Gi'
value: '200m'
- name: MEMORY_REQUEST
value: '512Mi'
- name: MEMORY_LIMIT
value: '2Gi'
- name: REPLICAS
value: '1'
objects:
- kind: Pod
apiVersion: v1
Expand Down