diff --git a/deploy/aro/infrastructure/azure-pipelines.yml b/deploy/aro/infrastructure/azure-pipelines.yml index 231dd7247..75ffcc634 100644 --- a/deploy/aro/infrastructure/azure-pipelines.yml +++ b/deploy/aro/infrastructure/azure-pipelines.yml @@ -43,6 +43,18 @@ stages: - script: 'oc process -f ./deploy/aro/openshift-templates/infrastructure/secrets-deploy-template.yml -p CATALOG_DB_CONNECTION_SECRET="$(CatalogDbConnection)" -p IDENTITY_DB_CONNECTION_SECRET="$(IdentityDbConnection)" -p MARKETING_DB_CONNECTION_SECRET="$(MarketingDbConnection)" -p ORDERING_DB_CONNECTION_SECRET="$(OrderingDbConnection)" -p SQL_PASSWORD_SECRET=$(SqlPassword) -p WEBHOOKS_DB_CONNECTION_SECRET="$(WebhooksDbConnection)" | oc apply -f-' failOnStderr: true displayName: 'Secrets Deployment' - - script: 'oc process -f ./deploy/aro/openshift-templates/infrastructure/rabbitmq-image-deploy-template.yml -p IMAGE_REGISTRY_PROJECT_NAME=$(SourceImageRegistryProjectName) | oc apply -f-' + - script: 'oc process -f ./deploy/aro/openshift-templates/infrastructure/rabbitmq-deploy-template.yml -p IMAGE_REGISTRY_PROJECT_NAME=$(SourceImageRegistryProjectName) | oc apply -f-' failOnStderr: true - displayName: 'RabbitMQ Deployment' \ No newline at end of file + displayName: 'RabbitMQ Deployment' + - script: 'oc process -f ./deploy/aro/openshift-templates/infrastructure/redis-deploy-template.yml -p IMAGE_REGISTRY_PROJECT_NAME=$(SourceImageRegistryProjectName) | oc apply -f-' + failOnStderr: true + displayName: 'Redis Deployment' + - script: 'oc process -f ./deploy/aro/openshift-templates/infrastructure/seq-deploy-template.yml -p IMAGE_REGISTRY_PROJECT_NAME=$(SourceImageRegistryProjectName) | oc apply -f-' + failOnStderr: true + displayName: 'Seq Deployment' + - script: 'oc process -f ./deploy/aro/openshift-templates/infrastructure/mssql-server-deploy-template.yml -p IMAGE_REGISTRY_PROJECT_NAME=$(SourceImageRegistryProjectName) | oc apply -f-' + failOnStderr: true + displayName: 'SQL Server Deployment' + - script: 'oc process -f ./deploy/aro/openshift-templates/infrastructure/mongo-db-deploy-template.yml -p IMAGE_REGISTRY_PROJECT_NAME=$(SourceImageRegistryProjectName) | oc apply -f-' + failOnStderr: true + displayName: 'MongoDB Deployment' \ No newline at end of file diff --git a/deploy/aro/openshift-templates/infrastructure/mongo-db-deploy-template.yml b/deploy/aro/openshift-templates/infrastructure/mongo-db-deploy-template.yml new file mode 100644 index 000000000..f419b5176 --- /dev/null +++ b/deploy/aro/openshift-templates/infrastructure/mongo-db-deploy-template.yml @@ -0,0 +1,113 @@ +apiVersion: template.openshift.io/v1 +kind: Template +metadata: + name: ${TEMPLATE_NAME} +objects: +- apiVersion: apps.openshift.io/v1 + kind: DeploymentConfig + metadata: + labels: + app: ${APPLICATION_NAME} + template: ${TEMPLATE_NAME} + name: ${APPLICATION_NAME} + spec: + replicas: 1 + revisionHistoryLimit: 10 + selector: + app: ${APPLICATION_NAME} + deploymentconfig: ${APPLICATION_NAME} + strategy: + activeDeadlineSeconds: 21600 + resources: {} + rollingParams: + intervalSeconds: 1 + maxSurge: 25% + maxUnavailable: 25% + timeoutSeconds: 600 + updatePeriodSeconds: 1 + type: Rolling + template: + metadata: + labels: + app: ${APPLICATION_NAME} + deploymentconfig: ${APPLICATION_NAME} + spec: + containers: + - image: ${APPLICATION_NAME}:latest + imagePullPolicy: Always + name: ${APPLICATION_NAME} + ports: + - containerPort: 27017 + protocol: TCP + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /data/configdb + name: ${APPLICATION_NAME}-volume-1 + - mountPath: /data/db + name: ${APPLICATION_NAME}-volume-2 + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 + volumes: + - emptyDir: {} + name: ${APPLICATION_NAME}-volume-1 + - emptyDir: {} + name: ${APPLICATION_NAME}-volume-2 + triggers: + - type: ConfigChange + - imageChangeParams: + automatic: true + containerNames: + - ${APPLICATION_NAME} + from: + kind: ImageStreamTag + name: '${APPLICATION_NAME}:latest' + namespace: ${IMAGE_REGISTRY_PROJECT_NAME} + type: ImageChange +- apiVersion: v1 + kind: Service + metadata: + labels: + app: ${APPLICATION_NAME} + template: ${TEMPLATE_NAME} + name: ${APPLICATION_NAME} + spec: + ports: + - name: 27017-tcp + port: 27017 + protocol: TCP + targetPort: 27017 + selector: + app: ${APPLICATION_NAME} + deploymentconfig: ${APPLICATION_NAME} + sessionAffinity: None + type: ClusterIP +- apiVersion: image.openshift.io/v1 + kind: ImageStream + metadata: + labels: + app: ${APPLICATION_NAME} + template: ${TEMPLATE_NAME} + name: ${APPLICATION_NAME} + spec: + lookupPolicy: + local: false +parameters: +- description: The name for the application. + displayName: Application Name + name: APPLICATION_NAME + required: true + value: mongo +- description: The OpenShift project name that is hosting the image registry. + displayName: Image Registry Project Name + name: IMAGE_REGISTRY_PROJECT_NAME + required: true +- description: The template name. + displayName: Template Name + name: TEMPLATE_NAME + required: true + value: mongo-db-deploy-template \ No newline at end of file diff --git a/deploy/aro/openshift-templates/infrastructure/mssql-server-deploy-template.yml b/deploy/aro/openshift-templates/infrastructure/mssql-server-deploy-template.yml new file mode 100644 index 000000000..132476228 --- /dev/null +++ b/deploy/aro/openshift-templates/infrastructure/mssql-server-deploy-template.yml @@ -0,0 +1,134 @@ +apiVersion: template.openshift.io/v1 +kind: Template +metadata: + name: ${TEMPLATE_NAME} +objects: +- apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + labels: + app: ${APPLICATION_NAME} + template: ${TEMPLATE_NAME} + name: sql-storage-claim + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi +- apiVersion: apps.openshift.io/v1 + kind: DeploymentConfig + metadata: + labels: + app: ${APPLICATION_NAME} + template: ${TEMPLATE_NAME} + name: ${APPLICATION_NAME} + spec: + replicas: 1 + revisionHistoryLimit: 10 + selector: + app: ${APPLICATION_NAME} + deploymentconfig: ${APPLICATION_NAME} + strategy: + activeDeadlineSeconds: 21600 + resources: {} + rollingParams: + intervalSeconds: 1 + maxSurge: 25% + maxUnavailable: 25% + timeoutSeconds: 600 + updatePeriodSeconds: 1 + type: Rolling + template: + metadata: + labels: + app: ${APPLICATION_NAME} + deploymentconfig: ${APPLICATION_NAME} + spec: + containers: + - env: + - name: ACCEPT_EULA + value: 'Y' + - name: SA_PASSWORD + valueFrom: + secretKeyRef: + key: SA_PASSWORD + name: sa-password-secret + envFrom: + - secretRef: + name: sa-password-secret + image: mcr.microsoft.com/mssql/server:latest + imagePullPolicy: IfNotPresent + name: ${APPLICATION_NAME} + ports: + - containerPort: 1433 + protocol: TCP + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/opt/mssql/ + name: sql-volume-01 + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 + volumes: + - name: sql-volume-01 + persistentVolumeClaim: + claimName: sql-storage-claim + triggers: + - type: ConfigChange + - imageChangeParams: + automatic: true + containerNames: + - ${APPLICATION_NAME} + from: + kind: ImageStreamTag + name: '${APPLICATION_NAME}:latest' + namespace: ${IMAGE_REGISTRY_PROJECT_NAME} + type: ImageChange +- apiVersion: v1 + kind: Service + metadata: + labels: + app: ${APPLICATION_NAME} + template: ${TEMPLATE_NAME} + name: ${APPLICATION_NAME} + spec: + ports: + - name: 1433-tcp + port: 1433 + protocol: TCP + targetPort: 1433 + selector: + app: ${APPLICATION_NAME} + deploymentconfig: ${APPLICATION_NAME} + sessionAffinity: None + type: ClusterIP +- apiVersion: image.openshift.io/v1 + kind: ImageStream + metadata: + labels: + app: ${APPLICATION_NAME} + template: ${TEMPLATE_NAME} + name: ${APPLICATION_NAME} + spec: + lookupPolicy: + local: false +parameters: +- description: The name for the application. + displayName: Application Name + name: APPLICATION_NAME + required: true + value: mssql-server +- description: The OpenShift project name that is hosting the image registry. + displayName: Image Registry Project Name + name: IMAGE_REGISTRY_PROJECT_NAME + required: true +- description: The template name. + displayName: Template Name + name: TEMPLATE_NAME + required: true + value: mssql-server-deploy-template \ No newline at end of file diff --git a/deploy/aro/openshift-templates/infrastructure/rabbitmq-image-deploy-template.yml b/deploy/aro/openshift-templates/infrastructure/rabbitmq-deploy-template.yml similarity index 96% rename from deploy/aro/openshift-templates/infrastructure/rabbitmq-image-deploy-template.yml rename to deploy/aro/openshift-templates/infrastructure/rabbitmq-deploy-template.yml index df5877836..067f06740 100644 --- a/deploy/aro/openshift-templates/infrastructure/rabbitmq-image-deploy-template.yml +++ b/deploy/aro/openshift-templates/infrastructure/rabbitmq-deploy-template.yml @@ -34,7 +34,7 @@ objects: deploymentconfig: ${APPLICATION_NAME} spec: containers: - - image: ${APPLICATION_NAME}:latest + - image: ${APPLICATION_NAME}:3-management-alpine imagePullPolicy: IfNotPresent name: ${APPLICATION_NAME} ports: @@ -113,8 +113,6 @@ objects: deploymentconfig: ${APPLICATION_NAME} sessionAffinity: None type: ClusterIP - status: - loadBalancer: {} - apiVersion: image.openshift.io/v1 kind: ImageStream metadata: @@ -139,4 +137,4 @@ parameters: displayName: Template Name name: TEMPLATE_NAME required: true - value: rabbitmq-image-deploy-template \ No newline at end of file + value: rabbitmq-deploy-template \ No newline at end of file diff --git a/deploy/aro/openshift-templates/infrastructure/redis-deploy-template.yml b/deploy/aro/openshift-templates/infrastructure/redis-deploy-template.yml new file mode 100644 index 000000000..2cc27b75a --- /dev/null +++ b/deploy/aro/openshift-templates/infrastructure/redis-deploy-template.yml @@ -0,0 +1,109 @@ +apiVersion: template.openshift.io/v1 +kind: Template +metadata: + name: ${TEMPLATE_NAME} +objects: +- apiVersion: apps.openshift.io/v1 + kind: DeploymentConfig + metadata: + labels: + app: ${APPLICATION_NAME} + template: ${TEMPLATE_NAME} + name: ${APPLICATION_NAME} + spec: + replicas: 1 + revisionHistoryLimit: 10 + selector: + app: ${APPLICATION_NAME} + deploymentconfig: ${APPLICATION_NAME} + strategy: + activeDeadlineSeconds: 21600 + resources: {} + rollingParams: + intervalSeconds: 1 + maxSurge: 25% + maxUnavailable: 25% + timeoutSeconds: 600 + updatePeriodSeconds: 1 + type: Rolling + template: + metadata: + labels: + app: ${APPLICATION_NAME} + deploymentconfig: ${APPLICATION_NAME} + spec: + containers: + - image: ${APPLICATION_NAME}:latest + imagePullPolicy: IfNotPresent + name: ${APPLICATION_NAME} + ports: + - containerPort: 6379 + protocol: TCP + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /data + name: ${APPLICATION_NAME}-volume-1 + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 + volumes: + - emptyDir: {} + name: ${APPLICATION_NAME}-volume-1 + triggers: + - type: ConfigChange + - imageChangeParams: + automatic: true + containerNames: + - ${APPLICATION_NAME} + from: + kind: ImageStreamTag + name: '${APPLICATION_NAME}:alpine' + namespace: ${IMAGE_REGISTRY_PROJECT_NAME} + type: ImageChange +- apiVersion: v1 + kind: Service + metadata: + labels: + app: ${APPLICATION_NAME} + template: ${TEMPLATE_NAME} + name: ${APPLICATION_NAME} + spec: + ports: + - name: 6379-tcp + port: 6379 + protocol: TCP + targetPort: 6379 + selector: + app: ${APPLICATION_NAME} + deploymentconfig: ${APPLICATION_NAME} + sessionAffinity: None + type: ClusterIP +- apiVersion: image.openshift.io/v1 + kind: ImageStream + metadata: + labels: + app: ${APPLICATION_NAME} + template: ${TEMPLATE_NAME} + name: ${APPLICATION_NAME} + spec: + lookupPolicy: + local: false +parameters: +- description: The name for the application. + displayName: Application Name + name: APPLICATION_NAME + required: true + value: redis +- description: The OpenShift project name that is hosting the image registry. + displayName: Image Registry Project Name + name: IMAGE_REGISTRY_PROJECT_NAME + required: true +- description: The template name. + displayName: Template Name + name: TEMPLATE_NAME + required: true + value: redis-deploy-template \ No newline at end of file diff --git a/deploy/aro/openshift-templates/infrastructure/secrets-deploy-template.yml b/deploy/aro/openshift-templates/infrastructure/secrets-deploy-template.yml index b1176f060..bc67b193c 100644 --- a/deploy/aro/openshift-templates/infrastructure/secrets-deploy-template.yml +++ b/deploy/aro/openshift-templates/infrastructure/secrets-deploy-template.yml @@ -34,7 +34,7 @@ objects: - apiVersion: v1 kind: Secret stringData : - ConnectionString: ${SQL_PASSWORD_SECRET} + SA_PASSWORD: ${SQL_PASSWORD_SECRET} metadata: name: sa-password-secret type: Opaque diff --git a/deploy/aro/openshift-templates/infrastructure/seq-deploy-template.yml b/deploy/aro/openshift-templates/infrastructure/seq-deploy-template.yml new file mode 100644 index 000000000..d10683a1e --- /dev/null +++ b/deploy/aro/openshift-templates/infrastructure/seq-deploy-template.yml @@ -0,0 +1,121 @@ +apiVersion: template.openshift.io/v1 +kind: Template +metadata: + name: ${TEMPLATE_NAME} +objects: +- apiVersion: apps.openshift.io/v1 + kind: DeploymentConfig + metadata: + labels: + app: ${APPLICATION_NAME} + template: ${TEMPLATE_NAME} + name: ${APPLICATION_NAME} + spec: + replicas: 1 + revisionHistoryLimit: 10 + selector: + app: ${APPLICATION_NAME} + deploymentconfig: ${APPLICATION_NAME} + strategy: + activeDeadlineSeconds: 21600 + resources: {} + rollingParams: + intervalSeconds: 1 + maxSurge: 25% + maxUnavailable: 25% + timeoutSeconds: 600 + updatePeriodSeconds: 1 + type: Rolling + template: + metadata: + labels: + app: ${APPLICATION_NAME} + deploymentconfig: ${APPLICATION_NAME} + spec: + containers: + - env: + - name: ACCEPT_EULA + value: 'Y' + image: datalust/${APPLICATION_NAME}:latest + imagePullPolicy: Always + name: ${APPLICATION_NAME} + ports: + - containerPort: 80 + protocol: TCP + - containerPort: 5341 + protocol: TCP + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 + triggers: + - type: ConfigChange + - imageChangeParams: + automatic: true + containerNames: + - ${APPLICATION_NAME} + from: + kind: ImageStreamTag + name: '${APPLICATION_NAME}:latest' + namespace: ${IMAGE_REGISTRY_PROJECT_NAME} + lastTriggeredImage: datalust/${APPLICATION_NAME}:latest + type: ImageChange +- apiVersion: v1 + kind: Service + metadata: + labels: + app: ${APPLICATION_NAME} + template: ${TEMPLATE_NAME} + name: ${APPLICATION_NAME} + spec: + ports: + - name: 80-tcp + port: 80 + protocol: TCP + targetPort: 80 + - name: 5341-tcp + port: 5341 + protocol: TCP + targetPort: 5341 + selector: + app: ${APPLICATION_NAME} + deploymentconfig: ${APPLICATION_NAME} + sessionAffinity: None + type: ClusterIP +- apiVersion: image.openshift.io/v1 + kind: ImageStream + metadata: + labels: + app: ${APPLICATION_NAME} + template: ${TEMPLATE_NAME} + name: ${APPLICATION_NAME} + spec: + lookupPolicy: + local: false + tags: + - from: + kind: DockerImage + name: 'datalust/${APPLICATION_NAME}:latest' + importPolicy: {} + name: latest + referencePolicy: + type: Source +parameters: +- description: The name for the application. + displayName: Application Name + name: APPLICATION_NAME + required: true + value: seq +- description: The OpenShift project name that is hosting the image registry. + displayName: Image Registry Project Name + name: IMAGE_REGISTRY_PROJECT_NAME + required: true +- description: The template name. + displayName: Template Name + name: TEMPLATE_NAME + required: true + value: seq-deploy-template \ No newline at end of file diff --git a/deploy/aro/openshift-templates/webapp-deploy-template.yml b/deploy/aro/openshift-templates/webapp-deploy-template.yml index cfda9d09c..0514db5b8 100644 --- a/deploy/aro/openshift-templates/webapp-deploy-template.yml +++ b/deploy/aro/openshift-templates/webapp-deploy-template.yml @@ -83,4 +83,4 @@ parameters: displayName: Template Name name: TEMPLATE_NAME required: true - value: webapp-template + value: webapp-deploy-template