Skip to content

Commit

Permalink
Fixing namespace target
Browse files Browse the repository at this point in the history
  • Loading branch information
raarielgrace committed Jan 16, 2025
1 parent f3e1f86 commit 191e7ee
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 26 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
file: common/openshift.init.yml
overwrite: true
parameters:
-p NAME_SUFFIX=-${{ inputs.target }}
-p TARGET=${{ inputs.target }}
-p DB_PASSWORD=${{ secrets.DB_PASSWORD }}
-p DB_USER=${{ secrets.DB_USER }}
-p DB_NAME=${{ secrets.DB_NAME }}
Expand All @@ -55,7 +55,6 @@ jobs:
file: database/openshift.deploy.yml
overwrite: false
parameters:
-p NAME_SUFFIX=-${{ inputs.target }}
-p IMAGE_TAG=${{ inputs.tag }}
-p TARGET=${{ inputs.target }}

Expand Down
6 changes: 3 additions & 3 deletions common/openshift.init.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Template
parameters:
- name: NAME_SUFFIX
- name: TARGET
required: true
- name: DB_PASSWORD
required: true
Expand All @@ -15,7 +15,7 @@ objects:
- apiVersion: v1
kind: Secret
metadata:
name: nr-nmp-database${NAME_SUFFIX}
name: nr-nmp-database-${TARGET}
stringData:
database-name: ${DB_NAME}
database-password: ${DB_PASSWORD}
Expand Down Expand Up @@ -47,7 +47,7 @@ objects:
- from:
- namespaceSelector:
matchLabels:
environment: dev
environment: ${TARGET}
name: fa23a0
policyTypes:
- Ingress
39 changes: 18 additions & 21 deletions database/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@ parameters:
- name: IMAGE_TAG
description: Image tag; e.g. PR number or latest
required: true
- name: NAME_SUFFIX
description: Suffix for the name
required: true
objects:
- kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: nr-nmp-database${NAME_SUFFIX}
name: nr-nmp-database-${TARGET}
labels:
app: nr-nmp${NAME_SUFFIX}
app: nr-nmp-${TARGET}
spec:
accessModes:
- ReadWriteOnce
Expand All @@ -36,32 +33,32 @@ objects:
- kind: Deployment
apiVersion: apps/v1
metadata:
name: nr-nmp-database${NAME_SUFFIX}
name: nr-nmp-database-${TARGET}
labels:
app: nr-nmp${NAME_SUFFIX}
app: nr-nmp-${TARGET}
spec:
replicas: 1
selector:
matchLabels:
deployment: nr-nmp-database${NAME_SUFFIX}
deployment: nr-nmp-database-${TARGET}
strategy:
type: Recreate
recreateParams:
timeoutSeconds: 600
activeDeadlineSeconds: 21600
template:
metadata:
name: nr-nmp-database${NAME_SUFFIX}
name: nr-nmp-database-${TARGET}
labels:
app: nr-nmp${NAME_SUFFIX}
deployment: nr-nmp-database${NAME_SUFFIX}
app: nr-nmp-${TARGET}
deployment: nr-nmp-database-${TARGET}
spec:
volumes:
- name: nr-nmp-database${NAME_SUFFIX}
- name: nr-nmp-database-${TARGET}
persistentVolumeClaim:
claimName: nr-nmp-database${NAME_SUFFIX}
claimName: nr-nmp-database-${TARGET}
containers:
- name: nr-nmp${NAME_SUFFIX}
- name: nr-nmp-${TARGET}
image: ghcr.io/bcgov/nr-nmp/database:${IMAGE_TAG}
ports:
- containerPort: 5432
Expand Down Expand Up @@ -101,20 +98,20 @@ objects:
- 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
volumeMounts:
- name: nr-nmp-database${NAME_SUFFIX}
- name: nr-nmp-database-${TARGET}
mountPath: "/var/lib/postgresql"
terminationMessagePath: "/dev/termination-log"
terminationMessagePolicy: File
Expand All @@ -127,8 +124,8 @@ objects:
kind: Service
metadata:
labels:
app: nr-nmp${NAME_SUFFIX}
name: nr-nmp-database${NAME_SUFFIX}
app: nr-nmp-${TARGET}
name: nr-nmp-database-${TARGET}
spec:
ports:
- name: postgresql
Expand All @@ -137,6 +134,6 @@ objects:
protocol: TCP
targetPort: 5432
selector:
deployment: nr-nmp-database${NAME_SUFFIX}
deployment: nr-nmp-database-${TARGET}
sessionAffinity: None
type: ClusterIP

0 comments on commit 191e7ee

Please sign in to comment.