Skip to content

Commit

Permalink
More openshift yaml changes for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
raarielgrace committed Dec 6, 2024
1 parent 7dfb18c commit 1377c53
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 23 deletions.
1 change: 0 additions & 1 deletion .github/workflows/.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ jobs:
file: backend/openshift.deploy.yml
overwrite: true
parameters:
-p NAME_SUFFIX=-${{ inputs.target }}
-p IMAGE_TAG=${{ inputs.tag }}
-p TARGET=${{ inputs.target }}
verification_path: /api/health
Expand Down
41 changes: 19 additions & 22 deletions backend/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,13 @@ parameters:
description: Password for the PostgreSQL connection user.
from: '[a-zA-Z0-9]{16}'
generate: expression
- name: NAME_SUFFIX
description: Suffix for the name
required: true
objects:
- kind: Service
apiVersion: v1
metadata:
labels:
app: ${APP}${NAME_SUFFIX}
name: ${APP}-${COMPONENT}${NAME_SUFFIX}
app: ${APP}-${TARGET}
name: ${APP}-${TARGET}-${COMPONENT}
spec:
type: ClusterIP
ports:
Expand All @@ -38,50 +35,50 @@ objects:
protocol: TCP
name: http-3000
selector:
service: ${APP}-${COMPONENT}${NAME_SUFFIX}
service: ${APP}-${TARGET}-${COMPONENT}
- kind: Deployment
apiVersion: apps/v1
metadata:
labels:
app: ${APP}${NAME_SUFFIX}
deployment: ${APP}-${COMPONENT}${NAME_SUFFIX}
name: ${APP}-${COMPONENT}${NAME_SUFFIX}
app: ${APP}-${TARGET}
deployment: ${APP}-${TARGET}-${COMPONENT}
name: ${APP}-${TARGET}-${COMPONENT}
spec:
strategy:
type: Recreate
selector:
matchLabels:
deployment: ${APP}-${COMPONENT}${NAME_SUFFIX}
deployment: ${APP}-${TARGET}-${COMPONENT}
template:
metadata:
labels:
app: ${APP}${NAME_SUFFIX}
deployment: ${APP}-${COMPONENT}${NAME_SUFFIX}
service: ${APP}-${COMPONENT}${NAME_SUFFIX}
app: ${APP}-${TARGET}
deployment: ${APP}-${TARGET}-${COMPONENT}
service: ${APP}-${TARGET}-${COMPONENT}
spec:
containers:
- name: ${APP}-${COMPONENT}${NAME_SUFFIX}
- name: ${APP}-${TARGET}-${COMPONENT}
image: ghcr.io/${ORG}/${APP}/${COMPONENT}:${IMAGE_TAG}
imagePullPolicy: Always
env:
- name: LOG_LEVEL
value: info
- name: POSTGRES_HOST
value: nr-nmp-database${NAME_SUFFIX}
value: nr-nmp-database-${TARGET}
- name: POSTGRES_DB
valueFrom:
secretKeyRef:
name: nr-nmp-database${NAME_SUFFIX}
name: nr-nmp-database-${TARGET}
key: database-name
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: nr-nmp-database${NAME_SUFFIX}
name: nr-nmp-database-${TARGET}
key: database-password
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: nr-nmp-database${NAME_SUFFIX}
name: nr-nmp-database-${TARGET}
key: database-user
- name: SSO_CLIENT_ID
valueFrom:
Expand Down Expand Up @@ -133,15 +130,15 @@ objects:
apiVersion: route.openshift.io/v1
metadata:
labels:
app: ${APP}${NAME_SUFFIX}
name: ${APP}-${COMPONENT}${NAME_SUFFIX}
app: ${APP}-${TARGET}
name: ${APP}-${TARGET}-${COMPONENT}
spec:
host: ${APP}-${COMPONENT}${NAME_SUFFIX}.apps.silver.devops.gov.bc.ca
host: ${APP}-${TARGET}-${COMPONENT}.apps.silver.devops.gov.bc.ca
port:
targetPort: http-3000
to:
kind: Service
name: ${APP}-${COMPONENT}${NAME_SUFFIX}
name: ${APP}-${TARGET}-${COMPONENT}
weight: 100
tls:
termination: edge
Expand Down

0 comments on commit 1377c53

Please sign in to comment.