diff --git a/backend/openshift.deploy.yml b/backend/openshift.deploy.yml index 2dc13e7cde..321e57865f 100644 --- a/backend/openshift.deploy.yml +++ b/backend/openshift.deploy.yml @@ -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 @@ -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: @@ -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: @@ -203,6 +185,8 @@ objects: value: ${COMPONENT} - name: FEATURES_BCREGISTRY_MULTIADDRESS value: "false" + - name: RANDOM_EXPRESSION + value: ${RANDOM_EXPRESSION} ports: - containerPort: 8080 protocol: TCP @@ -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: diff --git a/database/openshift.backup.yml b/database/openshift.backup.yml index 0dd57c5d58..63e5edbabe 100644 --- a/database/openshift.backup.yml +++ b/database/openshift.backup.yml @@ -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 @@ -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 @@ -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: - | @@ -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: - | diff --git a/database/openshift.deploy.yml b/database/openshift.deploy.yml index 2683234cdc..d75a6865f7 100644 --- a/database/openshift.deploy.yml +++ b/database/openshift.deploy.yml @@ -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 @@ -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 @@ -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: @@ -144,7 +126,7 @@ objects: name: ${NAME}-${ZONE}-${COMPONENT} labels: app: ${NAME}-${ZONE} - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} + deployment: ${NAME}-${ZONE}-${COMPONENT} spec: volumes: - name: ${NAME}-${ZONE}-${COMPONENT} @@ -152,7 +134,7 @@ objects: claimName: ${NAME}-${ZONE}-${COMPONENT} containers: - name: ${NAME} - image: ${NAME}-${ZONE}-${COMPONENT}:${IMAGE_TAG} + image: ${REGISTRY}/${ORG}/${NAME}/${COMPONENT}:${TAG} ports: - containerPort: 5432 protocol: TCP @@ -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} @@ -218,6 +202,6 @@ objects: protocol: TCP targetPort: 5432 selector: - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} + deployment: ${NAME}-${ZONE}-${COMPONENT} sessionAffinity: None type: ClusterIP diff --git a/database/openshift.dev.yml b/database/openshift.dev.yml index 6334f124c5..6964689cb7 100644 --- a/database/openshift.dev.yml +++ b/database/openshift.dev.yml @@ -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} @@ -61,4 +61,4 @@ objects: name: ${NAME}-${ZONE} key: "database-password" imagePullPolicy: Always - restartPolicy: Never \ No newline at end of file + restartPolicy: Never diff --git a/frontend/openshift.deploy.yml b/frontend/openshift.deploy.yml index 2574d362bf..51f1d53c4e 100644 --- a/frontend/openshift.deploy.yml +++ b/frontend/openshift.deploy.yml @@ -19,17 +19,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-old-growth:prod-frontend - name: CPU_REQUEST value: 10m - name: CPU_LIMIT @@ -73,24 +76,12 @@ parameters: - name: FRONTEND_URL description: Frontend URL required: true + - name: RANDOM_EXPRESSION + description: Random expression to make sure deployments update + from: "[a-zA-Z0-9]{32}" + generate: expression objects: 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: ConfigMap apiVersion: v1 metadata: @@ -111,28 +102,19 @@ objects: window.localStorage.setItem('VITE_LOGOUT_BCSC_URL','${LANDING_URL}'); window.localStorage.setItem('VITE_LOGOUT_BCEIDBUSINESS_URL','${LANDING_URL}'); window.localStorage.setItem('VITE_LOGOUT_IDIR_URL','https://${URL}'); - - 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: @@ -141,7 +123,7 @@ objects: prometheus.io/path: "/metrics" labels: app: ${NAME}-${ZONE} - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} + deployment: ${NAME}-${ZONE}-${COMPONENT} spec: volumes: - name: app-config @@ -151,7 +133,7 @@ objects: configMap: name: ${NAME}-${ZONE}-${COMPONENT}-config containers: - - image: ${NAME}-${ZONE}-${COMPONENT}:${IMAGE_TAG} + - image: ${REGISTRY}/${ORG}/${NAME}/${COMPONENT}:${TAG} securityContext: capabilities: add: ["NET_BIND_SERVICE"] @@ -166,6 +148,8 @@ objects: value: ${COGNITO_REGION} - name: COGNITO_DOMAIN value: ${COGNITO_DOMAIN} + - name: RANDOM_EXPRESSION + value: ${RANDOM_EXPRESSION} imagePullPolicy: Always name: ${NAME} volumeMounts: @@ -216,7 +200,7 @@ objects: port: 80 targetPort: 3000 selector: - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} + deployment: ${NAME}-${ZONE}-${COMPONENT} - kind: Route apiVersion: route.openshift.io/v1 metadata: diff --git a/legacy/openshift.deploy.yml b/legacy/openshift.deploy.yml index 03b47922e9..e3b4cc8b5d 100644 --- a/legacy/openshift.deploy.yml +++ b/legacy/openshift.deploy.yml @@ -13,20 +13,20 @@ parameters: - name: ZONE description: Deployment zone, e.g. pr-### or prod required: true - - name: ENVIRONMENT - description: Environment name used by the application - value: prod - - 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-legacy:prod - name: ORACLEDB_KEYSTORE description: Oracle database keystore file - name: ORACLEDB_PORT @@ -43,23 +43,11 @@ parameters: - name: CERT_PVC_SIZE description: The amount of storage the cert PVC should have value: 25Mi + - 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: PersistentVolumeClaim apiVersion: v1 metadata: @@ -73,8 +61,8 @@ objects: requests: storage: ${CERT_PVC_SIZE} storageClassName: netapp-file-standard - - kind: DeploymentConfig - apiVersion: v1 + - kind: Deployment + apiVersion: apps/v1 metadata: labels: app: ${NAME}-${ZONE} @@ -82,20 +70,11 @@ objects: 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: @@ -104,7 +83,7 @@ objects: prometheus.io/path: "/metrics" labels: app: ${NAME}-${ZONE} - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} + deployment: ${NAME}-${ZONE}-${COMPONENT} spec: volumes: - name: ${NAME}-${ZONE}-certs @@ -138,7 +117,7 @@ objects: cpu: ${CPU_REQUEST} memory: ${MEMORY_REQUEST} containers: - - image: ${NAME}-${ZONE}-${COMPONENT}:${IMAGE_TAG} + - image: ${REGISTRY}/${ORG}/${NAME}/${COMPONENT}:${TAG} imagePullPolicy: Always name: ${NAME} env: @@ -180,6 +159,8 @@ objects: value: /cert/jssecacerts - name: TZ value: America/Vancouver + - name: RANDOM_EXPRESSION + value: ${RANDOM_EXPRESSION} ports: - containerPort: 9000 protocol: TCP @@ -226,4 +207,4 @@ objects: port: 80 targetPort: 9000 selector: - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} + deployment: ${NAME}-${ZONE}-${COMPONENT} diff --git a/processor/openshift.deploy.yml b/processor/openshift.deploy.yml index 460316267f..11f36a3d22 100644 --- a/processor/openshift.deploy.yml +++ b/processor/openshift.deploy.yml @@ -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-old-growth:prod-backend - name: CPU_REQUEST value: 75m - name: CPU_LIMIT @@ -35,45 +38,25 @@ parameters: - name: BCREGISTRY_URI description: Bc Registry API address required: true + - name: RANDOM_EXPRESSION + description: Random expression to make sure deployments update + from: "[a-zA-Z0-9]{32}" + generate: expression 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 + + - 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: @@ -82,10 +65,10 @@ objects: prometheus.io/path: "/metrics" labels: app: ${NAME}-${ZONE} - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} + deployment: ${NAME}-${ZONE}-${COMPONENT} spec: containers: - - image: ${NAME}-${ZONE}-${COMPONENT}:${IMAGE_TAG} + - image: ${REGISTRY}/${ORG}/${NAME}/${COMPONENT}:${TAG} imagePullPolicy: Always name: ${NAME} env: @@ -136,6 +119,8 @@ objects: secretKeyRef: name: ${NAME}-${ZONE} key: processor-service-account-secret + - name: RANDOM_EXPRESSION + value: ${RANDOM_EXPRESSION} ports: - containerPort: 3000 protocol: TCP @@ -169,4 +154,4 @@ objects: port: 80 targetPort: 3100 selector: - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} + deployment: ${NAME}-${ZONE}-${COMPONENT}