Skip to content

Commit

Permalink
feat(FSADT1-679): disabling openshift routes (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paulo Gomes da Cruz Junior committed Feb 6, 2024
1 parent 8012fe0 commit 4206cda
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 41 deletions.
42 changes: 42 additions & 0 deletions .github/openshift.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: ${NAME}
annotations:
description: "Nr-Forest-Client-Api"
tags: "nr-forest-client-api"
iconClass: icon-js
labels:
app: ${NAME}-${ZONE}
app.kubernetes.io/part-of: ${NAME}-${ZONE}
parameters:
- name: NAME
description: Module name
value: nr-forest-client-api
- name: ZONE
description: Deployment zone, e.g. pr-### or prod
required:
true
- name: COMPONENT
description: Component name
value: backend
- name: DOMAIN
value: apps.silver.devops.gov.bc.ca
objects:
- apiVersion: route.openshift.io/v1
kind: Route
metadata:
labels:
app: ${NAME}-${ZONE}
name: ${NAME}-${ZONE}-${COMPONENT}
spec:
host: ${NAME}-${ZONE}-${COMPONENT}.${DOMAIN}
port:
targetPort: 3001-tcp
to:
kind: Service
name: ${NAME}-${ZONE}-${COMPONENT}
weight: 100
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
8 changes: 0 additions & 8 deletions .github/workflows/api-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Postman Smoke Test on Openshift
uses: matt-ball/newman-action@master
with:
collection: postman/FCA.postman_collection.json
envVar: '[{"key":"URL_FCA","value":"https://${{ github.event.repository.name }}-${{ matrix.package }}-backend.${{ env.OS_DOMAIN }}"}]'
reporters: '["cli"]'
folder: '["general"]'

- name: Postman Smoke Test on API Gateway
uses: matt-ball/newman-action@master
with:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,17 @@ jobs:
-p ORACLEDB_SECRET=${{ secrets.ORACLEDB_SECRET }}
-p ZONE=${{ github.event.number }}

- name: Deploy dev route
uses: bcgov-nr/action-deployer-openshift@v2.0.0
with:
file: .github/openshift.dev.yml
oc_namespace: ${{ secrets.OC_NAMESPACE }}
oc_server: ${{ secrets.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
overwrite: true
parameters:
-p ZONE=${{ github.event.number }}

postman:
name: Smoke Test
needs: [deploy]
Expand Down
49 changes: 16 additions & 33 deletions openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ parameters:
description: The amount of storage the cert PVC should have
value: 25Mi
objects:
- apiVersion: v1
kind: Secret
- kind: Secret
apiVersion: v1
metadata:
name: ${NAME}-${ZONE}-${COMPONENT}
labels:
Expand All @@ -69,8 +69,8 @@ objects:
oracle-host: "${ORACLEDB_HOST}"
oracle-service: "${ORACLEDB_SERVICENAME}"
oracle-secret: "${ORACLEDB_SECRET}"
- apiVersion: v1
kind: ImageStream
- kind: ImageStream
apiVersion: v1
metadata:
labels:
app: ${NAME}-${ZONE}
Expand All @@ -85,8 +85,8 @@ objects:
name: ghcr.io/bcgov/${NAME}/api:${ZONE}
referencePolicy:
type: Local
- apiVersion: v1
kind: PersistentVolumeClaim
- kind: PersistentVolumeClaim
apiVersion: v1
metadata:
labels:
app: ${NAME}-${ZONE}
Expand All @@ -98,8 +98,8 @@ objects:
requests:
storage: ${CERT_PVC_SIZE}
storageClassName: netapp-file-standard
- apiVersion: v1
kind: DeploymentConfig
- kind: DeploymentConfig
apiVersion: v1
metadata:
labels:
app: ${NAME}-${ZONE}
Expand Down Expand Up @@ -228,8 +228,8 @@ objects:
volumeMounts:
- mountPath: /cert
name: ${NAME}-${ZONE}-${COMPONENT}
- apiVersion: v1
kind: Service
- kind: Service
apiVersion: v1
metadata:
labels:
app: ${NAME}-${ZONE}
Expand All @@ -242,25 +242,8 @@ objects:
targetPort: 3001
selector:
deploymentconfig: ${NAME}-${ZONE}-${COMPONENT}
- apiVersion: route.openshift.io/v1
kind: Route
metadata:
labels:
app: ${NAME}-${ZONE}
name: ${NAME}-${ZONE}-${COMPONENT}
spec:
host: ${NAME}-${ZONE}-${COMPONENT}.${DOMAIN}
port:
targetPort: 3001-tcp
to:
kind: Service
name: ${NAME}-${ZONE}-${COMPONENT}
weight: 100
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
- apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
- kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: allow-from-openshift-ingress
labels:
Expand All @@ -274,8 +257,8 @@ objects:
network.openshift.io/policy-group: ingress
policyTypes:
- Ingress
- apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
- kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: allow-same-namespace
labels:
Expand All @@ -287,8 +270,8 @@ objects:
- podSelector: {}
policyTypes:
- Ingress
- apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
- kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: allow-traffic-from-gateway-to-your-api
spec:
Expand Down

0 comments on commit 4206cda

Please sign in to comment.