Skip to content

Commit

Permalink
chore: reduce requested resources in OpenShift (#3)
Browse files Browse the repository at this point in the history
* chore: disable "prod" app deployment on merge to main

* chore: reduce autoscaling replica counts
  • Loading branch information
MikeLyttle authored Nov 28, 2024
1 parent c7833ed commit 3782231
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 37 deletions.
66 changes: 33 additions & 33 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,37 +44,37 @@ jobs:
environment: test
db_user: app

deploy-prod:
name: Deploy (prod)
needs: [deploy-test, vars]
uses: ./.github/workflows/.deployer.yml
secrets:
oc_namespace: ${{ secrets.OC_NAMESPACE }}
oc_token: ${{ secrets.OC_TOKEN }}
with:
environment: prod
db_user: app
params:
--set backend.deploymentStrategy=RollingUpdate
--set frontend.deploymentStrategy=RollingUpdate
--set global.autoscaling=true
--set frontend.pdb.enabled=true
--set backend.pdb.enabled=true
# deploy-prod:
# name: Deploy (prod)
# needs: [deploy-test, vars]
# uses: ./.github/workflows/.deployer.yml
# secrets:
# oc_namespace: ${{ secrets.OC_NAMESPACE }}
# oc_token: ${{ secrets.OC_TOKEN }}
# with:
# environment: prod
# db_user: app
# params:
# --set backend.deploymentStrategy=RollingUpdate
# --set frontend.deploymentStrategy=RollingUpdate
# --set global.autoscaling=true
# --set frontend.pdb.enabled=true
# --set backend.pdb.enabled=true

promote:
name: Promote Images
needs: [deploy-prod, vars]
runs-on: ubuntu-24.04
permissions:
packages: write
strategy:
matrix:
package: [migrations, backend, frontend]
timeout-minutes: 1
steps:
- uses: shrink/actions-docker-registry-tag@v4
with:
registry: ghcr.io
repository: ${{ github.repository }}/${{ matrix.package }}
target: ${{ needs.vars.outputs.pr }}
tags: prod
# promote:
# name: Promote Images
# needs: [deploy-prod, vars]
# runs-on: ubuntu-24.04
# permissions:
# packages: write
# strategy:
# matrix:
# package: [migrations, backend, frontend]
# timeout-minutes: 1
# steps:
# - uses: shrink/actions-docker-registry-tag@v4
# with:
# registry: ghcr.io
# repository: ${{ github.repository }}/${{ matrix.package }}
# target: ${{ needs.vars.outputs.pr }}
# tags: prod
8 changes: 4 additions & 4 deletions charts/app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ backend:
#-- enable or disable autoscaling.
enabled: true
#-- the minimum number of replicas.
minReplicas: 3
minReplicas: 1
#-- the maximum number of replicas.
maxReplicas: 7
maxReplicas: 3
#-- the target cpu utilization percentage, is from request cpu and NOT LIMIT CPU.
targetCPUUtilizationPercentage: 80
#-- vault, for injecting secrets from vault. it is optional and is an object. it creates an initContainer which reads from vault and app container can source those secrets. for referring to a working example with vault follow this link: https://github.com/bcgov/onroutebc/blob/main/charts/onroutebc/values.yaml#L171-L186
Expand Down Expand Up @@ -83,9 +83,9 @@ frontend:
#-- enable or disable autoscaling.
enabled: true
#-- the minimum number of replicas.
minReplicas: 3
minReplicas: 1
#-- the maximum number of replicas.
maxReplicas: 7
maxReplicas: 3
#-- the target cpu utilization percentage, is from request cpu and NOT LIMIT CPU.
targetCPUUtilizationPercentage: 80
#-- the service for the component. for inter namespace communication, use the service name as the hostname.
Expand Down

0 comments on commit 3782231

Please sign in to comment.