Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci!: deployment config deprecation, image stream removal #1298

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 23 additions & 39 deletions backend/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,20 @@ parameters:
- name: ZONE
description: Deployment zone, e.g. pr-### or prod
required: true
- name: IMAGE_TAG
description: Image tag to use
value: latest
- name: TAG
description: Image tag; e.g. PR number, latest or prod
required: true
- name: REGISTRY
description: Container registry to import from (internal is image-registry.openshift-image-registry.svc:5000)
value: ghcr.io
- name: ORG
description: Organization name
value: bcgov
- name: DOMAIN
value: apps.silver.devops.gov.bc.ca
- 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-forest-client-backend:prod
- name: CHES_TOKEN_URL
description: CHES service authentication url
required: true
Expand All @@ -50,45 +53,24 @@ parameters:
- name: CONFIG_MAP_NAME
description: ConfigMap name specific to each environment
value: ${NAME}-${ZONE}-${COMPONENT}-config
- name: RANDOM_EXPRESSION
description: Random expression to make sure deployments update
from: "[a-zA-Z0-9]{32}"
generate: expression
objects:
- kind: ImageStream
apiVersion: v1
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
- kind: DeploymentConfig
apiVersion: v1
- kind: Deployment
apiVersion: apps/v1
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}
matchLabels:
deployment: ${NAME}-${ZONE}-${COMPONENT}
strategy:
type: Rolling
type: RollingUpdate
template:
metadata:
annotations:
Expand All @@ -97,14 +79,14 @@ objects:
prometheus.io/path: "/metrics"
labels:
app: ${NAME}-${ZONE}
deploymentconfig: ${NAME}-${ZONE}-${COMPONENT}
deployment: ${NAME}-${ZONE}-${COMPONENT}
spec:
volumes:
- name: ${COMPONENT}-config
configMap:
name: ${NAME}-${ZONE}-${COMPONENT}-config
containers:
- image: ${NAME}-${ZONE}-${COMPONENT}:${IMAGE_TAG}
- image: ${REGISTRY}/${ORG}/${NAME}/${COMPONENT}:${TAG}
imagePullPolicy: Always
name: ${NAME}
volumeMounts:
Expand Down Expand Up @@ -203,6 +185,8 @@ objects:
value: ${COMPONENT}
- name: FEATURES_BCREGISTRY_MULTIADDRESS
value: "false"
- name: RANDOM_EXPRESSION
value: ${RANDOM_EXPRESSION}
ports:
- containerPort: 8080
protocol: TCP
Expand Down Expand Up @@ -236,7 +220,7 @@ objects:
port: 80
targetPort: 8080
selector:
deploymentconfig: ${NAME}-${ZONE}-${COMPONENT}
deployment: ${NAME}-${ZONE}-${COMPONENT}
- kind: Route
apiVersion: route.openshift.io/v1
metadata:
Expand Down
19 changes: 11 additions & 8 deletions database/openshift.backup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ parameters:
- name: ZONE
description: Deployment zone, e.g. pr-### or prod
required: true
- name: IMAGE_TAG
description: Image tag to use
value: latest
- name: TAG
description: Image tag; e.g. PR number, latest or prod
required: true
- name: REGISTRY
description: Container registry to import from (internal is image-registry.openshift-image-registry.svc:5000)
value: ghcr.io
- name: ORG
description: Organization name
value: bcgov
- name: RESTORE_DIR
description: Folder that contains initialization scripts
value: /tmp/restore
Expand Down Expand Up @@ -48,9 +54,6 @@ parameters:
- name: PVC_SIZE
description: Volume space available for data, e.g. 512Mi, 2Gi.
value: 256Mi
- name: PROMOTE
description: Image (namespace/name:tag) to promote/import
required: true
objects:
- kind: PersistentVolumeClaim
apiVersion: v1
Expand Down Expand Up @@ -92,7 +95,7 @@ objects:
spec:
containers:
- name: ${NAME}-${ZONE}-${COMPONENT}
image: ${REGISTRY}/${PROMOTE}
image: ${REGISTRY}/${ORG}/${NAME}/${COMPONENT}:${TAG}
command: ["/bin/sh", "-c"]
args:
- |
Expand Down Expand Up @@ -187,7 +190,7 @@ objects:
spec:
containers:
- name: ${NAME}-${ZONE}-${COMPONENT}-restore
image: ${REGISTRY}/${PROMOTE}
image: ${REGISTRY}/${ORG}/${NAME}/${COMPONENT}:${TAG}
command: ["/bin/sh", "-c"]
args:
- |
Expand Down
60 changes: 22 additions & 38 deletions database/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ parameters:
- name: ZONE
description: Deployment zone, e.g. pr-### or prod
required: true
- name: IMAGE_TAG
description: Image tag to use
value: latest
- name: TAG
description: Image tag; e.g. PR number, latest or prod
required: true
- name: REGISTRY
description: Container registry to import from (internal is image-registry.openshift-image-registry.svc:5000)
value: ghcr.io
- name: ORG
description: Organization name
value: bcgov
- name: PVC_MOUNT_PATH
description: Where to mount the PVC, subpath (e.g. data/)
value: /var/lib/postgresql
Expand Down Expand Up @@ -81,9 +87,10 @@ parameters:
description: Random number, 0-60, for scheduling cronjobs
from: "[0-5]{1}[0-9]{1}"
generate: expression
- name: PROMOTE
description: Image (namespace/name:tag) to promote/import
required: true
- name: RANDOM_EXPRESSION
description: Random expression to make sure deployments update
from: "[a-zA-Z0-9]{32}"
generate: expression
objects:
- kind: PersistentVolumeClaim
apiVersion: v1
Expand All @@ -98,42 +105,17 @@ objects:
requests:
storage: ${DB_PVC_SIZE}
storageClassName: netapp-file-standard
- kind: ImageStream
apiVersion: v1
metadata:
name: ${NAME}-${ZONE}-${COMPONENT}
labels:
app: ${NAME}-${ZONE}
spec:
lookupPolicy:
local: false
tags:
- name: ${IMAGE_TAG}
from:
kind: DockerImage
name: ${REGISTRY}/${PROMOTE}
referencePolicy:
type: Local
- kind: DeploymentConfig
apiVersion: v1
- kind: Deployment
apiVersion: apps/v1
metadata:
name: ${NAME}-${ZONE}-${COMPONENT}
labels:
app: ${NAME}-${ZONE}
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}
matchLabels:
deployment: ${NAME}-${ZONE}-${COMPONENT}
strategy:
type: Recreate
recreateParams:
Expand All @@ -144,15 +126,15 @@ objects:
name: ${NAME}-${ZONE}-${COMPONENT}
labels:
app: ${NAME}-${ZONE}
deploymentconfig: ${NAME}-${ZONE}-${COMPONENT}
deployment: ${NAME}-${ZONE}-${COMPONENT}
spec:
volumes:
- name: ${NAME}-${ZONE}-${COMPONENT}
persistentVolumeClaim:
claimName: ${NAME}-${ZONE}-${COMPONENT}
containers:
- name: ${NAME}
image: ${NAME}-${ZONE}-${COMPONENT}:${IMAGE_TAG}
image: ${REGISTRY}/${ORG}/${NAME}/${COMPONENT}:${TAG}
ports:
- containerPort: 5432
protocol: TCP
Expand Down Expand Up @@ -194,6 +176,8 @@ objects:
secretKeyRef:
name: ${NAME}-${ZONE}
key: database-user
- name: RANDOM_EXPRESSION
value: ${RANDOM_EXPRESSION}
volumeMounts:
- name: ${NAME}-${ZONE}-${COMPONENT}
mountPath: ${PVC_MOUNT_PATH}
Expand All @@ -218,6 +202,6 @@ objects:
protocol: TCP
targetPort: 5432
selector:
deploymentconfig: ${NAME}-${ZONE}-${COMPONENT}
deployment: ${NAME}-${ZONE}-${COMPONENT}
sessionAffinity: None
type: ClusterIP
4 changes: 2 additions & 2 deletions database/openshift.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ objects:
name: ${NAME}-${ZONE}-${COMPONENT}
labels:
app: ${NAME}-${ZONE}
deploymentconfig: ${NAME}-${ZONE}-${COMPONENT}
deployment: ${NAME}-${ZONE}-${COMPONENT}
spec:
containers:
- name: ${NAME}
Expand Down Expand Up @@ -61,4 +61,4 @@ objects:
name: ${NAME}-${ZONE}
key: "database-password"
imagePullPolicy: Always
restartPolicy: Never
restartPolicy: Never
Loading
Loading