This repository has been archived by the owner on May 3, 2023. It is now read-only.
generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: ci workflows for pr close and merge main * fix: new job names * fix: remove database deployment for now * fix: wrong yaml syntax * fix: adjust if condition to run on pull requests * ci: fix codeql into pull requests flow * fix: removed database deploy config files * fix: enable codeql to run in every commit
- Loading branch information
Ricardo Campos
authored
Aug 25, 2022
1 parent
d261fac
commit 697e04c
Showing
7 changed files
with
322 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
apiVersion: template.openshift.io/v1 | ||
kind: Template | ||
metadata: | ||
name: ${NAME} | ||
annotations: | ||
description: "NR Backend Starting API" | ||
tags: "nrbestapi" | ||
iconClass: icon-java | ||
labels: | ||
app: ${NAME}-${ZONE} | ||
app.kubernetes.io/part-of: ${NAME}-${ZONE} | ||
parameters: | ||
- name: NAME | ||
description: Module name | ||
value: nrbestapi | ||
- name: COMPONENT | ||
description: Component name | ||
value: service-api | ||
- name: ZONE | ||
description: Deployment zone, e.g. pr-### or prod | ||
required: true | ||
- name: IMAGE_TAG | ||
description: Image tag to use | ||
value: latest | ||
- name: DOMAIN | ||
value: apps.silver.devops.gov.bc.ca | ||
- name: CPU_REQUEST | ||
value: 100m | ||
- name: MEMORY_REQUEST | ||
value: 0.5Gi | ||
- name: REGISTRY | ||
description: Container registry to import from (internal is image-registry.openshift-image-registry.svc:5000) | ||
value: ghcr.io | ||
- name: PROMOTE | ||
description: Image (namespace/name:tag) to promote/import | ||
value: bcgov/nr-backend-starting-api:prod-service-api | ||
objects: | ||
- apiVersion: v1 | ||
kind: ImageStream | ||
metadata: | ||
labels: | ||
app: ${NAME}-${ZONE} | ||
name: ${NAME}-${ZONE}-${COMPONENT} | ||
spec: | ||
lookupPolicy: | ||
local: false | ||
tags: | ||
- name: ${IMAGE_TAG} | ||
from: | ||
kind: DockerImage | ||
name: ${REGISTRY}/${PROMOTE} | ||
referencePolicy: | ||
type: Local | ||
- apiVersion: v1 | ||
kind: DeploymentConfig | ||
metadata: | ||
labels: | ||
app: ${NAME}-${ZONE} | ||
name: ${NAME}-${ZONE}-${COMPONENT} | ||
spec: | ||
replicas: 1 | ||
triggers: | ||
- type: ConfigChange | ||
- type: ImageChange | ||
imageChangeParams: | ||
automatic: true | ||
containerNames: | ||
- ${NAME} | ||
from: | ||
kind: ImageStreamTag | ||
name: ${NAME}-${ZONE}-${COMPONENT}:${IMAGE_TAG} | ||
selector: | ||
deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} | ||
strategy: | ||
type: Rolling | ||
template: | ||
metadata: | ||
labels: | ||
app: ${NAME}-${ZONE} | ||
deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} | ||
spec: | ||
containers: | ||
- image: ${NAME}-${ZONE}-${COMPONENT}:${IMAGE_TAG} | ||
imagePullPolicy: Always | ||
name: ${NAME} | ||
env: | ||
- name: POSTGRESQL_HOST | ||
value: ${NAME}-${ZONE}-database | ||
- name: POSTGRESQL_DATABASE | ||
valueFrom: | ||
secretKeyRef: | ||
name: ${NAME}-${ZONE}-database | ||
key: database-name | ||
- name: POSTGRESQL_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: ${NAME}-${ZONE}-database | ||
key: database-password | ||
- name: POSTGRESQL_USER | ||
valueFrom: | ||
secretKeyRef: | ||
name: ${NAME}-${ZONE}-database | ||
key: database-user | ||
ports: | ||
- containerPort: 8090 | ||
protocol: TCP | ||
resources: | ||
requests: | ||
cpu: ${CPU_REQUEST} | ||
memory: ${MEMORY_REQUEST} | ||
readinessProbe: | ||
httpGet: | ||
path: /check | ||
port: 8090 | ||
scheme: HTTP | ||
initialDelaySeconds: 120 | ||
periodSeconds: 15 | ||
timeoutSeconds: 10 | ||
livenessProbe: | ||
successThreshold: 1 | ||
failureThreshold: 3 | ||
httpGet: | ||
path: /check | ||
port: 8090 | ||
scheme: HTTP | ||
initialDelaySeconds: 120 | ||
periodSeconds: 30 | ||
timeoutSeconds: 10 | ||
- apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: ${NAME}-${ZONE} | ||
name: ${NAME}-${ZONE}-${COMPONENT} | ||
spec: | ||
ports: | ||
- name: 8090-tcp | ||
protocol: TCP | ||
port: 80 | ||
targetPort: 8090 | ||
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: 8090-tcp | ||
to: | ||
kind: Service | ||
name: ${NAME}-${ZONE}-${COMPONENT} | ||
weight: 100 | ||
tls: | ||
termination: edge | ||
insecureEdgeTerminationPolicy: Redirect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.