Skip to content
Merged
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
116 changes: 68 additions & 48 deletions examples/jenkins/pipeline/bluegreen-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ objects:
- generic:
secret: "${GENERIC_WEBHOOK_SECRET}"
type: Generic
- apiVersion: v1
kind: Secret
metadata:
name: ${NAME}
stringData:
database-admin-password: ${DATABASE_ADMIN_PASSWORD}
database-password: ${DATABASE_PASSWORD}
database-user: ${DATABASE_USER}
- apiVersion: v1
kind: Route
metadata:
Expand Down Expand Up @@ -210,7 +218,7 @@ objects:
port: 8080
initialDelaySeconds: 30
timeoutSeconds: 3
name: nodejs-mariadb-example
name: nodejs-postgresql-example
ports:
- containerPort: 8080
readinessProbe:
Expand All @@ -226,7 +234,7 @@ objects:
- imageChangeParams:
automatic: true
containerNames:
- nodejs-mariadb-example
- nodejs-postgresql-example
from:
kind: ImageStreamTag
name: ${NAME}:blue
Expand Down Expand Up @@ -265,24 +273,31 @@ objects:
spec:
containers:
- env:
- name: DATABASE_SERVICE_NAME
value: ${DATABASE_SERVICE_NAME}
- name: MYSQL_USER
value: ${DATABASE_USER}
- name: MYSQL_PASSWORD
value: ${DATABASE_PASSWORD}
- name: MYSQL_DATABASE
value: ${DATABASE_NAME}
- name: MYSQL_ROOT_PASSWORD
value: ${DATABASE_ROOT_PASSWORD}
- name: POSTGRESQL_USER
valueFrom:
secretKeyRef:
key: database-user
name: ${NAME}
- name: POSTGRESQL_PASSWORD
valueFrom:
secretKeyRef:
key: database-password
name: ${NAME}
- name: POSTGRESQL_DATABASE
value: ${DATABASE_NAME}
- name: POSTGRESQL_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
key: database-admin-password
name: ${NAME}
image: ' '
livenessProbe:
httpGet:
path: /pagecount
port: 8080
initialDelaySeconds: 30
timeoutSeconds: 3
name: nodejs-mariadb-example
name: nodejs-postgresql-example
ports:
- containerPort: 8080
readinessProbe:
Expand All @@ -298,7 +313,7 @@ objects:
- imageChangeParams:
automatic: true
containerNames:
- nodejs-mariadb-example
- nodejs-postgresql-example
from:
kind: ImageStreamTag
name: ${NAME}:green
Expand All @@ -312,9 +327,9 @@ objects:
name: ${DATABASE_SERVICE_NAME}
spec:
ports:
- name: mariadb
port: 3306
targetPort: 3306
- name: postgresql
port: 5432
targetPort: 5432
selector:
name: ${DATABASE_SERVICE_NAME}
- apiVersion: v1
Expand All @@ -337,32 +352,32 @@ objects:
spec:
containers:
- env:
- name: MYSQL_USER
value: ${DATABASE_USER}
- name: MYSQL_PASSWORD
value: ${DATABASE_PASSWORD}
- name: MYSQL_DATABASE
value: ${DATABASE_NAME}
- name: MYSQL_ROOT_PASSWORD
value: ${DATABASE_ROOT_PASSWORD}
- name: POSTGRESQL_USER
valueFrom:
secretKeyRef:
key: database-user
name: ${NAME}
- name: POSTGRESQL_PASSWORD
valueFrom:
secretKeyRef:
key: database-password
name: ${NAME}
- name: POSTGRESQL_DATABASE
value: ${DATABASE_NAME}
- name: POSTGRESQL_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
key: database-admin-password
name: ${NAME}
image: ' '
livenessProbe:
initialDelaySeconds: 30
tcpSocket:
port: 27017
port: 5432
timeoutSeconds: 1
name: mariadb
name: postgresql
ports:
- containerPort: 27017
readinessProbe:
exec:
command:
- /bin/sh
- -i
- -c
- MYSQL_PWD=\"$MYSQL_PASSWORD\" mysqladmin -u $MYSQL_USER ping
initialDelaySeconds: 3
timeoutSeconds: 1
- containerPort: 5432
resources:
limits:
memory: ${MEMORY_MYSQL_LIMIT}
Expand All @@ -377,10 +392,10 @@ objects:
- imageChangeParams:
automatic: true
containerNames:
- mariadb
- postgresql
from:
kind: ImageStreamTag
name: mariadb:10.3-el8
name: postgresql:${POSTGRESQL_VERSION}
namespace: ${NAMESPACE}
type: ImageChange
- type: ConfigChange
Expand All @@ -389,7 +404,7 @@ parameters:
displayName: Name
name: NAME
required: true
value: nodejs-mariadb-example
value: nodejs-postgresql-example
- description: The exposed hostname that will route to the Node.js service, if left
blank a value will be defaulted.
displayName: Application Hostname
Expand All @@ -404,17 +419,22 @@ parameters:
name: SOURCE_REPOSITORY_REF
required: true
value: master
- description: Password for the database admin user.
displayName: Database Administrator Password
from: '[a-zA-Z0-9]{16}'
generate: expression
name: DATABASE_ADMIN_PASSWORD
- displayName: Database Name
name: DATABASE_NAME
required: true
value: sampledb
- description: Username for MariaDB user that will be used for accessing the database.
displayName: MariaDB Username
- description: Username for postgresql user that will be used for accessing the database.
displayName: postgresql Username
from: user[A-Z0-9]{3}
generate: expression
name: DATABASE_USER
- description: Password for the MariaDB user.
displayName: MariaDB Password
- description: Password for the postgresql user.
displayName: postgresql Password
from: '[a-zA-Z0-9]{16}'
generate: expression
name: DATABASE_PASSWORD
Expand All @@ -423,15 +443,15 @@ parameters:
name: MEMORY_LIMIT
required: true
value: 512Mi
- description: Maximum amount of memory the MariaDB container can use.
displayName: Memory Limit (MariaDB)
- description: Maximum amount of memory the postgresql container can use.
displayName: Memory Limit (postgresql)
name: MEMORY_MYSQL_LIMIT
required: true
value: 512Mi
- displayName: Database Service Name
name: DATABASE_SERVICE_NAME
required: true
value: mariadb
value: postgresql
- description: Password for the database admin user.
displayName: Database Administrator Password
from: '[a-zA-Z0-9]{16}'
Expand All @@ -454,7 +474,7 @@ parameters:
- description: The custom NPM mirror URL
displayName: Custom NPM Mirror URL
name: NPM_MIRROR
- description: The OpenShift Namespace where the NodeJS and MariaDB ImageStreams reside.
- description: The OpenShift Namespace where the NodeJS and postgresql ImageStreams reside.
displayName: Namespace
name: NAMESPACE
required: true
Expand Down
Loading