From 01ef3b52cb76d3a995c7afd682744292c4197381 Mon Sep 17 00:00:00 2001 From: Elliot Schlegelmilch Date: Fri, 8 Mar 2019 11:49:35 -0800 Subject: [PATCH 01/15] prototype adding pod priority to templates. --- .../openshift-templates/cli-persistent/deployment.yml | 3 +++ .../openshift-templates/cli/deployment.yml | 3 +++ .../openshift-templates/mariadb-single/deployment.yml | 4 ++++ .../openshift-templates/mariadb-single/services.yml | 5 ++++- .../openshift-templates/nginx-php-persistent/deployment.yml | 5 +++++ .../openshift-templates/nginx-php-persistent/routes.yml | 3 +++ .../openshift-templates/nginx-php-persistent/services.yml | 3 +++ .../openshift-templates/nginx/deployment.yml | 6 ++++++ .../openshift-templates/nginx/services.yml | 3 +++ .../openshift-templates/solr/deployment.yml | 4 ++++ .../openshift-templates/solr/services.yml | 3 +++ .../openshift-templates/varnish/deployment.yml | 4 ++++ .../openshift-templates/varnish/services.yml | 3 +++ 13 files changed, 48 insertions(+), 1 deletion(-) diff --git a/images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.yml index b8145f56e8..8d20596945 100644 --- a/images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.yml @@ -54,6 +54,9 @@ parameters: - name: CRONJOBS description: Oneliner of Cronjobs value: '' + - name: ENVIRONMENT_TYPE + description: production level of this environment + value: development objects: - apiVersion: v1 kind: DeploymentConfig diff --git a/images/oc-build-deploy-dind/openshift-templates/cli/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/cli/deployment.yml index 8ed12a6b15..6773b9db5f 100644 --- a/images/oc-build-deploy-dind/openshift-templates/cli/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/cli/deployment.yml @@ -40,6 +40,9 @@ parameters: - name: CRONJOBS description: Oneliner of Cronjobs value: '' + - name: ENVIRONMENT_TYPE + description: production level of this environment + value: development objects: - apiVersion: v1 kind: DeploymentConfig diff --git a/images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.yml index d1d40b0e6b..74cde6ab88 100644 --- a/images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.yml @@ -43,6 +43,9 @@ parameters: - name: PERSISTENT_STORAGE_SIZE description: Size of the Storage to request value: "5Gi" + - name: ENVIRONMENT_TYPE + description: production level of this environment + value: development objects: - apiVersion: v1 kind: DeploymentConfig @@ -77,6 +80,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} ports: - containerPort: 3306 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/mariadb-single/services.yml b/images/oc-build-deploy-dind/openshift-templates/mariadb-single/services.yml index 93655ce1ee..a72ea7872b 100644 --- a/images/oc-build-deploy-dind/openshift-templates/mariadb-single/services.yml +++ b/images/oc-build-deploy-dind/openshift-templates/mariadb-single/services.yml @@ -31,6 +31,9 @@ parameters: - name: REGISTRY description: Registry where Images are pushed to required: true + - name: ENVIRONMENT_TYPE + description: production level of this environment + value: development objects: - apiVersion: v1 kind: Service @@ -50,4 +53,4 @@ objects: selector: service: ${SERVICE_NAME} status: - loadBalancer: {} \ No newline at end of file + loadBalancer: {} diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.yml index 2cdac1f3c3..cd2d18480b 100644 --- a/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.yml @@ -58,6 +58,9 @@ parameters: - name: CRONJOBS description: Oneliner of Cronjobs value: '' + - name: ENVIRONMENT_TYPE + description: production level of this environment + value: development objects: - apiVersion: v1 kind: DeploymentConfig @@ -95,9 +98,11 @@ objects: - name: ${SERVICE_NAME} persistentVolumeClaim: claimName: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} containers: - image: ${NGINX_SERVICE_IMAGE} name: ${NGINX_SERVICE_NAME} + ports: - containerPort: 8080 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/routes.yml b/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/routes.yml index 0ad637c3b7..2787a8ca07 100644 --- a/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/routes.yml +++ b/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/routes.yml @@ -34,6 +34,9 @@ parameters: - name: ROUTES_INSECURE description: Setting of insecure Routes value: Allow + - name: ENVIRONMENT_TYPE + description: production level of this environment + value: development objects: - apiVersion: v1 kind: Route diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/services.yml b/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/services.yml index 1c6e15aefa..827ead533d 100644 --- a/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/services.yml +++ b/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/services.yml @@ -31,6 +31,9 @@ parameters: - name: REGISTRY description: Registry where Images are pushed to required: true + - name: ENVIRONMENT_TYPE + description: production level of this environment + value: development objects: - apiVersion: v1 kind: Service diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.yml index 2f59accfe8..18422dea6d 100644 --- a/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.yml @@ -40,6 +40,9 @@ parameters: - name: CRONJOBS description: Oneliner of Cronjobs value: '' + - name: ENVIRONMENT_TYPE + description: production level of this environment + value: development objects: - apiVersion: v1 kind: DeploymentConfig @@ -51,6 +54,7 @@ objects: project: ${SAFE_PROJECT} name: ${SERVICE_NAME} spec: + replicas: 1 selector: service: ${SERVICE_NAME} @@ -64,6 +68,7 @@ objects: branch: ${SAFE_BRANCH} project: ${SAFE_PROJECT} spec: + priorityClassName: priority-${ENVIRONMENT_TYPE} tolerations: - effect: NoSchedule key: autoscaled @@ -76,6 +81,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} ports: - containerPort: 8080 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx/services.yml b/images/oc-build-deploy-dind/openshift-templates/nginx/services.yml index 2bc22f528b..acc482a74a 100644 --- a/images/oc-build-deploy-dind/openshift-templates/nginx/services.yml +++ b/images/oc-build-deploy-dind/openshift-templates/nginx/services.yml @@ -31,6 +31,9 @@ parameters: - name: REGISTRY description: Registry where Images are pushed to required: true + - name: ENVIRONMENT_TYPE + description: production level of this environment + value: development objects: - apiVersion: v1 kind: Service diff --git a/images/oc-build-deploy-dind/openshift-templates/solr/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/solr/deployment.yml index 70c114d71c..69df2d5236 100644 --- a/images/oc-build-deploy-dind/openshift-templates/solr/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/solr/deployment.yml @@ -43,6 +43,9 @@ parameters: - name: PERSISTENT_STORAGE_SIZE description: Size of the Storage to request value: "1Gi" + - name: ENVIRONMENT_TYPE + description: production level of this environment + value: development objects: - apiVersion: v1 kind: DeploymentConfig @@ -77,6 +80,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} ports: - containerPort: 8149 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/solr/services.yml b/images/oc-build-deploy-dind/openshift-templates/solr/services.yml index 378933189b..c7288d6e83 100644 --- a/images/oc-build-deploy-dind/openshift-templates/solr/services.yml +++ b/images/oc-build-deploy-dind/openshift-templates/solr/services.yml @@ -31,6 +31,9 @@ parameters: - name: REGISTRY description: Registry where Images are pushed to required: true + - name: ENVIRONMENT_TYPE + description: production level of this environment + value: development objects: - apiVersion: v1 kind: Service diff --git a/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.yml index b8bfeaecf8..4ac93119b8 100644 --- a/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.yml @@ -40,6 +40,9 @@ parameters: - name: CRONJOBS description: Oneliner of Cronjobs value: '' + - name: ENVIRONMENT_TYPE + description: production level of this environment + value: development objects: - apiVersion: v1 kind: DeploymentConfig @@ -73,6 +76,7 @@ objects: key: appuio.ch/autoscaled operator: Equal value: 'true' + priorityClassName: priority-${ENVIRONMENT_TYPE} containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} diff --git a/images/oc-build-deploy-dind/openshift-templates/varnish/services.yml b/images/oc-build-deploy-dind/openshift-templates/varnish/services.yml index 333aa1e33b..44c41b5eff 100644 --- a/images/oc-build-deploy-dind/openshift-templates/varnish/services.yml +++ b/images/oc-build-deploy-dind/openshift-templates/varnish/services.yml @@ -31,6 +31,9 @@ parameters: - name: REGISTRY description: Registry where Images are pushed to required: true + - name: ENVIRONMENT_TYPE + description: production level of this environment + value: development objects: - apiVersion: v1 kind: Service From 6694680eb3566705a9a7c184abdb768ee084173a Mon Sep 17 00:00:00 2001 From: Elliot Schlegelmilch Date: Fri, 8 Mar 2019 11:50:13 -0800 Subject: [PATCH 02/15] hack to selectivly add parameter to oc process. --- images/oc-build-deploy-dind/scripts/exec-openshift-resources.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/images/oc-build-deploy-dind/scripts/exec-openshift-resources.sh b/images/oc-build-deploy-dind/scripts/exec-openshift-resources.sh index 258fb0bce2..a046116d6e 100755 --- a/images/oc-build-deploy-dind/scripts/exec-openshift-resources.sh +++ b/images/oc-build-deploy-dind/scripts/exec-openshift-resources.sh @@ -14,6 +14,7 @@ oc process --local -o yaml --insecure-skip-tls-verify \ -p SAFE_PROJECT="${SAFE_PROJECT}" \ -p BRANCH="${BRANCH}" \ -p PROJECT="${PROJECT}" \ + $(grep -q -s ENVIRONMENT_TYPE ${OPENSHIFT_TEMPLATE} && echo -p ENVIRONMENT_TYPE="${ENVIRONMENT_TYPE}" ) \ -p LAGOON_GIT_SHA="${LAGOON_GIT_SHA}" \ -p SERVICE_ROUTER_URL="${SERVICE_ROUTER_URL}" \ -p REGISTRY="${OPENSHIFT_REGISTRY}" \ From 502aae94642f5d93da95ef5de920651f228ed939 Mon Sep 17 00:00:00 2001 From: Elliot Schlegelmilch Date: Mon, 18 Mar 2019 10:11:23 -0700 Subject: [PATCH 03/15] remove default. --- .../openshift-templates/cli-persistent/deployment.yml | 1 - .../oc-build-deploy-dind/openshift-templates/cli/deployment.yml | 1 - images/oc-build-deploy-dind/openshift-templates/configmap.yml | 1 - .../openshift-templates/mariadb-single/deployment.yml | 1 - .../openshift-templates/mariadb-single/services.yml | 1 - .../openshift-templates/nginx-php-persistent/deployment.yml | 1 - .../openshift-templates/nginx-php-persistent/routes.yml | 1 - .../openshift-templates/nginx-php-persistent/services.yml | 1 - .../openshift-templates/nginx/deployment.yml | 1 - .../oc-build-deploy-dind/openshift-templates/nginx/services.yml | 1 - .../oc-build-deploy-dind/openshift-templates/solr/deployment.yml | 1 - .../oc-build-deploy-dind/openshift-templates/solr/services.yml | 1 - .../openshift-templates/varnish/deployment.yml | 1 - .../openshift-templates/varnish/services.yml | 1 - 14 files changed, 14 deletions(-) diff --git a/images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.yml index 8d20596945..a6b23aafbf 100644 --- a/images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.yml @@ -56,7 +56,6 @@ parameters: value: '' - name: ENVIRONMENT_TYPE description: production level of this environment - value: development objects: - apiVersion: v1 kind: DeploymentConfig diff --git a/images/oc-build-deploy-dind/openshift-templates/cli/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/cli/deployment.yml index 6773b9db5f..e5573c27fd 100644 --- a/images/oc-build-deploy-dind/openshift-templates/cli/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/cli/deployment.yml @@ -42,7 +42,6 @@ parameters: value: '' - name: ENVIRONMENT_TYPE description: production level of this environment - value: development objects: - apiVersion: v1 kind: DeploymentConfig diff --git a/images/oc-build-deploy-dind/openshift-templates/configmap.yml b/images/oc-build-deploy-dind/openshift-templates/configmap.yml index 7bbf6c3def..355cd35eba 100644 --- a/images/oc-build-deploy-dind/openshift-templates/configmap.yml +++ b/images/oc-build-deploy-dind/openshift-templates/configmap.yml @@ -24,7 +24,6 @@ parameters: value: "" - name: ENVIRONMENT_TYPE description: Which environment type this project is - value: development - name: ROUTE description: The main route of this project value: "" diff --git a/images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.yml index 74cde6ab88..8ce85632d0 100644 --- a/images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.yml @@ -45,7 +45,6 @@ parameters: value: "5Gi" - name: ENVIRONMENT_TYPE description: production level of this environment - value: development objects: - apiVersion: v1 kind: DeploymentConfig diff --git a/images/oc-build-deploy-dind/openshift-templates/mariadb-single/services.yml b/images/oc-build-deploy-dind/openshift-templates/mariadb-single/services.yml index a72ea7872b..21597ddca1 100644 --- a/images/oc-build-deploy-dind/openshift-templates/mariadb-single/services.yml +++ b/images/oc-build-deploy-dind/openshift-templates/mariadb-single/services.yml @@ -33,7 +33,6 @@ parameters: required: true - name: ENVIRONMENT_TYPE description: production level of this environment - value: development objects: - apiVersion: v1 kind: Service diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.yml index cd2d18480b..52ddd436ff 100644 --- a/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.yml @@ -60,7 +60,6 @@ parameters: value: '' - name: ENVIRONMENT_TYPE description: production level of this environment - value: development objects: - apiVersion: v1 kind: DeploymentConfig diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/routes.yml b/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/routes.yml index 2787a8ca07..d1b0e69ce6 100644 --- a/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/routes.yml +++ b/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/routes.yml @@ -36,7 +36,6 @@ parameters: value: Allow - name: ENVIRONMENT_TYPE description: production level of this environment - value: development objects: - apiVersion: v1 kind: Route diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/services.yml b/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/services.yml index 827ead533d..cc91468e2c 100644 --- a/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/services.yml +++ b/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/services.yml @@ -33,7 +33,6 @@ parameters: required: true - name: ENVIRONMENT_TYPE description: production level of this environment - value: development objects: - apiVersion: v1 kind: Service diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.yml index 18422dea6d..6638b05729 100644 --- a/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.yml @@ -42,7 +42,6 @@ parameters: value: '' - name: ENVIRONMENT_TYPE description: production level of this environment - value: development objects: - apiVersion: v1 kind: DeploymentConfig diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx/services.yml b/images/oc-build-deploy-dind/openshift-templates/nginx/services.yml index acc482a74a..f8075c0b1b 100644 --- a/images/oc-build-deploy-dind/openshift-templates/nginx/services.yml +++ b/images/oc-build-deploy-dind/openshift-templates/nginx/services.yml @@ -33,7 +33,6 @@ parameters: required: true - name: ENVIRONMENT_TYPE description: production level of this environment - value: development objects: - apiVersion: v1 kind: Service diff --git a/images/oc-build-deploy-dind/openshift-templates/solr/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/solr/deployment.yml index 69df2d5236..3e0c04acfe 100644 --- a/images/oc-build-deploy-dind/openshift-templates/solr/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/solr/deployment.yml @@ -45,7 +45,6 @@ parameters: value: "1Gi" - name: ENVIRONMENT_TYPE description: production level of this environment - value: development objects: - apiVersion: v1 kind: DeploymentConfig diff --git a/images/oc-build-deploy-dind/openshift-templates/solr/services.yml b/images/oc-build-deploy-dind/openshift-templates/solr/services.yml index c7288d6e83..1702b739aa 100644 --- a/images/oc-build-deploy-dind/openshift-templates/solr/services.yml +++ b/images/oc-build-deploy-dind/openshift-templates/solr/services.yml @@ -33,7 +33,6 @@ parameters: required: true - name: ENVIRONMENT_TYPE description: production level of this environment - value: development objects: - apiVersion: v1 kind: Service diff --git a/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.yml index 4ac93119b8..ae48509182 100644 --- a/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.yml @@ -42,7 +42,6 @@ parameters: value: '' - name: ENVIRONMENT_TYPE description: production level of this environment - value: development objects: - apiVersion: v1 kind: DeploymentConfig diff --git a/images/oc-build-deploy-dind/openshift-templates/varnish/services.yml b/images/oc-build-deploy-dind/openshift-templates/varnish/services.yml index 44c41b5eff..f30c621663 100644 --- a/images/oc-build-deploy-dind/openshift-templates/varnish/services.yml +++ b/images/oc-build-deploy-dind/openshift-templates/varnish/services.yml @@ -33,7 +33,6 @@ parameters: required: true - name: ENVIRONMENT_TYPE description: production level of this environment - value: development objects: - apiVersion: v1 kind: Service From 4c53c78781f51b77b3d597aae3580d1e9e961363 Mon Sep 17 00:00:00 2001 From: Elliot Schlegelmilch Date: Mon, 25 Mar 2019 11:43:43 -0700 Subject: [PATCH 04/15] add priority classes to openshift setup to match existing templates. --- Makefile | 1 + openshift-setup/priorityclasses.yaml | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 openshift-setup/priorityclasses.yaml diff --git a/Makefile b/Makefile index 5166b83a1d..e6d147f969 100644 --- a/Makefile +++ b/Makefile @@ -704,6 +704,7 @@ openshift-lagoon-setup: oc -n lagoon policy add-role-to-user admin -z openshiftbuilddeploy; \ oc -n lagoon create -f openshift-setup/clusterrole-openshiftbuilddeploy.yaml; \ oc -n lagoon adm policy add-cluster-role-to-user openshiftbuilddeploy -z openshiftbuilddeploy; \ + oc -n lagoon create -f openshift-setup/priorityclasses.yaml; \ oc -n lagoon create -f openshift-setup/shared-resource-viewer.yaml; \ oc -n lagoon create -f openshift-setup/policybinding.yaml | oc -n lagoon create -f openshift-setup/rolebinding.yaml; \ oc -n lagoon create serviceaccount docker-host; \ diff --git a/openshift-setup/priorityclasses.yaml b/openshift-setup/priorityclasses.yaml new file mode 100644 index 0000000000..8aa34a9503 --- /dev/null +++ b/openshift-setup/priorityclasses.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: scheduling.k8s.io/v1beta1 +kind: PriorityClass +metadata: + name: priority-development +value: 1000000 +globalDefault: false +description: "This priority class should be used for production environments." +--- +apiVersion: scheduling.k8s.io/v1beta1 +kind: PriorityClass +metadata: + name: priority-development +value: 10000 +globalDefault: true +description: "This priority class should be used for development environments." From 26ea75261e14fd262acc9570cc4c238119911939 Mon Sep 17 00:00:00 2001 From: Elliot Schlegelmilch Date: Tue, 26 Mar 2019 10:30:10 -0700 Subject: [PATCH 05/15] update varnish template. --- .../openshift-templates/varnish/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.yml index ae48509182..6b886565fc 100644 --- a/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.yml @@ -75,10 +75,10 @@ objects: key: appuio.ch/autoscaled operator: Equal value: 'true' - priorityClassName: priority-${ENVIRONMENT_TYPE} containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} ports: - containerPort: 8080 protocol: TCP From 9066860eed4ade846499d32b2f284e523ec0ab21 Mon Sep 17 00:00:00 2001 From: Elliot Schlegelmilch Date: Tue, 26 Mar 2019 17:01:08 -0700 Subject: [PATCH 06/15] add priorityClassName to other deployment templates. --- .../openshift-templates/cli-persistent/deployment.yml | 1 + .../openshift-templates/cli/deployment.yml | 2 ++ .../openshift-templates/mariadb-single/deployment.yml | 1 + .../openshift-templates/mongo/deployment.yml | 4 ++++ .../openshift-templates/nginx-php-persistent/deployment.yml | 5 +++-- .../nginx-php-redis-persistent/deployment.yml | 4 ++++ .../openshift-templates/nginx-php/deployment.yml | 4 ++++ .../openshift-templates/nginx/deployment.yml | 1 + .../openshift-templates/node-persistent/deployment.yml | 4 ++++ .../openshift-templates/node/deployment.yml | 4 ++++ .../openshift-templates/postgres/deployment.yml | 4 ++++ .../openshift-templates/rabbitmq/deployment.yml | 4 ++++ .../openshift-templates/redis-persistent/deployment.yml | 4 ++++ .../openshift-templates/redis/deployment.yml | 4 ++++ .../openshift-templates/solr/deployment.yml | 1 + .../openshift-templates/varnish-persistent/deployment.yml | 4 ++++ .../openshift-templates/varnish/deployment.yml | 1 + 17 files changed, 50 insertions(+), 2 deletions(-) diff --git a/images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.yml index a6b23aafbf..d277d0cbea 100644 --- a/images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.yml @@ -103,6 +103,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} envFrom: - configMapRef: name: lagoon-env diff --git a/images/oc-build-deploy-dind/openshift-templates/cli/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/cli/deployment.yml index e5573c27fd..be15d61561 100644 --- a/images/oc-build-deploy-dind/openshift-templates/cli/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/cli/deployment.yml @@ -42,6 +42,7 @@ parameters: value: '' - name: ENVIRONMENT_TYPE description: production level of this environment + required: true objects: - apiVersion: v1 kind: DeploymentConfig @@ -86,6 +87,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} envFrom: - configMapRef: name: lagoon-env diff --git a/images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.yml index 8ce85632d0..177d14f150 100644 --- a/images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.yml @@ -45,6 +45,7 @@ parameters: value: "5Gi" - name: ENVIRONMENT_TYPE description: production level of this environment + required: true objects: - apiVersion: v1 kind: DeploymentConfig diff --git a/images/oc-build-deploy-dind/openshift-templates/mongo/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/mongo/deployment.yml index 8f06649e16..6ab0a75767 100644 --- a/images/oc-build-deploy-dind/openshift-templates/mongo/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/mongo/deployment.yml @@ -40,6 +40,9 @@ parameters: - name: CRONJOBS description: Oneliner of Cronjobs value: "" + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true objects: - apiVersion: v1 kind: DeploymentConfig @@ -72,6 +75,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} ports: - containerPort: 27017 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.yml index 52ddd436ff..be472523f8 100644 --- a/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.yml @@ -60,6 +60,7 @@ parameters: value: '' - name: ENVIRONMENT_TYPE description: production level of this environment + required: true objects: - apiVersion: v1 kind: DeploymentConfig @@ -97,11 +98,10 @@ objects: - name: ${SERVICE_NAME} persistentVolumeClaim: claimName: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} containers: - image: ${NGINX_SERVICE_IMAGE} name: ${NGINX_SERVICE_NAME} - + priorityClassName: priority-${ENVIRONMENT_TYPE} ports: - containerPort: 8080 protocol: TCP @@ -137,6 +137,7 @@ objects: memory: 10Mi - image: ${PHP_SERVICE_IMAGE} name: ${PHP_SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} ports: - containerPort: 9000 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx-php-redis-persistent/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/nginx-php-redis-persistent/deployment.yml index 057b14ef80..584e7a2832 100644 --- a/images/oc-build-deploy-dind/openshift-templates/nginx-php-redis-persistent/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/nginx-php-redis-persistent/deployment.yml @@ -64,6 +64,9 @@ parameters: - name: CRONJOBS description: Oneliner of Cronjobs value: '' + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true objects: - apiVersion: v1 kind: DeploymentConfig @@ -104,6 +107,7 @@ objects: containers: - image: ${NGINX_SERVICE_IMAGE} name: ${NGINX_SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} ports: - containerPort: 8080 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx-php/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/nginx-php/deployment.yml index cef039fe32..8b1a685d42 100644 --- a/images/oc-build-deploy-dind/openshift-templates/nginx-php/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/nginx-php/deployment.yml @@ -49,6 +49,9 @@ parameters: - name: CRONJOBS description: Oneliner of Cronjobs value: '' + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true objects: - apiVersion: v1 kind: DeploymentConfig @@ -85,6 +88,7 @@ objects: containers: - image: ${NGINX_SERVICE_IMAGE} name: ${NGINX_SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} ports: - containerPort: 8080 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.yml index 6638b05729..0a843cb8ce 100644 --- a/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.yml @@ -42,6 +42,7 @@ parameters: value: '' - name: ENVIRONMENT_TYPE description: production level of this environment + required: true objects: - apiVersion: v1 kind: DeploymentConfig diff --git a/images/oc-build-deploy-dind/openshift-templates/node-persistent/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/node-persistent/deployment.yml index 36d4f4991b..0ecde97c80 100644 --- a/images/oc-build-deploy-dind/openshift-templates/node-persistent/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/node-persistent/deployment.yml @@ -49,6 +49,9 @@ parameters: - name: CRONJOBS description: Oneliner of Cronjobs value: '' + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true objects: - apiVersion: v1 kind: DeploymentConfig @@ -92,6 +95,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} ports: - containerPort: 3000 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/node/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/node/deployment.yml index 35cb21ea82..1cc596e322 100644 --- a/images/oc-build-deploy-dind/openshift-templates/node/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/node/deployment.yml @@ -40,6 +40,9 @@ parameters: - name: CRONJOBS description: Oneliner of Cronjobs value: '' + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true objects: - apiVersion: v1 kind: DeploymentConfig @@ -76,6 +79,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} ports: - containerPort: 3000 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/postgres/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/postgres/deployment.yml index ac0df467a9..b68adc423f 100644 --- a/images/oc-build-deploy-dind/openshift-templates/postgres/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/postgres/deployment.yml @@ -40,6 +40,9 @@ parameters: - name: CRONJOBS description: Oneliner of Cronjobs value: "" + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true objects: - apiVersion: v1 kind: DeploymentConfig @@ -71,6 +74,7 @@ objects: containers: - image: ${POSTGRES_SERVICE_IMAGE} name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} ports: - containerPort: 5432 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/rabbitmq/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/rabbitmq/deployment.yml index 66f46f2b94..9da67df087 100644 --- a/images/oc-build-deploy-dind/openshift-templates/rabbitmq/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/rabbitmq/deployment.yml @@ -40,6 +40,9 @@ parameters: - name: CRONJOBS description: Oneliner of Cronjobs value: "" + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true objects: - apiVersion: v1 kind: DeploymentConfig @@ -66,6 +69,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} ports: - containerPort: 15672 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/redis-persistent/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/redis-persistent/deployment.yml index ddf634ec07..3825418fef 100644 --- a/images/oc-build-deploy-dind/openshift-templates/redis-persistent/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/redis-persistent/deployment.yml @@ -49,6 +49,9 @@ parameters: - name: PERSISTENT_STORAGE_SIZE description: Size of the Storage to request value: "1Gi" + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true objects: - apiVersion: v1 kind: DeploymentConfig @@ -83,6 +86,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} ports: - containerPort: 6379 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/redis/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/redis/deployment.yml index 3f3130464f..515b272c2a 100644 --- a/images/oc-build-deploy-dind/openshift-templates/redis/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/redis/deployment.yml @@ -40,6 +40,9 @@ parameters: - name: CRONJOBS description: Oneliner of Cronjobs value: "" + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true objects: - apiVersion: v1 kind: DeploymentConfig @@ -67,6 +70,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} ports: - containerPort: 6379 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/solr/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/solr/deployment.yml index 3e0c04acfe..0eb8db2545 100644 --- a/images/oc-build-deploy-dind/openshift-templates/solr/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/solr/deployment.yml @@ -45,6 +45,7 @@ parameters: value: "1Gi" - name: ENVIRONMENT_TYPE description: production level of this environment + required: true objects: - apiVersion: v1 kind: DeploymentConfig diff --git a/images/oc-build-deploy-dind/openshift-templates/varnish-persistent/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/varnish-persistent/deployment.yml index 1062c84506..28e634a17a 100644 --- a/images/oc-build-deploy-dind/openshift-templates/varnish-persistent/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/varnish-persistent/deployment.yml @@ -40,6 +40,9 @@ parameters: - name: CRONJOBS description: Oneliner of Cronjobs value: '' + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true objects: - apiVersion: v1 kind: DeploymentConfig @@ -80,6 +83,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} ports: - containerPort: 8080 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.yml index 6b886565fc..d04a0b632b 100644 --- a/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.yml @@ -42,6 +42,7 @@ parameters: value: '' - name: ENVIRONMENT_TYPE description: production level of this environment + required: true objects: - apiVersion: v1 kind: DeploymentConfig From cf26f7fc0dddb1f31d82ad7b597fa78a5aaad838 Mon Sep 17 00:00:00 2001 From: Elliot Schlegelmilch Date: Tue, 26 Mar 2019 17:03:09 -0700 Subject: [PATCH 07/15] remove parameter from unused instances. --- .../openshift-templates/mariadb-single/services.yml | 2 -- .../openshift-templates/nginx-php-persistent/services.yml | 2 -- .../oc-build-deploy-dind/openshift-templates/nginx/services.yml | 2 -- .../oc-build-deploy-dind/openshift-templates/solr/services.yml | 2 -- .../openshift-templates/varnish/services.yml | 2 -- 5 files changed, 10 deletions(-) diff --git a/images/oc-build-deploy-dind/openshift-templates/mariadb-single/services.yml b/images/oc-build-deploy-dind/openshift-templates/mariadb-single/services.yml index 21597ddca1..68229e21b4 100644 --- a/images/oc-build-deploy-dind/openshift-templates/mariadb-single/services.yml +++ b/images/oc-build-deploy-dind/openshift-templates/mariadb-single/services.yml @@ -31,8 +31,6 @@ parameters: - name: REGISTRY description: Registry where Images are pushed to required: true - - name: ENVIRONMENT_TYPE - description: production level of this environment objects: - apiVersion: v1 kind: Service diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/services.yml b/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/services.yml index cc91468e2c..1c6e15aefa 100644 --- a/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/services.yml +++ b/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/services.yml @@ -31,8 +31,6 @@ parameters: - name: REGISTRY description: Registry where Images are pushed to required: true - - name: ENVIRONMENT_TYPE - description: production level of this environment objects: - apiVersion: v1 kind: Service diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx/services.yml b/images/oc-build-deploy-dind/openshift-templates/nginx/services.yml index f8075c0b1b..2bc22f528b 100644 --- a/images/oc-build-deploy-dind/openshift-templates/nginx/services.yml +++ b/images/oc-build-deploy-dind/openshift-templates/nginx/services.yml @@ -31,8 +31,6 @@ parameters: - name: REGISTRY description: Registry where Images are pushed to required: true - - name: ENVIRONMENT_TYPE - description: production level of this environment objects: - apiVersion: v1 kind: Service diff --git a/images/oc-build-deploy-dind/openshift-templates/solr/services.yml b/images/oc-build-deploy-dind/openshift-templates/solr/services.yml index 1702b739aa..378933189b 100644 --- a/images/oc-build-deploy-dind/openshift-templates/solr/services.yml +++ b/images/oc-build-deploy-dind/openshift-templates/solr/services.yml @@ -31,8 +31,6 @@ parameters: - name: REGISTRY description: Registry where Images are pushed to required: true - - name: ENVIRONMENT_TYPE - description: production level of this environment objects: - apiVersion: v1 kind: Service diff --git a/images/oc-build-deploy-dind/openshift-templates/varnish/services.yml b/images/oc-build-deploy-dind/openshift-templates/varnish/services.yml index f30c621663..333aa1e33b 100644 --- a/images/oc-build-deploy-dind/openshift-templates/varnish/services.yml +++ b/images/oc-build-deploy-dind/openshift-templates/varnish/services.yml @@ -31,8 +31,6 @@ parameters: - name: REGISTRY description: Registry where Images are pushed to required: true - - name: ENVIRONMENT_TYPE - description: production level of this environment objects: - apiVersion: v1 kind: Service From 18f49eedeaf2226588da8f93c0cab222015181f1 Mon Sep 17 00:00:00 2001 From: Elliot Schlegelmilch Date: Tue, 26 Mar 2019 17:17:11 -0700 Subject: [PATCH 08/15] update this to be a list. --- openshift-setup/priorityclasses.yaml | 33 ++++++++++++++-------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/openshift-setup/priorityclasses.yaml b/openshift-setup/priorityclasses.yaml index 8aa34a9503..6c0df9206c 100644 --- a/openshift-setup/priorityclasses.yaml +++ b/openshift-setup/priorityclasses.yaml @@ -1,16 +1,17 @@ ---- -apiVersion: scheduling.k8s.io/v1beta1 -kind: PriorityClass -metadata: - name: priority-development -value: 1000000 -globalDefault: false -description: "This priority class should be used for production environments." ---- -apiVersion: scheduling.k8s.io/v1beta1 -kind: PriorityClass -metadata: - name: priority-development -value: 10000 -globalDefault: true -description: "This priority class should be used for development environments." +apiVersion: v1 +kind: List +items: +- apiVersion: scheduling.k8s.io/v1beta1 + kind: PriorityClass + metadata: + name: priority-development + value: 1000000 + globalDefault: false + description: "This priority class should be used for production environments." +- apiVersion: scheduling.k8s.io/v1beta1 + kind: PriorityClass + metadata: + name: priority-development + value: 10000 + globalDefault: true + description: "This priority class should be used for development environments." From 1ec23d6552399c0f8250554e280d3f2179114cf8 Mon Sep 17 00:00:00 2001 From: Elliot Schlegelmilch Date: Wed, 27 Mar 2019 13:38:32 -0700 Subject: [PATCH 09/15] need this parameter in -with-images as well. --- .../scripts/exec-openshift-resources-with-images.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/images/oc-build-deploy-dind/scripts/exec-openshift-resources-with-images.sh b/images/oc-build-deploy-dind/scripts/exec-openshift-resources-with-images.sh index b2288f5694..da6e1a0b18 100755 --- a/images/oc-build-deploy-dind/scripts/exec-openshift-resources-with-images.sh +++ b/images/oc-build-deploy-dind/scripts/exec-openshift-resources-with-images.sh @@ -37,6 +37,7 @@ oc process --local -o yaml --insecure-skip-tls-verify \ -p SAFE_PROJECT="${SAFE_PROJECT}" \ -p BRANCH="${BRANCH}" \ -p PROJECT="${PROJECT}" \ + $(grep -q -s ENVIRONMENT_TYPE ${OPENSHIFT_TEMPLATE} && echo -p ENVIRONMENT_TYPE="${ENVIRONMENT_TYPE}" ) \ -p LAGOON_GIT_SHA="${LAGOON_GIT_SHA}" \ -p SERVICE_ROUTER_URL="${SERVICE_ROUTER_URL}" \ -p REGISTRY="${OPENSHIFT_REGISTRY}" \ From 876842be868eb8fd83b6807e4a5c5e54a6b8d47a Mon Sep 17 00:00:00 2001 From: Elliot Schlegelmilch Date: Wed, 27 Mar 2019 14:24:55 -0700 Subject: [PATCH 10/15] rename TEMPLATE_IMAGES_PARAMETERS to TEMPLATE_ADDITIONAL_PARAMETERS and add ENVIRONMENT_TYPE to it. --- .../scripts/exec-openshift-resources-with-images.sh | 13 ++++++++----- .../scripts/exec-openshift-resources.sh | 8 +++++++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/images/oc-build-deploy-dind/scripts/exec-openshift-resources-with-images.sh b/images/oc-build-deploy-dind/scripts/exec-openshift-resources-with-images.sh index da6e1a0b18..c6d25395a8 100755 --- a/images/oc-build-deploy-dind/scripts/exec-openshift-resources-with-images.sh +++ b/images/oc-build-deploy-dind/scripts/exec-openshift-resources-with-images.sh @@ -7,7 +7,7 @@ else fi # Inject Pullable Images into Template -TEMPLATE_IMAGES_PARAMETERS=() +TEMPLATE_ADDITIONAL_PARAMETERS=() # First check if we need multiple Images in this Template (check for `_SERVICE_IMAGE` - see underline) if [[ $(oc process --local -f ${OPENSHIFT_TEMPLATE} --parameters | grep _SERVICE_IMAGE) ]]; then while read line @@ -20,13 +20,17 @@ if [[ $(oc process --local -f ${OPENSHIFT_TEMPLATE} --parameters | grep _SERVICE # Load the Image Hash of the loaded Image DEPLOYMENT_SERVICETYPE_IMAGE_NAME_HASH="${IMAGE_HASHES[${DEPLOYMENT_SERVICETYPE_IMAGE_NAME}]}" # Add the Image Hash as Parameter of "[SERVICETYPE]_SERVICE_IMAGE" - TEMPLATE_IMAGES_PARAMETERS+=(-p "${line}=${DEPLOYMENT_SERVICETYPE_IMAGE_NAME_HASH}") + TEMPLATE_ADDITIONAL_PARAMETERS+=(-p "${line}=${DEPLOYMENT_SERVICETYPE_IMAGE_NAME_HASH}") done < <(oc process --local -f ${OPENSHIFT_TEMPLATE} --parameters | grep _SERVICE_IMAGE | awk '{ print $1 }') # check if we need a single image to inject elif [[ $(oc process --local -f ${OPENSHIFT_TEMPLATE} --parameters | grep SERVICE_IMAGE) ]]; then SERVICE_NAME_IMAGE="${MAP_SERVICE_NAME_TO_IMAGENAME[${SERVICE_NAME}]}" SERVICE_NAME_IMAGE_HASH="${IMAGE_HASHES[${SERVICE_NAME_IMAGE}]}" - TEMPLATE_IMAGES_PARAMETERS+=(-p "SERVICE_IMAGE=${SERVICE_NAME_IMAGE_HASH}") + TEMPLATE_ADDITIONAL_PARAMETERS+=(-p "SERVICE_IMAGE=${SERVICE_NAME_IMAGE_HASH}") +fi + +if [[ $(oc process --local -f ${OPENSHIFT_TEMPLATE} --parameters | grep ENVIRONMENT_TYPE) ]]; then + TEMPLATE_ADDITIONAL_PARAMETERS+=(-p "ENVIRONMENT_TYPE=${ENVIRONMENT_TYPE}") fi oc process --local -o yaml --insecure-skip-tls-verify \ @@ -37,11 +41,10 @@ oc process --local -o yaml --insecure-skip-tls-verify \ -p SAFE_PROJECT="${SAFE_PROJECT}" \ -p BRANCH="${BRANCH}" \ -p PROJECT="${PROJECT}" \ - $(grep -q -s ENVIRONMENT_TYPE ${OPENSHIFT_TEMPLATE} && echo -p ENVIRONMENT_TYPE="${ENVIRONMENT_TYPE}" ) \ -p LAGOON_GIT_SHA="${LAGOON_GIT_SHA}" \ -p SERVICE_ROUTER_URL="${SERVICE_ROUTER_URL}" \ -p REGISTRY="${OPENSHIFT_REGISTRY}" \ -p OPENSHIFT_PROJECT=${OPENSHIFT_PROJECT} \ "${TEMPLATE_PARAMETERS[@]}" \ - "${TEMPLATE_IMAGES_PARAMETERS[@]}" \ + "${TEMPLATE_ADDITIONAL_PARAMETERS[@]}" \ | outputToYaml diff --git a/images/oc-build-deploy-dind/scripts/exec-openshift-resources.sh b/images/oc-build-deploy-dind/scripts/exec-openshift-resources.sh index a046116d6e..93ea8af740 100755 --- a/images/oc-build-deploy-dind/scripts/exec-openshift-resources.sh +++ b/images/oc-build-deploy-dind/scripts/exec-openshift-resources.sh @@ -6,6 +6,12 @@ else SERVICE_ROUTER_URL="" fi +TEMPLATE_ADDITIONAL_PARAMETERS=() + +if [[ $(oc process --local -f ${OPENSHIFT_TEMPLATE} --parameters | grep ENVIRONMENT_TYPE) ]]; then + TEMPLATE_ADDITIONAL_PARAMETERS+=(-p "ENVIRONMENT_TYPE=${ENVIRONMENT_TYPE}") +fi + oc process --local -o yaml --insecure-skip-tls-verify \ -n ${OPENSHIFT_PROJECT} \ -f ${OPENSHIFT_TEMPLATE} \ @@ -14,10 +20,10 @@ oc process --local -o yaml --insecure-skip-tls-verify \ -p SAFE_PROJECT="${SAFE_PROJECT}" \ -p BRANCH="${BRANCH}" \ -p PROJECT="${PROJECT}" \ - $(grep -q -s ENVIRONMENT_TYPE ${OPENSHIFT_TEMPLATE} && echo -p ENVIRONMENT_TYPE="${ENVIRONMENT_TYPE}" ) \ -p LAGOON_GIT_SHA="${LAGOON_GIT_SHA}" \ -p SERVICE_ROUTER_URL="${SERVICE_ROUTER_URL}" \ -p REGISTRY="${OPENSHIFT_REGISTRY}" \ -p OPENSHIFT_PROJECT=${OPENSHIFT_PROJECT} \ "${TEMPLATE_PARAMETERS[@]}" \ + "${TEMPLATE_ADDITIONAL_PARAMETERS[@]}" \ | outputToYaml From 8e8ca77de3e33a09b69d8bbc91c8eede644f7543 Mon Sep 17 00:00:00 2001 From: Elliot Schlegelmilch Date: Thu, 28 Mar 2019 14:03:19 -0700 Subject: [PATCH 11/15] remove extraneous priority. --- .../openshift-templates/nginx/deployment.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.yml index 0a843cb8ce..e916b34f8a 100644 --- a/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.yml @@ -68,7 +68,6 @@ objects: branch: ${SAFE_BRANCH} project: ${SAFE_PROJECT} spec: - priorityClassName: priority-${ENVIRONMENT_TYPE} tolerations: - effect: NoSchedule key: autoscaled From 41b3c5dfc0d1b550c0820404377774927c31e9dc Mon Sep 17 00:00:00 2001 From: Elliot Schlegelmilch Date: Thu, 28 Mar 2019 14:04:11 -0700 Subject: [PATCH 12/15] correct c/p typo. add staging priority level. prefix priority levels. --- openshift-setup/priorityclasses.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/openshift-setup/priorityclasses.yaml b/openshift-setup/priorityclasses.yaml index 6c0df9206c..86a9790f0f 100644 --- a/openshift-setup/priorityclasses.yaml +++ b/openshift-setup/priorityclasses.yaml @@ -4,14 +4,21 @@ items: - apiVersion: scheduling.k8s.io/v1beta1 kind: PriorityClass metadata: - name: priority-development + name: lagoon-priority-production value: 1000000 globalDefault: false description: "This priority class should be used for production environments." - apiVersion: scheduling.k8s.io/v1beta1 kind: PriorityClass metadata: - name: priority-development + name: lagoon-priority-staging + value: 100000 + globalDefault: true + description: "This priority class should be used for staging environments." +- apiVersion: scheduling.k8s.io/v1beta1 + kind: PriorityClass + metadata: + name: lagoon-priority-development value: 10000 globalDefault: true description: "This priority class should be used for development environments." From 2e576f8496bc46f701d89b9caca5697b9b9109d6 Mon Sep 17 00:00:00 2001 From: Elliot Schlegelmilch Date: Thu, 28 Mar 2019 14:27:18 -0700 Subject: [PATCH 13/15] update template to reflect priority prefixes. --- .../cli-persistent/deployment.yml | 2 +- .../cli-persistent/deployment.ymlbak | 131 +++++++++++ .../openshift-templates/cli/deployment.yml | 2 +- .../openshift-templates/cli/deployment.ymlbak | 113 ++++++++++ .../openshift-templates/configmap.ymlbak | 55 +++++ .../mariadb-single/deployment.yml | 2 +- .../mariadb-single/deployment.ymlbak | 114 ++++++++++ .../openshift-templates/mongo/deployment.yml | 2 +- .../mongo/deployment.ymlbak | 104 +++++++++ .../nginx-php-persistent/deployment.yml | 4 +- .../nginx-php-persistent/deployment.ymlbak | 177 +++++++++++++++ .../nginx-php-redis-persistent/deployment.yml | 2 +- .../deployment.ymlbak | 211 ++++++++++++++++++ .../nginx-php/deployment.yml | 2 +- .../nginx-php/deployment.ymlbak | 158 +++++++++++++ .../openshift-templates/nginx/deployment.yml | 2 +- .../nginx/deployment.ymlbak | 119 ++++++++++ .../node-persistent/deployment.yml | 2 +- .../node-persistent/deployment.ymlbak | 133 +++++++++++ .../openshift-templates/node/deployment.yml | 2 +- .../node/deployment.ymlbak | 114 ++++++++++ .../postgres/deployment.yml | 2 +- .../postgres/deployment.ymlbak | 108 +++++++++ .../rabbitmq/deployment.yml | 2 +- .../rabbitmq/deployment.ymlbak | 107 +++++++++ .../redis-persistent/deployment.yml | 2 +- .../redis-persistent/deployment.ymlbak | 120 ++++++++++ .../openshift-templates/redis/deployment.yml | 2 +- .../redis/deployment.ymlbak | 101 +++++++++ .../openshift-templates/solr/deployment.yml | 2 +- .../solr/deployment.ymlbak | 117 ++++++++++ .../varnish-persistent/deployment.yml | 2 +- .../varnish-persistent/deployment.ymlbak | 120 ++++++++++ .../varnish/deployment.yml | 2 +- .../varnish/deployment.ymlbak | 113 ++++++++++ 35 files changed, 2233 insertions(+), 18 deletions(-) create mode 100644 images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.ymlbak create mode 100644 images/oc-build-deploy-dind/openshift-templates/cli/deployment.ymlbak create mode 100644 images/oc-build-deploy-dind/openshift-templates/configmap.ymlbak create mode 100644 images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.ymlbak create mode 100644 images/oc-build-deploy-dind/openshift-templates/mongo/deployment.ymlbak create mode 100644 images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.ymlbak create mode 100644 images/oc-build-deploy-dind/openshift-templates/nginx-php-redis-persistent/deployment.ymlbak create mode 100644 images/oc-build-deploy-dind/openshift-templates/nginx-php/deployment.ymlbak create mode 100644 images/oc-build-deploy-dind/openshift-templates/nginx/deployment.ymlbak create mode 100644 images/oc-build-deploy-dind/openshift-templates/node-persistent/deployment.ymlbak create mode 100644 images/oc-build-deploy-dind/openshift-templates/node/deployment.ymlbak create mode 100644 images/oc-build-deploy-dind/openshift-templates/postgres/deployment.ymlbak create mode 100644 images/oc-build-deploy-dind/openshift-templates/rabbitmq/deployment.ymlbak create mode 100644 images/oc-build-deploy-dind/openshift-templates/redis-persistent/deployment.ymlbak create mode 100644 images/oc-build-deploy-dind/openshift-templates/redis/deployment.ymlbak create mode 100644 images/oc-build-deploy-dind/openshift-templates/solr/deployment.ymlbak create mode 100644 images/oc-build-deploy-dind/openshift-templates/varnish-persistent/deployment.ymlbak create mode 100644 images/oc-build-deploy-dind/openshift-templates/varnish/deployment.ymlbak diff --git a/images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.yml index d277d0cbea..b2d93aa6d0 100644 --- a/images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.yml @@ -103,7 +103,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} + priorityClassName: lagoon-priority-${ENVIRONMENT_TYPE} envFrom: - configMapRef: name: lagoon-env diff --git a/images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.ymlbak new file mode 100644 index 0000000000..d277d0cbea --- /dev/null +++ b/images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.ymlbak @@ -0,0 +1,131 @@ +apiVersion: v1 +kind: Template +metadata: + creationTimestamp: null + name: lagoon-openshift-template-cli +parameters: + - name: SERVICE_NAME + description: Name of this service + required: true + - name: SAFE_BRANCH + description: Which branch this belongs to, special chars replaced with dashes + required: true + - name: SAFE_PROJECT + description: Which project this belongs to, special chars replaced with dashes + required: true + - name: BRANCH + description: Which branch this belongs to, original value + required: true + - name: PROJECT + description: Which project this belongs to, original value + required: true + - name: LAGOON_GIT_SHA + description: git hash sha of the current deployment + required: true + - name: SERVICE_ROUTER_URL + description: URL of the Router for this service + value: '' + - name: OPENSHIFT_PROJECT + description: Name of the Project that this service is in + required: true + - name: REGISTRY + description: Registry where Images are pushed to + required: true + - name: PERSISTENT_STORAGE_PATH + description: Full path to which should be mounted into persistent storage + required: true + - name: PERSISTENT_STORAGE_NAME + description: Name of the Persistent Volume Claim to use + required: true + # The following two parameters are actually not used anywhere in this YAML, but they are injected by oc-build-deploy + # and `oc process` fails if you inject a parameter that is not defined + - name: PERSISTENT_STORAGE_CLASS + description: Name of the Storage Class to use + value: '' + - name: PERSISTENT_STORAGE_SIZE + description: Size of the Storage to request + value: '5Gi' + - name: DEPLOYMENT_STRATEGY + description: Strategy of Deploymentconfig + value: 'Rolling' + - name: SERVICE_IMAGE + description: Pullable image of service + required: true + - name: CRONJOBS + description: Oneliner of Cronjobs + value: '' + - name: ENVIRONMENT_TYPE + description: production level of this environment +objects: + - apiVersion: v1 + kind: DeploymentConfig + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + name: ${SERVICE_NAME} + spec: + replicas: 1 + selector: + service: ${SERVICE_NAME} + strategy: + type: ${DEPLOYMENT_STRATEGY} + template: + metadata: + annotations: + appuio.ch/backupcommand: /bin/sh -c "if [[ $MARIADB_HOST ]]; then dump=$(mktemp) && mysqldump --max-allowed-packet=500M --events --routines --quick --add-locks --no-autocommit --single-transaction --no-create-db -h $MARIADB_HOST -u $MARIADB_USERNAME -p$MARIADB_PASSWORD $MARIADB_DATABASE > $dump && cat $dump && rm $dump; fi" + backup.appuio.ch/file-extension: .mysql.sql + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + spec: + tolerations: + - effect: NoSchedule + key: autoscaled + operator: Equal + value: 'true' + - effect: NoSchedule + key: appuio.ch/autoscaled + operator: Equal + value: 'true' + volumes: + - name: ${PERSISTENT_STORAGE_NAME} + persistentVolumeClaim: + claimName: ${PERSISTENT_STORAGE_NAME} + - name: lagoon-sshkey + secret: + defaultMode: 420 + secretName: lagoon-sshkey + containers: + - image: ${SERVICE_IMAGE} + name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} + envFrom: + - configMapRef: + name: lagoon-env + env: + ## LAGOON_GIT_SHA is injected directly and not loaded via `lagoon-env` config + ## This will cause the cli to redeploy on every deployment, even the files have not changed + - name: LAGOON_GIT_SHA + value: ${LAGOON_GIT_SHA} + - name: SERVICE_NAME + value: ${SERVICE_NAME} + - name: CRONJOBS + value: ${CRONJOBS} + volumeMounts: + - name: ${PERSISTENT_STORAGE_NAME} + mountPath: ${PERSISTENT_STORAGE_PATH} + - mountPath: /var/run/secrets/lagoon/sshkey/ + name: lagoon-sshkey + readOnly: true + resources: + requests: + cpu: 10m + memory: 10Mi + test: false + triggers: + - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/cli/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/cli/deployment.yml index be15d61561..cbf38a4de0 100644 --- a/images/oc-build-deploy-dind/openshift-templates/cli/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/cli/deployment.yml @@ -87,7 +87,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} + priorityClassName: lagoon-priority-${ENVIRONMENT_TYPE} envFrom: - configMapRef: name: lagoon-env diff --git a/images/oc-build-deploy-dind/openshift-templates/cli/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/cli/deployment.ymlbak new file mode 100644 index 0000000000..be15d61561 --- /dev/null +++ b/images/oc-build-deploy-dind/openshift-templates/cli/deployment.ymlbak @@ -0,0 +1,113 @@ +apiVersion: v1 +kind: Template +metadata: + creationTimestamp: null + name: lagoon-openshift-template-cli +parameters: + - name: SERVICE_NAME + description: Name of this service + required: true + - name: SAFE_BRANCH + description: Which branch this belongs to, special chars replaced with dashes + required: true + - name: SAFE_PROJECT + description: Which project this belongs to, special chars replaced with dashes + required: true + - name: BRANCH + description: Which branch this belongs to, original value + required: true + - name: PROJECT + description: Which project this belongs to, original value + required: true + - name: LAGOON_GIT_SHA + description: git hash sha of the current deployment + required: true + - name: SERVICE_ROUTER_URL + description: URL of the Router for this service + value: '' + - name: OPENSHIFT_PROJECT + description: Name of the Project that this service is in + required: true + - name: REGISTRY + description: Registry where Images are pushed to + required: true + - name: DEPLOYMENT_STRATEGY + description: Strategy of Deploymentconfig + value: 'Rolling' + - name: SERVICE_IMAGE + description: Pullable image of service + required: true + - name: CRONJOBS + description: Oneliner of Cronjobs + value: '' + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true +objects: + - apiVersion: v1 + kind: DeploymentConfig + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + name: ${SERVICE_NAME} + spec: + replicas: 1 + selector: + service: ${SERVICE_NAME} + strategy: + type: ${DEPLOYMENT_STRATEGY} + template: + metadata: + annotations: + appuio.ch/backupcommand: /bin/sh -c "if [[ $MARIADB_HOST ]]; then mysqldump --max-allowed-packet=500M --events --routines --quick --add-locks --no-autocommit --single-transaction --no-create-db -h $MARIADB_HOST -u $MARIADB_USERNAME -p$MARIADB_PASSWORD $MARIADB_DATABASE; fi" + backup.appuio.ch/file-extension: .mysql.sql + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + spec: + tolerations: + - effect: NoSchedule + key: autoscaled + operator: Equal + value: 'true' + - effect: NoSchedule + key: appuio.ch/autoscaled + operator: Equal + value: 'true' + volumes: + - name: lagoon-sshkey + secret: + defaultMode: 420 + secretName: lagoon-sshkey + containers: + - image: ${SERVICE_IMAGE} + name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} + envFrom: + - configMapRef: + name: lagoon-env + env: + ## LAGOON_GIT_SHA is injected directly and not loaded via `lagoon-env` config + ## This will cause the cli to redeploy on every deployment, even the files have not changed + - name: LAGOON_GIT_SHA + value: ${LAGOON_GIT_SHA} + - name: SERVICE_NAME + value: ${SERVICE_NAME} + - name: CRONJOBS + value: ${CRONJOBS} + volumeMounts: + - mountPath: /var/run/secrets/lagoon/sshkey/ + name: lagoon-sshkey + readOnly: true + resources: + requests: + cpu: 10m + memory: 10Mi + test: false + triggers: + - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/configmap.ymlbak b/images/oc-build-deploy-dind/openshift-templates/configmap.ymlbak new file mode 100644 index 0000000000..7bbf6c3def --- /dev/null +++ b/images/oc-build-deploy-dind/openshift-templates/configmap.ymlbak @@ -0,0 +1,55 @@ +apiVersion: v1 +kind: Template +metadata: + creationTimestamp: null + name: lagoon-openshift-template-configmap +parameters: + - name: NAME + description: Name of this configmap + required: true + - name: SAFE_BRANCH + description: Which branch this belongs to, special chars replaced with dashes + required: true + - name: SAFE_PROJECT + description: Which project this belongs to, special chars replaced with dashes + required: true + - name: BRANCH + description: Which branch this belongs to, original value + required: true + - name: PROJECT + description: Which project this belongs to, original value + required: true + - name: OPENSHIFT_NAME + description: The name of the openshift cluster this project is running on + value: "" + - name: ENVIRONMENT_TYPE + description: Which environment type this project is + value: development + - name: ROUTE + description: The main route of this project + value: "" + - name: ROUTES + description: All routes of this project + value: "" + - name: MONITORING_URLS + description: The routes specified for monitoring the production environment of this project + value: "" + - name: AUTOGENERATED_ROUTES + description: Routes which were automatically generated by Lagoon + value: "" +objects: +- kind: ConfigMap + apiVersion: v1 + metadata: + name: ${NAME} + data: + LAGOON_GIT_SAFE_BRANCH: ${SAFE_BRANCH} + LAGOON_GIT_BRANCH: ${BRANCH} + LAGOON_SAFE_PROJECT: ${SAFE_PROJECT} + LAGOON_PROJECT: ${PROJECT} + LAGOON_ENVIRONMENT_TYPE: ${ENVIRONMENT_TYPE} + LAGOON_ROUTE: ${ROUTE} + LAGOON_ROUTES: ${ROUTES} + LAGOON_MONITORING_URLS: ${MONITORING_URLS} + LAGOON_OPENSHIFT_NAME: ${OPENSHIFT_NAME} + LAGOON_AUTOGENERATED_ROUTES: ${AUTOGENERATED_ROUTES} diff --git a/images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.yml index 177d14f150..7fa2c229cd 100644 --- a/images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.yml @@ -80,7 +80,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} + priorityClassName: lagoon-priority-${ENVIRONMENT_TYPE} ports: - containerPort: 3306 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.ymlbak new file mode 100644 index 0000000000..177d14f150 --- /dev/null +++ b/images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.ymlbak @@ -0,0 +1,114 @@ +apiVersion: v1 +kind: Template +metadata: + creationTimestamp: null + name: lagoon-openshift-template-mariadb +parameters: + - name: SERVICE_NAME + description: Name of this service + required: true + - name: SAFE_BRANCH + description: Which branch this belongs to, special chars replaced with dashes + required: true + - name: SAFE_PROJECT + description: Which project this belongs to, special chars replaced with dashes + required: true + - name: BRANCH + description: Which branch this belongs to, original value + required: true + - name: PROJECT + description: Which project this belongs to, original value + required: true + - name: LAGOON_GIT_SHA + description: git hash sha of the current deployment + required: true + - name: SERVICE_ROUTER_URL + description: URL of the Router for this service + value: "" + - name: OPENSHIFT_PROJECT + description: Name of the Project that this service is in + required: true + - name: REGISTRY + description: Registry where Images are pushed to + required: true + - name: DEPLOYMENT_STRATEGY + description: Strategy of Deploymentconfig + value: "Recreate" + - name: SERVICE_IMAGE + description: Pullable image of service + required: true + - name: CRONJOBS + description: Oneline of Cronjobs + value: "" + - name: PERSISTENT_STORAGE_SIZE + description: Size of the Storage to request + value: "5Gi" + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true +objects: +- apiVersion: v1 + kind: DeploymentConfig + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + name: ${SERVICE_NAME} + spec: + replicas: 1 + selector: + service: ${SERVICE_NAME} + strategy: + type: ${DEPLOYMENT_STRATEGY} + template: + metadata: + annotations: + appuio.ch/backupcommand: /bin/sh -c "mysqldump --max-allowed-packet=500M --events --routines --quick --add-locks --no-autocommit --single-transaction --all-databases" + backup.appuio.ch/file-extension: .${SERVICE_NAME}.sql + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + spec: + volumes: + - name: ${SERVICE_NAME}-data + persistentVolumeClaim: + claimName: ${SERVICE_NAME}-data + containers: + - image: ${SERVICE_IMAGE} + name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} + ports: + - containerPort: 3306 + protocol: TCP + readinessProbe: + tcpSocket: + port: 3306 + initialDelaySeconds: 15 + timeoutSeconds: 1 + livenessProbe: + tcpSocket: + port: 3306 + initialDelaySeconds: 120 + periodSeconds: 5 + volumeMounts: + - name: ${SERVICE_NAME}-data + mountPath: /var/lib/mysql + env: + - name: SERVICE_NAME + value: ${SERVICE_NAME} + - name: CRONJOBS + value: ${CRONJOBS} + envFrom: + - configMapRef: + name: lagoon-env + resources: + requests: + cpu: 10m + memory: 10Mi + test: false + triggers: + - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/mongo/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/mongo/deployment.yml index 6ab0a75767..c014a2389a 100644 --- a/images/oc-build-deploy-dind/openshift-templates/mongo/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/mongo/deployment.yml @@ -75,7 +75,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} + priorityClassName: lagoon-priority-${ENVIRONMENT_TYPE} ports: - containerPort: 27017 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/mongo/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/mongo/deployment.ymlbak new file mode 100644 index 0000000000..6ab0a75767 --- /dev/null +++ b/images/oc-build-deploy-dind/openshift-templates/mongo/deployment.ymlbak @@ -0,0 +1,104 @@ +apiVersion: v1 +kind: Template +metadata: + creationTimestamp: null + name: lagoon-openshift-template-mongo +parameters: + - name: SERVICE_NAME + description: Name of this service + required: true + - name: SAFE_BRANCH + description: Which branch this belongs to, special chars replaced with dashes + required: true + - name: SAFE_PROJECT + description: Which project this belongs to, special chars replaced with dashes + required: true + - name: BRANCH + description: Which branch this belongs to, original value + required: true + - name: PROJECT + description: Which project this belongs to, original value + required: true + - name: LAGOON_GIT_SHA + description: git hash sha of the current deployment + required: true + - name: SERVICE_ROUTER_URL + description: URL of the Router for this service + value: "" + - name: OPENSHIFT_PROJECT + description: Name of the Project that this service is in + required: true + - name: REGISTRY + description: Registry where Images are pushed to + required: true + - name: DEPLOYMENT_STRATEGY + description: Strategy of Deploymentconfig + value: "Recreate" + - name: SERVICE_IMAGE + description: Pullable image of service + required: true + - name: CRONJOBS + description: Oneliner of Cronjobs + value: "" + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true +objects: +- apiVersion: v1 + kind: DeploymentConfig + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + name: ${SERVICE_NAME} + spec: + replicas: 1 + selector: + service: ${SERVICE_NAME} + strategy: + type: ${DEPLOYMENT_STRATEGY} + resources: {} + template: + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + spec: + volumes: + - name: ${SERVICE_NAME} + persistentVolumeClaim: + claimName: ${SERVICE_NAME} + containers: + - image: ${SERVICE_IMAGE} + name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} + ports: + - containerPort: 27017 + protocol: TCP + readinessProbe: + tcpSocket: + port: 27017 + initialDelaySeconds: 15 + timeoutSeconds: 1 + envFrom: + - configMapRef: + name: lagoon-env + env: + - name: SERVICE_NAME + value: ${SERVICE_NAME} + - name: CRONJOBS + value: ${CRONJOBS} + volumeMounts: + - name: ${SERVICE_NAME} + mountPath: /data/db + resources: + requests: + cpu: 10m + memory: 10Mi + test: false + triggers: + - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.yml index be472523f8..1de0e6871d 100644 --- a/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.yml @@ -101,7 +101,7 @@ objects: containers: - image: ${NGINX_SERVICE_IMAGE} name: ${NGINX_SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} + priorityClassName: lagoon-priority-${ENVIRONMENT_TYPE} ports: - containerPort: 8080 protocol: TCP @@ -137,7 +137,7 @@ objects: memory: 10Mi - image: ${PHP_SERVICE_IMAGE} name: ${PHP_SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} + priorityClassName: lagoon-priority-${ENVIRONMENT_TYPE} ports: - containerPort: 9000 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.ymlbak new file mode 100644 index 0000000000..be472523f8 --- /dev/null +++ b/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.ymlbak @@ -0,0 +1,177 @@ +apiVersion: v1 +kind: Template +metadata: + creationTimestamp: null + name: lagoon-openshift-template-nginx-php +parameters: + - name: SERVICE_NAME + description: Name of this service + required: true + - name: SAFE_BRANCH + description: Which branch this belongs to, special chars replaced with dashes + required: true + - name: SAFE_PROJECT + description: Which project this belongs to, special chars replaced with dashes + required: true + - name: BRANCH + description: Which branch this belongs to, original value + required: true + - name: PROJECT + description: Which project this belongs to, original value + required: true + - name: LAGOON_GIT_SHA + description: git hash sha of the current deployment + required: true + - name: SERVICE_ROUTER_URL + description: URL of the Router for this service + value: '' + - name: OPENSHIFT_PROJECT + description: Name of the Project that this service is in + required: true + - name: REGISTRY + description: Registry where Images are pushed to + required: true + - name: PERSISTENT_STORAGE_PATH + description: Full path to which should be mounted into persistent storage + required: true + - name: PERSISTENT_STORAGE_CLASS + description: Name of the Storage Class to use + value: '' + - name: PERSISTENT_STORAGE_SIZE + description: Size of the Storage to request + value: '5Gi' + - name: DEPLOYMENT_STRATEGY + description: Strategy of Deploymentconfig + value: 'Rolling' + - name: NGINX_SERVICE_IMAGE + description: Pullable image of nginx service + required: true + - name: PHP_SERVICE_IMAGE + description: Pullable image of php service + required: true + - name: NGINX_SERVICE_NAME + description: Name of nginx service + value: 'nginx' + - name: PHP_SERVICE_NAME + description: Name of php service + value: 'php' + - name: CRONJOBS + description: Oneliner of Cronjobs + value: '' + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true +objects: + - apiVersion: v1 + kind: DeploymentConfig + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + name: ${SERVICE_NAME} + spec: + replicas: 1 + selector: + service: ${SERVICE_NAME} + strategy: + type: ${DEPLOYMENT_STRATEGY} + template: + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + spec: + tolerations: + - effect: NoSchedule + key: autoscaled + operator: Equal + value: 'true' + - effect: NoSchedule + key: appuio.ch/autoscaled + operator: Equal + value: 'true' + volumes: + - name: ${SERVICE_NAME} + persistentVolumeClaim: + claimName: ${SERVICE_NAME} + containers: + - image: ${NGINX_SERVICE_IMAGE} + name: ${NGINX_SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} + ports: + - containerPort: 8080 + protocol: TCP + readinessProbe: + httpGet: + path: /nginx_status + port: 50000 + initialDelaySeconds: 5 + timeoutSeconds: 3 + livenessProbe: + httpGet: + path: /nginx_status + port: 50000 + initialDelaySeconds: 90 + timeoutSeconds: 3 + failureThreshold: 5 + envFrom: + - configMapRef: + name: lagoon-env + env: + ## LAGOON_GIT_SHA is injected directly and not loaded via `lagoon-env` config + ## This will cause the cli to redeploy on every deployment, even the files have not changed + - name: LAGOON_GIT_SHA + value: ${LAGOON_GIT_SHA} + - name: NGINX_FASTCGI_PASS + value: '127.0.0.1' + volumeMounts: + - name: ${SERVICE_NAME} + mountPath: ${PERSISTENT_STORAGE_PATH} + resources: + requests: + cpu: 10m + memory: 10Mi + - image: ${PHP_SERVICE_IMAGE} + name: ${PHP_SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} + ports: + - containerPort: 9000 + protocol: TCP + readinessProbe: + exec: + command: + - /usr/sbin/check_fcgi + initialDelaySeconds: 2 + periodSeconds: 5 + livenessProbe: + exec: + command: + - /usr/sbin/check_fcgi + initialDelaySeconds: 60 + periodSeconds: 5 + envFrom: + - configMapRef: + name: lagoon-env + env: + ## LAGOON_GIT_SHA is injected directly and not loaded via `lagoon-env` config + ## This will cause the cli to redeploy on every deployment, even the files have not changed + - name: LAGOON_GIT_SHA + value: ${LAGOON_GIT_SHA} + - name: SERVICE_NAME + value: ${SERVICE_NAME} + - name: CRONJOBS + value: ${CRONJOBS} + volumeMounts: + - name: ${SERVICE_NAME} + mountPath: ${PERSISTENT_STORAGE_PATH} + resources: + requests: + cpu: 10m + memory: 10Mi + test: false + triggers: + - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx-php-redis-persistent/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/nginx-php-redis-persistent/deployment.yml index 584e7a2832..0b560163a5 100644 --- a/images/oc-build-deploy-dind/openshift-templates/nginx-php-redis-persistent/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/nginx-php-redis-persistent/deployment.yml @@ -107,7 +107,7 @@ objects: containers: - image: ${NGINX_SERVICE_IMAGE} name: ${NGINX_SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} + priorityClassName: lagoon-priority-${ENVIRONMENT_TYPE} ports: - containerPort: 8080 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx-php-redis-persistent/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/nginx-php-redis-persistent/deployment.ymlbak new file mode 100644 index 0000000000..584e7a2832 --- /dev/null +++ b/images/oc-build-deploy-dind/openshift-templates/nginx-php-redis-persistent/deployment.ymlbak @@ -0,0 +1,211 @@ +apiVersion: v1 +kind: Template +metadata: + creationTimestamp: null + name: lagoon-openshift-template-nginx-php-redis +parameters: + - name: SERVICE_NAME + description: Name of this service + required: true + - name: SAFE_BRANCH + description: Which branch this belongs to, special chars replaced with dashes + required: true + - name: SAFE_PROJECT + description: Which project this belongs to, special chars replaced with dashes + required: true + - name: BRANCH + description: Which branch this belongs to, original value + required: true + - name: PROJECT + description: Which project this belongs to, original value + required: true + - name: LAGOON_GIT_SHA + description: git hash sha of the current deployment + required: true + - name: SERVICE_ROUTER_URL + description: URL of the Router for this service + value: '' + - name: OPENSHIFT_PROJECT + description: Name of the Project that this service is in + required: true + - name: REGISTRY + description: Registry where Images are pushed to + required: true + - name: PERSISTENT_STORAGE_PATH + description: Full path to which should be mounted into persistent storage + required: true + - name: PERSISTENT_STORAGE_CLASS + description: Name of the Storage Class to use + value: '' + - name: PERSISTENT_STORAGE_SIZE + description: Size of the Storage to request + value: '5Gi' + - name: DEPLOYMENT_STRATEGY + description: Strategy of Deploymentconfig + value: 'Rolling' + - name: NGINX_SERVICE_IMAGE + description: Pullable image of nginx service + required: true + - name: PHP_SERVICE_IMAGE + description: Pullable image of php service + required: true + - name: REDIS_SERVICE_IMAGE + description: Pullable image of php service + required: true + - name: NGINX_SERVICE_NAME + description: Name of nginx service + value: 'nginx' + - name: PHP_SERVICE_NAME + description: Name of php service + value: 'php' + - name: REDIS_SERVICE_NAME + description: Name of php service + value: 'redis' + - name: CRONJOBS + description: Oneliner of Cronjobs + value: '' + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true +objects: + - apiVersion: v1 + kind: DeploymentConfig + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + name: ${SERVICE_NAME} + spec: + replicas: 1 + selector: + service: ${SERVICE_NAME} + strategy: + type: ${DEPLOYMENT_STRATEGY} + template: + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + spec: + tolerations: + - effect: NoSchedule + key: autoscaled + operator: Equal + value: 'true' + - effect: NoSchedule + key: appuio.ch/autoscaled + operator: Equal + value: 'true' + volumes: + - name: ${SERVICE_NAME} + persistentVolumeClaim: + claimName: ${SERVICE_NAME} + containers: + - image: ${NGINX_SERVICE_IMAGE} + name: ${NGINX_SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} + ports: + - containerPort: 8080 + protocol: TCP + readinessProbe: + httpGet: + path: /nginx_status + port: 50000 + initialDelaySeconds: 5 + timeoutSeconds: 3 + livenessProbe: + httpGet: + path: /nginx_status + port: 50000 + initialDelaySeconds: 90 + timeoutSeconds: 3 + failureThreshold: 5 + envFrom: + - configMapRef: + name: lagoon-env + env: + ## LAGOON_GIT_SHA is injected directly and not loaded via `lagoon-env` config + ## This will cause the cli to redeploy on every deployment, even the files have not changed + - name: LAGOON_GIT_SHA + value: ${LAGOON_GIT_SHA} + - name: NGINX_FASTCGI_PASS + value: '127.0.0.1' + - name: REDIS_HOST + value: '127.0.0.1' + volumeMounts: + - name: ${SERVICE_NAME} + mountPath: ${PERSISTENT_STORAGE_PATH} + resources: + requests: + cpu: 10m + memory: 10Mi + - image: ${PHP_SERVICE_IMAGE} + name: ${PHP_SERVICE_NAME} + ports: + - containerPort: 9000 + protocol: TCP + readinessProbe: + exec: + command: + - /usr/sbin/check_fcgi + initialDelaySeconds: 2 + periodSeconds: 5 + livenessProbe: + exec: + command: + - /usr/sbin/check_fcgi + initialDelaySeconds: 60 + periodSeconds: 5 + envFrom: + - configMapRef: + name: lagoon-env + env: + ## LAGOON_GIT_SHA is injected directly and not loaded via `lagoon-env` config + ## This will cause the cli to redeploy on every deployment, even the files have not changed + - name: LAGOON_GIT_SHA + value: ${LAGOON_GIT_SHA} + - name: SERVICE_NAME + value: ${SERVICE_NAME} + - name: CRONJOBS + value: ${CRONJOBS} + - name: REDIS_HOST + value: '127.0.0.1' + volumeMounts: + - name: ${SERVICE_NAME} + mountPath: ${PERSISTENT_STORAGE_PATH} + resources: + requests: + cpu: 10m + memory: 10Mi + - image: ${REDIS_SERVICE_IMAGE} + name: ${REDIS_SERVICE_NAME} + ports: + - containerPort: 6379 + protocol: TCP + readinessProbe: + tcpSocket: + port: 6379 + initialDelaySeconds: 15 + timeoutSeconds: 1 + livenessProbe: + tcpSocket: + port: 6379 + initialDelaySeconds: 120 + periodSeconds: 5 + envFrom: + - configMapRef: + name: lagoon-env + env: + - name: SERVICE_NAME + value: ${SERVICE_NAME} + resources: + requests: + cpu: 10m + memory: 10Mi + test: false + triggers: + - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx-php/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/nginx-php/deployment.yml index 8b1a685d42..a303bb3da6 100644 --- a/images/oc-build-deploy-dind/openshift-templates/nginx-php/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/nginx-php/deployment.yml @@ -88,7 +88,7 @@ objects: containers: - image: ${NGINX_SERVICE_IMAGE} name: ${NGINX_SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} + priorityClassName: lagoon-priority-${ENVIRONMENT_TYPE} ports: - containerPort: 8080 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx-php/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/nginx-php/deployment.ymlbak new file mode 100644 index 0000000000..8b1a685d42 --- /dev/null +++ b/images/oc-build-deploy-dind/openshift-templates/nginx-php/deployment.ymlbak @@ -0,0 +1,158 @@ +apiVersion: v1 +kind: Template +metadata: + creationTimestamp: null + name: lagoon-openshift-template-nginx-php +parameters: + - name: SERVICE_NAME + description: Name of this service + required: true + - name: SAFE_BRANCH + description: Which branch this belongs to, special chars replaced with dashes + required: true + - name: SAFE_PROJECT + description: Which project this belongs to, special chars replaced with dashes + required: true + - name: BRANCH + description: Which branch this belongs to, original value + required: true + - name: PROJECT + description: Which project this belongs to, original value + required: true + - name: LAGOON_GIT_SHA + description: git hash sha of the current deployment + required: true + - name: SERVICE_ROUTER_URL + description: URL of the Router for this service + value: '' + - name: OPENSHIFT_PROJECT + description: Name of the Project that this service is in + required: true + - name: REGISTRY + description: Registry where Images are pushed to + required: true + - name: DEPLOYMENT_STRATEGY + description: Strategy of Deploymentconfig + value: 'Rolling' + - name: NGINX_SERVICE_IMAGE + description: Pullable image of nginx service + required: true + - name: PHP_SERVICE_IMAGE + description: Pullable image of php service + required: true + - name: NGINX_SERVICE_NAME + description: Name of nginx service + value: 'nginx' + - name: PHP_SERVICE_NAME + description: Name of php service + value: 'php' + - name: CRONJOBS + description: Oneliner of Cronjobs + value: '' + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true +objects: + - apiVersion: v1 + kind: DeploymentConfig + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + name: ${SERVICE_NAME} + spec: + replicas: 1 + selector: + service: ${SERVICE_NAME} + strategy: + type: ${DEPLOYMENT_STRATEGY} + template: + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + spec: + tolerations: + - effect: NoSchedule + key: autoscaled + operator: Equal + value: 'true' + - effect: NoSchedule + key: appuio.ch/autoscaled + operator: Equal + value: 'true' + containers: + - image: ${NGINX_SERVICE_IMAGE} + name: ${NGINX_SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} + ports: + - containerPort: 8080 + protocol: TCP + readinessProbe: + httpGet: + path: /nginx_status + port: 50000 + initialDelaySeconds: 5 + timeoutSeconds: 3 + livenessProbe: + httpGet: + path: /nginx_status + port: 50000 + initialDelaySeconds: 90 + timeoutSeconds: 3 + failureThreshold: 5 + envFrom: + - configMapRef: + name: lagoon-env + env: + ## LAGOON_GIT_SHA is injected directly and not loaded via `lagoon-env` config + ## This will cause the cli to redeploy on every deployment, even the files have not changed + - name: LAGOON_GIT_SHA + value: ${LAGOON_GIT_SHA} + - name: NGINX_FASTCGI_PASS + value: '127.0.0.1' + resources: + requests: + cpu: 10m + memory: 10Mi + - image: ${PHP_SERVICE_IMAGE} + name: ${PHP_SERVICE_NAME} + ports: + - containerPort: 9000 + protocol: TCP + readinessProbe: + exec: + command: + - /usr/sbin/check_fcgi + initialDelaySeconds: 2 + periodSeconds: 5 + livenessProbe: + exec: + command: + - /usr/sbin/check_fcgi + initialDelaySeconds: 60 + periodSeconds: 5 + envFrom: + - configMapRef: + name: lagoon-env + env: + ## LAGOON_GIT_SHA is injected directly and not loaded via `lagoon-env` config + ## This will cause the cli to redeploy on every deployment, even the files have not changed + - name: LAGOON_GIT_SHA + value: ${LAGOON_GIT_SHA} + - name: SERVICE_NAME + value: ${SERVICE_NAME} + - name: CRONJOBS + value: ${CRONJOBS} + resources: + requests: + cpu: 10m + memory: 10Mi + test: false + triggers: + - type: ConfigChange + status: {} diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.yml index e916b34f8a..b46163e61e 100644 --- a/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.yml @@ -80,7 +80,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} + priorityClassName: lagoon-priority-${ENVIRONMENT_TYPE} ports: - containerPort: 8080 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.ymlbak new file mode 100644 index 0000000000..e916b34f8a --- /dev/null +++ b/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.ymlbak @@ -0,0 +1,119 @@ +apiVersion: v1 +kind: Template +metadata: + creationTimestamp: null + name: lagoon-openshift-template-nginx +parameters: + - name: SERVICE_NAME + description: Name of this service + required: true + - name: SAFE_BRANCH + description: Which branch this belongs to, special chars replaced with dashes + required: true + - name: SAFE_PROJECT + description: Which project this belongs to, special chars replaced with dashes + required: true + - name: BRANCH + description: Which branch this belongs to, original value + required: true + - name: PROJECT + description: Which project this belongs to, original value + required: true + - name: LAGOON_GIT_SHA + description: git hash sha of the current deployment + required: true + - name: SERVICE_ROUTER_URL + description: URL of the Router for this service + value: '' + - name: OPENSHIFT_PROJECT + description: Name of the Project that this service is in + required: true + - name: REGISTRY + description: Registry where Images are pushed to + required: true + - name: DEPLOYMENT_STRATEGY + description: Strategy of Deploymentconfig + value: 'Rolling' + - name: SERVICE_IMAGE + description: Pullable image of service + required: true + - name: CRONJOBS + description: Oneliner of Cronjobs + value: '' + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true +objects: + - apiVersion: v1 + kind: DeploymentConfig + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + name: ${SERVICE_NAME} + spec: + + replicas: 1 + selector: + service: ${SERVICE_NAME} + strategy: + type: ${DEPLOYMENT_STRATEGY} + template: + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + spec: + tolerations: + - effect: NoSchedule + key: autoscaled + operator: Equal + value: 'true' + - effect: NoSchedule + key: appuio.ch/autoscaled + operator: Equal + value: 'true' + containers: + - image: ${SERVICE_IMAGE} + name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} + ports: + - containerPort: 8080 + protocol: TCP + readinessProbe: + httpGet: + path: /nginx_status + port: 50000 + initialDelaySeconds: 5 + timeoutSeconds: 3 + livenessProbe: + httpGet: + path: /nginx_status + port: 50000 + initialDelaySeconds: 90 + timeoutSeconds: 3 + failureThreshold: 5 + envFrom: + - configMapRef: + name: lagoon-env + env: + ## LAGOON_GIT_SHA is injected directly and not loaded via `lagoon-env` config + ## This will cause the cli to redeploy on every deployment, even the files have not changed + - name: LAGOON_GIT_SHA + value: ${LAGOON_GIT_SHA} + - name: SERVICE_NAME + value: ${SERVICE_NAME} + - name: CRONJOBS + value: ${CRONJOBS} + resources: + requests: + cpu: 10m + memory: 10Mi + test: false + triggers: + - type: ConfigChange + status: {} diff --git a/images/oc-build-deploy-dind/openshift-templates/node-persistent/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/node-persistent/deployment.yml index 0ecde97c80..06bfd67319 100644 --- a/images/oc-build-deploy-dind/openshift-templates/node-persistent/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/node-persistent/deployment.yml @@ -95,7 +95,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} + priorityClassName: lagoon-priority-${ENVIRONMENT_TYPE} ports: - containerPort: 3000 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/node-persistent/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/node-persistent/deployment.ymlbak new file mode 100644 index 0000000000..0ecde97c80 --- /dev/null +++ b/images/oc-build-deploy-dind/openshift-templates/node-persistent/deployment.ymlbak @@ -0,0 +1,133 @@ +apiVersion: v1 +kind: Template +metadata: + creationTimestamp: null + name: lagoon-openshift-template-node +parameters: + - name: SERVICE_NAME + description: Name of this service + required: true + - name: SAFE_BRANCH + description: Which branch this belongs to, special chars replaced with dashes + required: true + - name: SAFE_PROJECT + description: Which project this belongs to, special chars replaced with dashes + required: true + - name: BRANCH + description: Which branch this belongs to, original value + required: true + - name: PROJECT + description: Which project this belongs to, original value + required: true + - name: LAGOON_GIT_SHA + description: git hash sha of the current deployment + required: true + - name: SERVICE_ROUTER_URL + description: URL of the Router for this service + value: '' + - name: OPENSHIFT_PROJECT + description: Name of the Project that this service is in + required: true + - name: REGISTRY + description: Registry where Images are pushed to + required: true + - name: PERSISTENT_STORAGE_PATH + description: Full path to which should be mounted into persistent storage + required: true + - name: PERSISTENT_STORAGE_CLASS + description: Name of the Storage Class to use + value: '' + - name: PERSISTENT_STORAGE_SIZE + description: Size of the Storage to request + value: '5Gi' + - name: DEPLOYMENT_STRATEGY + description: Strategy of Deploymentconfig + value: 'Rolling' + - name: SERVICE_IMAGE + description: Pullable image of service + required: true + - name: CRONJOBS + description: Oneliner of Cronjobs + value: '' + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true +objects: + - apiVersion: v1 + kind: DeploymentConfig + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + name: ${SERVICE_NAME} + spec: + replicas: 1 + selector: + service: ${SERVICE_NAME} + strategy: + type: ${DEPLOYMENT_STRATEGY} + template: + metadata: + annotations: + appuio.ch/backupcommand: /bin/sh -c "/bin/busybox tar -cf - -C ${PERSISTENT_STORAGE_PATH} ." + backup.appuio.ch/file-extension: .${SERVICE_NAME}.tar + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + spec: + tolerations: + - effect: NoSchedule + key: autoscaled + operator: Equal + value: 'true' + - effect: NoSchedule + key: appuio.ch/autoscaled + operator: Equal + value: 'true' + volumes: + - name: ${SERVICE_NAME} + persistentVolumeClaim: + claimName: ${SERVICE_NAME} + containers: + - image: ${SERVICE_IMAGE} + name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} + ports: + - containerPort: 3000 + protocol: TCP + readinessProbe: + tcpSocket: + port: 3000 + initialDelaySeconds: 15 + timeoutSeconds: 1 + livenessProbe: + tcpSocket: + port: 3000 + initialDelaySeconds: 60 + periodSeconds: 5 + envFrom: + - configMapRef: + name: lagoon-env + env: + ## LAGOON_GIT_SHA is injected directly and not loaded via `lagoon-env` config + ## This will cause the cli to redeploy on every deployment, even the files have not changed + - name: LAGOON_GIT_SHA + value: ${LAGOON_GIT_SHA} + - name: SERVICE_NAME + value: ${SERVICE_NAME} + - name: CRONJOBS + value: ${CRONJOBS} + volumeMounts: + - name: ${SERVICE_NAME} + mountPath: ${PERSISTENT_STORAGE_PATH} + resources: + requests: + cpu: 10m + memory: 10Mi + test: false + triggers: + - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/node/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/node/deployment.yml index 1cc596e322..64c2e2621f 100644 --- a/images/oc-build-deploy-dind/openshift-templates/node/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/node/deployment.yml @@ -79,7 +79,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} + priorityClassName: lagoon-priority-${ENVIRONMENT_TYPE} ports: - containerPort: 3000 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/node/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/node/deployment.ymlbak new file mode 100644 index 0000000000..1cc596e322 --- /dev/null +++ b/images/oc-build-deploy-dind/openshift-templates/node/deployment.ymlbak @@ -0,0 +1,114 @@ +apiVersion: v1 +kind: Template +metadata: + creationTimestamp: null + name: lagoon-openshift-template-node +parameters: + - name: SERVICE_NAME + description: Name of this service + required: true + - name: SAFE_BRANCH + description: Which branch this belongs to, special chars replaced with dashes + required: true + - name: SAFE_PROJECT + description: Which project this belongs to, special chars replaced with dashes + required: true + - name: BRANCH + description: Which branch this belongs to, original value + required: true + - name: PROJECT + description: Which project this belongs to, original value + required: true + - name: LAGOON_GIT_SHA + description: git hash sha of the current deployment + required: true + - name: SERVICE_ROUTER_URL + description: URL of the Router for this service + value: '' + - name: OPENSHIFT_PROJECT + description: Name of the Project that this service is in + required: true + - name: REGISTRY + description: Registry where Images are pushed to + required: true + - name: DEPLOYMENT_STRATEGY + description: Strategy of Deploymentconfig + value: 'Rolling' + - name: SERVICE_IMAGE + description: Pullable image of service + required: true + - name: CRONJOBS + description: Oneliner of Cronjobs + value: '' + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true +objects: + - apiVersion: v1 + kind: DeploymentConfig + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + name: ${SERVICE_NAME} + spec: + replicas: 1 + selector: + service: ${SERVICE_NAME} + strategy: + type: ${DEPLOYMENT_STRATEGY} + template: + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + spec: + tolerations: + - effect: NoSchedule + key: autoscaled + operator: Equal + value: 'true' + - effect: NoSchedule + key: appuio.ch/autoscaled + operator: Equal + value: 'true' + containers: + - image: ${SERVICE_IMAGE} + name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} + ports: + - containerPort: 3000 + protocol: TCP + readinessProbe: + tcpSocket: + port: 3000 + initialDelaySeconds: 15 + timeoutSeconds: 1 + livenessProbe: + tcpSocket: + port: 3000 + initialDelaySeconds: 60 + periodSeconds: 5 + envFrom: + - configMapRef: + name: lagoon-env + env: + ## LAGOON_GIT_SHA is injected directly and not loaded via `lagoon-env` config + ## This will cause the cli to redeploy on every deployment, even the files have not changed + - name: LAGOON_GIT_SHA + value: ${LAGOON_GIT_SHA} + - name: SERVICE_NAME + value: ${SERVICE_NAME} + - name: CRONJOBS + value: ${CRONJOBS} + resources: + requests: + cpu: 10m + memory: 10Mi + test: false + triggers: + - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/postgres/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/postgres/deployment.yml index b68adc423f..a652581432 100644 --- a/images/oc-build-deploy-dind/openshift-templates/postgres/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/postgres/deployment.yml @@ -74,7 +74,7 @@ objects: containers: - image: ${POSTGRES_SERVICE_IMAGE} name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} + priorityClassName: lagoon-priority-${ENVIRONMENT_TYPE} ports: - containerPort: 5432 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/postgres/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/postgres/deployment.ymlbak new file mode 100644 index 0000000000..b68adc423f --- /dev/null +++ b/images/oc-build-deploy-dind/openshift-templates/postgres/deployment.ymlbak @@ -0,0 +1,108 @@ +apiVersion: v1 +kind: Template +metadata: + creationTimestamp: null + name: lagoon-openshift-template-postgres +parameters: + - name: SERVICE_NAME + description: Name of this service + required: true + - name: SAFE_BRANCH + description: Which branch this belongs to, special chars replaced with dashes + required: true + - name: SAFE_PROJECT + description: Which project this belongs to, special chars replaced with dashes + required: true + - name: BRANCH + description: Which branch this belongs to, original value + required: true + - name: PROJECT + description: Which project this belongs to, original value + required: true + - name: LAGOON_GIT_SHA + description: git hash sha of the current deployment + required: true + - name: SERVICE_ROUTER_URL + description: URL of the Router for this service + value: "" + - name: OPENSHIFT_PROJECT + description: Name of the Project that this service is in + required: true + - name: REGISTRY + description: Registry where Images are pushed to + required: true + - name: DEPLOYMENT_STRATEGY + description: Strategy of Deploymentconfig + value: "Recreate" + - name: POSTGRES_SERVICE_IMAGE + description: Pullable image of postgres service + required: true + - name: CRONJOBS + description: Oneliner of Cronjobs + value: "" + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true +objects: +- apiVersion: v1 + kind: DeploymentConfig + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + name: ${SERVICE_NAME} + spec: + replicas: 1 + selector: + service: ${SERVICE_NAME} + strategy: + type: ${DEPLOYMENT_STRATEGY} + template: + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + spec: + volumes: + - name: ${SERVICE_NAME} + persistentVolumeClaim: + claimName: ${SERVICE_NAME} + containers: + - image: ${POSTGRES_SERVICE_IMAGE} + name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} + ports: + - containerPort: 5432 + protocol: TCP + readinessProbe: + tcpSocket: + port: 5432 + initialDelaySeconds: 15 + timeoutSeconds: 1 + livenessProbe: + tcpSocket: + port: 5432 + initialDelaySeconds: 120 + periodSeconds: 5 + volumeMounts: + - name: ${SERVICE_NAME} + mountPath: /var/lib/postgresql/data + envFrom: + - configMapRef: + name: lagoon-env + env: + - name: SERVICE_NAME + value: ${SERVICE_NAME} + - name: CRONJOBS + value: ${CRONJOBS} + resources: + requests: + cpu: 10m + memory: 10Mi + test: false + triggers: + - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/rabbitmq/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/rabbitmq/deployment.yml index 9da67df087..5acd6ebdc7 100644 --- a/images/oc-build-deploy-dind/openshift-templates/rabbitmq/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/rabbitmq/deployment.yml @@ -69,7 +69,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} + priorityClassName: lagoon-priority-${ENVIRONMENT_TYPE} ports: - containerPort: 15672 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/rabbitmq/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/rabbitmq/deployment.ymlbak new file mode 100644 index 0000000000..9da67df087 --- /dev/null +++ b/images/oc-build-deploy-dind/openshift-templates/rabbitmq/deployment.ymlbak @@ -0,0 +1,107 @@ +apiVersion: v1 +kind: Template +metadata: + creationTimestamp: null + name: lagoon-openshift-template-rabbitmq +parameters: + - name: SERVICE_NAME + description: Name of this service + required: true + - name: SAFE_BRANCH + description: Which branch this belongs to, special chars replaced with dashes + required: true + - name: SAFE_PROJECT + description: Which project this belongs to, special chars replaced with dashes + required: true + - name: BRANCH + description: Which branch this belongs to, original value + required: true + - name: PROJECT + description: Which project this belongs to, original value + required: true + - name: LAGOON_GIT_SHA + description: git hash sha of the current deployment + required: true + - name: SERVICE_ROUTER_URL + description: URL of the Router for this service + value: "" + - name: OPENSHIFT_PROJECT + description: Name of the Project that this service is in + required: true + - name: REGISTRY + description: Registry where Images are pushed to + required: true + - name: DEPLOYMENT_STRATEGY + description: Strategy of Deploymentconfig + value: "Rolling" + - name: SERVICE_IMAGE + description: Pullable image of service + required: true + - name: CRONJOBS + description: Oneliner of Cronjobs + value: "" + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true +objects: +- apiVersion: v1 + kind: DeploymentConfig + metadata: + creationTimestamp: null + labels: + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + name: ${SERVICE_NAME} + spec: + replicas: 1 + selector: + service: ${SERVICE_NAME} + strategy: + type: ${DEPLOYMENT_STRATEGY} + template: + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + spec: + containers: + - image: ${SERVICE_IMAGE} + name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} + ports: + - containerPort: 15672 + protocol: TCP + - containerPort: 5672 + protocol: TCP + readinessProbe: + tcpSocket: + port: 5672 + initialDelaySeconds: 15 + timeoutSeconds: 1 + envFrom: + - configMapRef: + name: lagoon-env + env: + - name: SERVICE_NAME + value: ${SERVICE_NAME} + - name: CRONJOBS + value: ${CRONJOBS} + - name: RABBITMQ_NODENAME + value: rabbitmq@localhost + resources: + requests: + cpu: 10m + memory: 10Mi + volumeMounts: + - mountPath: /var/lib/rabbitmq + name: ${SERVICE_NAME}-volume + volumes: + - name: ${SERVICE_NAME}-volume + persistentVolumeClaim: + claimName: ${SERVICE_NAME}-volume + test: false + triggers: + - type: ConfigChange + status: {} diff --git a/images/oc-build-deploy-dind/openshift-templates/redis-persistent/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/redis-persistent/deployment.yml index 3825418fef..87a7f4ace7 100644 --- a/images/oc-build-deploy-dind/openshift-templates/redis-persistent/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/redis-persistent/deployment.yml @@ -86,7 +86,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} + priorityClassName: lagoon-priority-${ENVIRONMENT_TYPE} ports: - containerPort: 6379 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/redis-persistent/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/redis-persistent/deployment.ymlbak new file mode 100644 index 0000000000..3825418fef --- /dev/null +++ b/images/oc-build-deploy-dind/openshift-templates/redis-persistent/deployment.ymlbak @@ -0,0 +1,120 @@ +apiVersion: v1 +kind: Template +metadata: + creationTimestamp: null + name: lagoon-openshift-template-redis +parameters: + - name: SERVICE_NAME + description: Name of this service + required: true + - name: SAFE_BRANCH + description: Which branch this belongs to, special chars replaced with dashes + required: true + - name: SAFE_PROJECT + description: Which project this belongs to, special chars replaced with dashes + required: true + - name: BRANCH + description: Which branch this belongs to, original value + required: true + - name: PROJECT + description: Which project this belongs to, original value + required: true + - name: LAGOON_GIT_SHA + description: git hash sha of the current deployment + required: true + - name: SERVICE_ROUTER_URL + description: URL of the Router for this service + value: "" + - name: OPENSHIFT_PROJECT + description: Name of the Project that this service is in + required: true + - name: REGISTRY + description: Registry where Images are pushed to + required: true + - name: DEPLOYMENT_STRATEGY + description: Strategy of Deploymentconfig + value: "Recreate" + - name: SERVICE_IMAGE + description: Pullable image of service + required: true + - name: CRONJOBS + description: Oneliner of Cronjobs + value: "" + - name: PERSISTENT_STORAGE_PATH + description: Full path to which should be mounted into persistent storage + value: "/data" + - name: PERSISTENT_STORAGE_CLASS + description: Name of the Storage Class to use + value: "bulk" + - name: PERSISTENT_STORAGE_SIZE + description: Size of the Storage to request + value: "1Gi" + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true +objects: +- apiVersion: v1 + kind: DeploymentConfig + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + name: ${SERVICE_NAME} + spec: + replicas: 1 + selector: + service: ${SERVICE_NAME} + strategy: + type: ${DEPLOYMENT_STRATEGY} + template: + metadata: + annotations: + appuio.ch/backupcommand: /bin/sh -c "/bin/busybox tar -cf - -C /data ." + backup.appuio.ch/file-extension: .${SERVICE_NAME}.tar + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + spec: + volumes: + - name: ${SERVICE_NAME} + persistentVolumeClaim: + claimName: ${SERVICE_NAME} + containers: + - image: ${SERVICE_IMAGE} + name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} + ports: + - containerPort: 6379 + protocol: TCP + volumeMounts: + - name: ${SERVICE_NAME} + mountPath: /data + readinessProbe: + tcpSocket: + port: 6379 + initialDelaySeconds: 15 + timeoutSeconds: 1 + livenessProbe: + tcpSocket: + port: 6379 + initialDelaySeconds: 120 + periodSeconds: 5 + envFrom: + - configMapRef: + name: lagoon-env + env: + - name: SERVICE_NAME + value: ${SERVICE_NAME} + - name: CRONJOBS + value: ${CRONJOBS} + resources: + requests: + cpu: 10m + memory: 10Mi + test: false + triggers: + - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/redis/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/redis/deployment.yml index 515b272c2a..3389f5be92 100644 --- a/images/oc-build-deploy-dind/openshift-templates/redis/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/redis/deployment.yml @@ -70,7 +70,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} + priorityClassName: lagoon-priority-${ENVIRONMENT_TYPE} ports: - containerPort: 6379 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/redis/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/redis/deployment.ymlbak new file mode 100644 index 0000000000..515b272c2a --- /dev/null +++ b/images/oc-build-deploy-dind/openshift-templates/redis/deployment.ymlbak @@ -0,0 +1,101 @@ +apiVersion: v1 +kind: Template +metadata: + creationTimestamp: null + name: lagoon-openshift-template-redis +parameters: + - name: SERVICE_NAME + description: Name of this service + required: true + - name: SAFE_BRANCH + description: Which branch this belongs to, special chars replaced with dashes + required: true + - name: SAFE_PROJECT + description: Which project this belongs to, special chars replaced with dashes + required: true + - name: BRANCH + description: Which branch this belongs to, original value + required: true + - name: PROJECT + description: Which project this belongs to, original value + required: true + - name: LAGOON_GIT_SHA + description: git hash sha of the current deployment + required: true + - name: SERVICE_ROUTER_URL + description: URL of the Router for this service + value: "" + - name: OPENSHIFT_PROJECT + description: Name of the Project that this service is in + required: true + - name: REGISTRY + description: Registry where Images are pushed to + required: true + - name: DEPLOYMENT_STRATEGY + description: Strategy of Deploymentconfig + value: "Rolling" + - name: SERVICE_IMAGE + description: Pullable image of service + required: true + - name: CRONJOBS + description: Oneliner of Cronjobs + value: "" + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true +objects: +- apiVersion: v1 + kind: DeploymentConfig + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + name: ${SERVICE_NAME} + spec: + replicas: 1 + selector: + service: ${SERVICE_NAME} + strategy: + type: ${DEPLOYMENT_STRATEGY} + template: + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + spec: + containers: + - image: ${SERVICE_IMAGE} + name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} + ports: + - containerPort: 6379 + protocol: TCP + readinessProbe: + tcpSocket: + port: 6379 + initialDelaySeconds: 15 + timeoutSeconds: 1 + livenessProbe: + tcpSocket: + port: 6379 + initialDelaySeconds: 120 + periodSeconds: 5 + envFrom: + - configMapRef: + name: lagoon-env + env: + - name: SERVICE_NAME + value: ${SERVICE_NAME} + - name: CRONJOBS + value: ${CRONJOBS} + resources: + requests: + cpu: 10m + memory: 10Mi + test: false + triggers: + - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/solr/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/solr/deployment.yml index 0eb8db2545..85f8bbafc2 100644 --- a/images/oc-build-deploy-dind/openshift-templates/solr/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/solr/deployment.yml @@ -80,7 +80,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} + priorityClassName: lagoon-priority-${ENVIRONMENT_TYPE} ports: - containerPort: 8149 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/solr/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/solr/deployment.ymlbak new file mode 100644 index 0000000000..0eb8db2545 --- /dev/null +++ b/images/oc-build-deploy-dind/openshift-templates/solr/deployment.ymlbak @@ -0,0 +1,117 @@ +apiVersion: v1 +kind: Template +metadata: + creationTimestamp: null + name: lagoon-openshift-template-solr +parameters: + - name: SERVICE_NAME + description: Name of this service + required: true + - name: SAFE_BRANCH + description: Which branch this belongs to, special chars replaced with dashes + required: true + - name: SAFE_PROJECT + description: Which project this belongs to, special chars replaced with dashes + required: true + - name: BRANCH + description: Which branch this belongs to, original value + required: true + - name: PROJECT + description: Which project this belongs to, original value + required: true + - name: LAGOON_GIT_SHA + description: git hash sha of the current deployment + required: true + - name: SERVICE_ROUTER_URL + description: URL of the Router for this service + value: "" + - name: OPENSHIFT_PROJECT + description: Name of the Project that this service is in + required: true + - name: REGISTRY + description: Registry where Images are pushed to + required: true + - name: DEPLOYMENT_STRATEGY + description: Strategy of Deploymentconfig + value: "Recreate" + - name: SERVICE_IMAGE + description: Pullable image of service + required: true + - name: CRONJOBS + description: Oneliner of Cronjobs + value: "" + - name: PERSISTENT_STORAGE_SIZE + description: Size of the Storage to request + value: "1Gi" + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true +objects: +- apiVersion: v1 + kind: DeploymentConfig + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + name: ${SERVICE_NAME} + spec: + replicas: 1 + selector: + service: ${SERVICE_NAME} + strategy: + type: ${DEPLOYMENT_STRATEGY} + template: + metadata: + annotations: + appuio.ch/backupcommand: /bin/sh -c "/bin/busybox tar -cf - -C /opt/solr/server/solr/mycores ." + backup.appuio.ch/file-extension: .${SERVICE_NAME}.tar + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + spec: + volumes: + - name: ${SERVICE_NAME} + persistentVolumeClaim: + claimName: ${SERVICE_NAME} + containers: + - image: ${SERVICE_IMAGE} + name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} + ports: + - containerPort: 8149 + protocol: TCP + readinessProbe: + httpGet: + path: /solr + port: 8983 + initialDelaySeconds: 5 + timeoutSeconds: 3 + livenessProbe: + httpGet: + path: /solr + port: 8983 + initialDelaySeconds: 90 + timeoutSeconds: 3 + failureThreshold: 5 + envFrom: + - configMapRef: + name: lagoon-env + env: + - name: SERVICE_NAME + value: ${SERVICE_NAME} + - name: CRONJOBS + value: ${CRONJOBS} + volumeMounts: + - name: ${SERVICE_NAME} + mountPath: /var/solr + resources: + requests: + cpu: 10m + memory: 10Mi + test: false + triggers: + - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/varnish-persistent/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/varnish-persistent/deployment.yml index 28e634a17a..c229160d79 100644 --- a/images/oc-build-deploy-dind/openshift-templates/varnish-persistent/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/varnish-persistent/deployment.yml @@ -83,7 +83,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} + priorityClassName: lagoon-priority-${ENVIRONMENT_TYPE} ports: - containerPort: 8080 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/varnish-persistent/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/varnish-persistent/deployment.ymlbak new file mode 100644 index 0000000000..28e634a17a --- /dev/null +++ b/images/oc-build-deploy-dind/openshift-templates/varnish-persistent/deployment.ymlbak @@ -0,0 +1,120 @@ +apiVersion: v1 +kind: Template +metadata: + creationTimestamp: null + name: lagoon-openshift-template-varnish +parameters: + - name: SERVICE_NAME + description: Name of this service + required: true + - name: SAFE_BRANCH + description: Which branch this belongs to, special chars replaced with dashes + required: true + - name: SAFE_PROJECT + description: Which project this belongs to, special chars replaced with dashes + required: true + - name: BRANCH + description: Which branch this belongs to, original value + required: true + - name: PROJECT + description: Which project this belongs to, original value + required: true + - name: LAGOON_GIT_SHA + description: git hash sha of the current deployment + required: true + - name: SERVICE_ROUTER_URL + description: URL of the Router for this service + value: '' + - name: OPENSHIFT_PROJECT + description: Name of the Project that this service is in + required: true + - name: REGISTRY + description: Registry where Images are pushed to + required: true + - name: DEPLOYMENT_STRATEGY + description: Strategy of Deploymentconfig + value: 'Rolling' + - name: SERVICE_IMAGE + description: Pullable image of service + required: true + - name: CRONJOBS + description: Oneliner of Cronjobs + value: '' + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true +objects: + - apiVersion: v1 + kind: DeploymentConfig + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + name: ${SERVICE_NAME} + spec: + replicas: 1 + selector: + service: ${SERVICE_NAME} + strategy: + type: ${DEPLOYMENT_STRATEGY} + template: + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + spec: + tolerations: + - effect: NoSchedule + key: autoscaled + operator: Equal + value: 'true' + - effect: NoSchedule + key: appuio.ch/autoscaled + operator: Equal + value: 'true' + volumes: + - name: ${SERVICE_NAME} + persistentVolumeClaim: + claimName: ${SERVICE_NAME} + containers: + - image: ${SERVICE_IMAGE} + name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} + ports: + - containerPort: 8080 + protocol: TCP + volumeMounts: + - name: ${SERVICE_NAME} + mountPath: /var/cache/varnish + readinessProbe: + httpGet: + path: /varnish_status + port: 8080 + initialDelaySeconds: 5 + timeoutSeconds: 3 + livenessProbe: + httpGet: + path: /varnish_status + port: 8080 + initialDelaySeconds: 90 + timeoutSeconds: 3 + failureThreshold: 5 + envFrom: + - configMapRef: + name: lagoon-env + env: + - name: SERVICE_NAME + value: ${SERVICE_NAME} + - name: CRONJOBS + value: ${CRONJOBS} + resources: + requests: + cpu: 10m + memory: 10Mi + test: false + triggers: + - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.yml b/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.yml index d04a0b632b..823a4f8966 100644 --- a/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.yml +++ b/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.yml @@ -79,7 +79,7 @@ objects: containers: - image: ${SERVICE_IMAGE} name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} + priorityClassName: lagoon-priority-${ENVIRONMENT_TYPE} ports: - containerPort: 8080 protocol: TCP diff --git a/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.ymlbak new file mode 100644 index 0000000000..d04a0b632b --- /dev/null +++ b/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.ymlbak @@ -0,0 +1,113 @@ +apiVersion: v1 +kind: Template +metadata: + creationTimestamp: null + name: lagoon-openshift-template-varnish +parameters: + - name: SERVICE_NAME + description: Name of this service + required: true + - name: SAFE_BRANCH + description: Which branch this belongs to, special chars replaced with dashes + required: true + - name: SAFE_PROJECT + description: Which project this belongs to, special chars replaced with dashes + required: true + - name: BRANCH + description: Which branch this belongs to, original value + required: true + - name: PROJECT + description: Which project this belongs to, original value + required: true + - name: LAGOON_GIT_SHA + description: git hash sha of the current deployment + required: true + - name: SERVICE_ROUTER_URL + description: URL of the Router for this service + value: '' + - name: OPENSHIFT_PROJECT + description: Name of the Project that this service is in + required: true + - name: REGISTRY + description: Registry where Images are pushed to + required: true + - name: DEPLOYMENT_STRATEGY + description: Strategy of Deploymentconfig + value: 'Rolling' + - name: SERVICE_IMAGE + description: Pullable image of service + required: true + - name: CRONJOBS + description: Oneliner of Cronjobs + value: '' + - name: ENVIRONMENT_TYPE + description: production level of this environment + required: true +objects: + - apiVersion: v1 + kind: DeploymentConfig + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + name: ${SERVICE_NAME} + spec: + replicas: 1 + selector: + service: ${SERVICE_NAME} + strategy: + type: ${DEPLOYMENT_STRATEGY} + template: + metadata: + creationTimestamp: null + labels: + service: ${SERVICE_NAME} + branch: ${SAFE_BRANCH} + project: ${SAFE_PROJECT} + spec: + tolerations: + - effect: NoSchedule + key: autoscaled + operator: Equal + value: 'true' + - effect: NoSchedule + key: appuio.ch/autoscaled + operator: Equal + value: 'true' + containers: + - image: ${SERVICE_IMAGE} + name: ${SERVICE_NAME} + priorityClassName: priority-${ENVIRONMENT_TYPE} + ports: + - containerPort: 8080 + protocol: TCP + readinessProbe: + httpGet: + path: /varnish_status + port: 8080 + initialDelaySeconds: 5 + timeoutSeconds: 3 + livenessProbe: + httpGet: + path: /varnish_status + port: 8080 + initialDelaySeconds: 90 + timeoutSeconds: 3 + failureThreshold: 5 + envFrom: + - configMapRef: + name: lagoon-env + env: + - name: SERVICE_NAME + value: ${SERVICE_NAME} + - name: CRONJOBS + value: ${CRONJOBS} + resources: + requests: + cpu: 10m + memory: 10Mi + test: false + triggers: + - type: ConfigChange From 749727e344f98ee4fef801a9320c3e43cd76959d Mon Sep 17 00:00:00 2001 From: Elliot Schlegelmilch Date: Fri, 29 Mar 2019 08:25:38 -0700 Subject: [PATCH 14/15] inadverntant commit. --- .../cli-persistent/deployment.ymlbak | 131 ----------- .../openshift-templates/cli/deployment.ymlbak | 113 ---------- .../mariadb-single/deployment.ymlbak | 114 ---------- .../mongo/deployment.ymlbak | 104 --------- .../nginx-php-persistent/deployment.ymlbak | 177 --------------- .../deployment.ymlbak | 211 ------------------ .../nginx-php/deployment.ymlbak | 158 ------------- .../nginx/deployment.ymlbak | 119 ---------- .../node-persistent/deployment.ymlbak | 133 ----------- .../node/deployment.ymlbak | 114 ---------- .../postgres/deployment.ymlbak | 108 --------- .../rabbitmq/deployment.ymlbak | 107 --------- .../redis-persistent/deployment.ymlbak | 120 ---------- .../redis/deployment.ymlbak | 101 --------- .../solr/deployment.ymlbak | 117 ---------- .../varnish-persistent/deployment.ymlbak | 120 ---------- .../varnish/deployment.ymlbak | 113 ---------- 17 files changed, 2160 deletions(-) delete mode 100644 images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.ymlbak delete mode 100644 images/oc-build-deploy-dind/openshift-templates/cli/deployment.ymlbak delete mode 100644 images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.ymlbak delete mode 100644 images/oc-build-deploy-dind/openshift-templates/mongo/deployment.ymlbak delete mode 100644 images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.ymlbak delete mode 100644 images/oc-build-deploy-dind/openshift-templates/nginx-php-redis-persistent/deployment.ymlbak delete mode 100644 images/oc-build-deploy-dind/openshift-templates/nginx-php/deployment.ymlbak delete mode 100644 images/oc-build-deploy-dind/openshift-templates/nginx/deployment.ymlbak delete mode 100644 images/oc-build-deploy-dind/openshift-templates/node-persistent/deployment.ymlbak delete mode 100644 images/oc-build-deploy-dind/openshift-templates/node/deployment.ymlbak delete mode 100644 images/oc-build-deploy-dind/openshift-templates/postgres/deployment.ymlbak delete mode 100644 images/oc-build-deploy-dind/openshift-templates/rabbitmq/deployment.ymlbak delete mode 100644 images/oc-build-deploy-dind/openshift-templates/redis-persistent/deployment.ymlbak delete mode 100644 images/oc-build-deploy-dind/openshift-templates/redis/deployment.ymlbak delete mode 100644 images/oc-build-deploy-dind/openshift-templates/solr/deployment.ymlbak delete mode 100644 images/oc-build-deploy-dind/openshift-templates/varnish-persistent/deployment.ymlbak delete mode 100644 images/oc-build-deploy-dind/openshift-templates/varnish/deployment.ymlbak diff --git a/images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.ymlbak deleted file mode 100644 index d277d0cbea..0000000000 --- a/images/oc-build-deploy-dind/openshift-templates/cli-persistent/deployment.ymlbak +++ /dev/null @@ -1,131 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - creationTimestamp: null - name: lagoon-openshift-template-cli -parameters: - - name: SERVICE_NAME - description: Name of this service - required: true - - name: SAFE_BRANCH - description: Which branch this belongs to, special chars replaced with dashes - required: true - - name: SAFE_PROJECT - description: Which project this belongs to, special chars replaced with dashes - required: true - - name: BRANCH - description: Which branch this belongs to, original value - required: true - - name: PROJECT - description: Which project this belongs to, original value - required: true - - name: LAGOON_GIT_SHA - description: git hash sha of the current deployment - required: true - - name: SERVICE_ROUTER_URL - description: URL of the Router for this service - value: '' - - name: OPENSHIFT_PROJECT - description: Name of the Project that this service is in - required: true - - name: REGISTRY - description: Registry where Images are pushed to - required: true - - name: PERSISTENT_STORAGE_PATH - description: Full path to which should be mounted into persistent storage - required: true - - name: PERSISTENT_STORAGE_NAME - description: Name of the Persistent Volume Claim to use - required: true - # The following two parameters are actually not used anywhere in this YAML, but they are injected by oc-build-deploy - # and `oc process` fails if you inject a parameter that is not defined - - name: PERSISTENT_STORAGE_CLASS - description: Name of the Storage Class to use - value: '' - - name: PERSISTENT_STORAGE_SIZE - description: Size of the Storage to request - value: '5Gi' - - name: DEPLOYMENT_STRATEGY - description: Strategy of Deploymentconfig - value: 'Rolling' - - name: SERVICE_IMAGE - description: Pullable image of service - required: true - - name: CRONJOBS - description: Oneliner of Cronjobs - value: '' - - name: ENVIRONMENT_TYPE - description: production level of this environment -objects: - - apiVersion: v1 - kind: DeploymentConfig - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - name: ${SERVICE_NAME} - spec: - replicas: 1 - selector: - service: ${SERVICE_NAME} - strategy: - type: ${DEPLOYMENT_STRATEGY} - template: - metadata: - annotations: - appuio.ch/backupcommand: /bin/sh -c "if [[ $MARIADB_HOST ]]; then dump=$(mktemp) && mysqldump --max-allowed-packet=500M --events --routines --quick --add-locks --no-autocommit --single-transaction --no-create-db -h $MARIADB_HOST -u $MARIADB_USERNAME -p$MARIADB_PASSWORD $MARIADB_DATABASE > $dump && cat $dump && rm $dump; fi" - backup.appuio.ch/file-extension: .mysql.sql - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - spec: - tolerations: - - effect: NoSchedule - key: autoscaled - operator: Equal - value: 'true' - - effect: NoSchedule - key: appuio.ch/autoscaled - operator: Equal - value: 'true' - volumes: - - name: ${PERSISTENT_STORAGE_NAME} - persistentVolumeClaim: - claimName: ${PERSISTENT_STORAGE_NAME} - - name: lagoon-sshkey - secret: - defaultMode: 420 - secretName: lagoon-sshkey - containers: - - image: ${SERVICE_IMAGE} - name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} - envFrom: - - configMapRef: - name: lagoon-env - env: - ## LAGOON_GIT_SHA is injected directly and not loaded via `lagoon-env` config - ## This will cause the cli to redeploy on every deployment, even the files have not changed - - name: LAGOON_GIT_SHA - value: ${LAGOON_GIT_SHA} - - name: SERVICE_NAME - value: ${SERVICE_NAME} - - name: CRONJOBS - value: ${CRONJOBS} - volumeMounts: - - name: ${PERSISTENT_STORAGE_NAME} - mountPath: ${PERSISTENT_STORAGE_PATH} - - mountPath: /var/run/secrets/lagoon/sshkey/ - name: lagoon-sshkey - readOnly: true - resources: - requests: - cpu: 10m - memory: 10Mi - test: false - triggers: - - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/cli/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/cli/deployment.ymlbak deleted file mode 100644 index be15d61561..0000000000 --- a/images/oc-build-deploy-dind/openshift-templates/cli/deployment.ymlbak +++ /dev/null @@ -1,113 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - creationTimestamp: null - name: lagoon-openshift-template-cli -parameters: - - name: SERVICE_NAME - description: Name of this service - required: true - - name: SAFE_BRANCH - description: Which branch this belongs to, special chars replaced with dashes - required: true - - name: SAFE_PROJECT - description: Which project this belongs to, special chars replaced with dashes - required: true - - name: BRANCH - description: Which branch this belongs to, original value - required: true - - name: PROJECT - description: Which project this belongs to, original value - required: true - - name: LAGOON_GIT_SHA - description: git hash sha of the current deployment - required: true - - name: SERVICE_ROUTER_URL - description: URL of the Router for this service - value: '' - - name: OPENSHIFT_PROJECT - description: Name of the Project that this service is in - required: true - - name: REGISTRY - description: Registry where Images are pushed to - required: true - - name: DEPLOYMENT_STRATEGY - description: Strategy of Deploymentconfig - value: 'Rolling' - - name: SERVICE_IMAGE - description: Pullable image of service - required: true - - name: CRONJOBS - description: Oneliner of Cronjobs - value: '' - - name: ENVIRONMENT_TYPE - description: production level of this environment - required: true -objects: - - apiVersion: v1 - kind: DeploymentConfig - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - name: ${SERVICE_NAME} - spec: - replicas: 1 - selector: - service: ${SERVICE_NAME} - strategy: - type: ${DEPLOYMENT_STRATEGY} - template: - metadata: - annotations: - appuio.ch/backupcommand: /bin/sh -c "if [[ $MARIADB_HOST ]]; then mysqldump --max-allowed-packet=500M --events --routines --quick --add-locks --no-autocommit --single-transaction --no-create-db -h $MARIADB_HOST -u $MARIADB_USERNAME -p$MARIADB_PASSWORD $MARIADB_DATABASE; fi" - backup.appuio.ch/file-extension: .mysql.sql - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - spec: - tolerations: - - effect: NoSchedule - key: autoscaled - operator: Equal - value: 'true' - - effect: NoSchedule - key: appuio.ch/autoscaled - operator: Equal - value: 'true' - volumes: - - name: lagoon-sshkey - secret: - defaultMode: 420 - secretName: lagoon-sshkey - containers: - - image: ${SERVICE_IMAGE} - name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} - envFrom: - - configMapRef: - name: lagoon-env - env: - ## LAGOON_GIT_SHA is injected directly and not loaded via `lagoon-env` config - ## This will cause the cli to redeploy on every deployment, even the files have not changed - - name: LAGOON_GIT_SHA - value: ${LAGOON_GIT_SHA} - - name: SERVICE_NAME - value: ${SERVICE_NAME} - - name: CRONJOBS - value: ${CRONJOBS} - volumeMounts: - - mountPath: /var/run/secrets/lagoon/sshkey/ - name: lagoon-sshkey - readOnly: true - resources: - requests: - cpu: 10m - memory: 10Mi - test: false - triggers: - - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.ymlbak deleted file mode 100644 index 177d14f150..0000000000 --- a/images/oc-build-deploy-dind/openshift-templates/mariadb-single/deployment.ymlbak +++ /dev/null @@ -1,114 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - creationTimestamp: null - name: lagoon-openshift-template-mariadb -parameters: - - name: SERVICE_NAME - description: Name of this service - required: true - - name: SAFE_BRANCH - description: Which branch this belongs to, special chars replaced with dashes - required: true - - name: SAFE_PROJECT - description: Which project this belongs to, special chars replaced with dashes - required: true - - name: BRANCH - description: Which branch this belongs to, original value - required: true - - name: PROJECT - description: Which project this belongs to, original value - required: true - - name: LAGOON_GIT_SHA - description: git hash sha of the current deployment - required: true - - name: SERVICE_ROUTER_URL - description: URL of the Router for this service - value: "" - - name: OPENSHIFT_PROJECT - description: Name of the Project that this service is in - required: true - - name: REGISTRY - description: Registry where Images are pushed to - required: true - - name: DEPLOYMENT_STRATEGY - description: Strategy of Deploymentconfig - value: "Recreate" - - name: SERVICE_IMAGE - description: Pullable image of service - required: true - - name: CRONJOBS - description: Oneline of Cronjobs - value: "" - - name: PERSISTENT_STORAGE_SIZE - description: Size of the Storage to request - value: "5Gi" - - name: ENVIRONMENT_TYPE - description: production level of this environment - required: true -objects: -- apiVersion: v1 - kind: DeploymentConfig - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - name: ${SERVICE_NAME} - spec: - replicas: 1 - selector: - service: ${SERVICE_NAME} - strategy: - type: ${DEPLOYMENT_STRATEGY} - template: - metadata: - annotations: - appuio.ch/backupcommand: /bin/sh -c "mysqldump --max-allowed-packet=500M --events --routines --quick --add-locks --no-autocommit --single-transaction --all-databases" - backup.appuio.ch/file-extension: .${SERVICE_NAME}.sql - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - spec: - volumes: - - name: ${SERVICE_NAME}-data - persistentVolumeClaim: - claimName: ${SERVICE_NAME}-data - containers: - - image: ${SERVICE_IMAGE} - name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} - ports: - - containerPort: 3306 - protocol: TCP - readinessProbe: - tcpSocket: - port: 3306 - initialDelaySeconds: 15 - timeoutSeconds: 1 - livenessProbe: - tcpSocket: - port: 3306 - initialDelaySeconds: 120 - periodSeconds: 5 - volumeMounts: - - name: ${SERVICE_NAME}-data - mountPath: /var/lib/mysql - env: - - name: SERVICE_NAME - value: ${SERVICE_NAME} - - name: CRONJOBS - value: ${CRONJOBS} - envFrom: - - configMapRef: - name: lagoon-env - resources: - requests: - cpu: 10m - memory: 10Mi - test: false - triggers: - - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/mongo/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/mongo/deployment.ymlbak deleted file mode 100644 index 6ab0a75767..0000000000 --- a/images/oc-build-deploy-dind/openshift-templates/mongo/deployment.ymlbak +++ /dev/null @@ -1,104 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - creationTimestamp: null - name: lagoon-openshift-template-mongo -parameters: - - name: SERVICE_NAME - description: Name of this service - required: true - - name: SAFE_BRANCH - description: Which branch this belongs to, special chars replaced with dashes - required: true - - name: SAFE_PROJECT - description: Which project this belongs to, special chars replaced with dashes - required: true - - name: BRANCH - description: Which branch this belongs to, original value - required: true - - name: PROJECT - description: Which project this belongs to, original value - required: true - - name: LAGOON_GIT_SHA - description: git hash sha of the current deployment - required: true - - name: SERVICE_ROUTER_URL - description: URL of the Router for this service - value: "" - - name: OPENSHIFT_PROJECT - description: Name of the Project that this service is in - required: true - - name: REGISTRY - description: Registry where Images are pushed to - required: true - - name: DEPLOYMENT_STRATEGY - description: Strategy of Deploymentconfig - value: "Recreate" - - name: SERVICE_IMAGE - description: Pullable image of service - required: true - - name: CRONJOBS - description: Oneliner of Cronjobs - value: "" - - name: ENVIRONMENT_TYPE - description: production level of this environment - required: true -objects: -- apiVersion: v1 - kind: DeploymentConfig - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - name: ${SERVICE_NAME} - spec: - replicas: 1 - selector: - service: ${SERVICE_NAME} - strategy: - type: ${DEPLOYMENT_STRATEGY} - resources: {} - template: - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - spec: - volumes: - - name: ${SERVICE_NAME} - persistentVolumeClaim: - claimName: ${SERVICE_NAME} - containers: - - image: ${SERVICE_IMAGE} - name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} - ports: - - containerPort: 27017 - protocol: TCP - readinessProbe: - tcpSocket: - port: 27017 - initialDelaySeconds: 15 - timeoutSeconds: 1 - envFrom: - - configMapRef: - name: lagoon-env - env: - - name: SERVICE_NAME - value: ${SERVICE_NAME} - - name: CRONJOBS - value: ${CRONJOBS} - volumeMounts: - - name: ${SERVICE_NAME} - mountPath: /data/db - resources: - requests: - cpu: 10m - memory: 10Mi - test: false - triggers: - - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.ymlbak deleted file mode 100644 index be472523f8..0000000000 --- a/images/oc-build-deploy-dind/openshift-templates/nginx-php-persistent/deployment.ymlbak +++ /dev/null @@ -1,177 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - creationTimestamp: null - name: lagoon-openshift-template-nginx-php -parameters: - - name: SERVICE_NAME - description: Name of this service - required: true - - name: SAFE_BRANCH - description: Which branch this belongs to, special chars replaced with dashes - required: true - - name: SAFE_PROJECT - description: Which project this belongs to, special chars replaced with dashes - required: true - - name: BRANCH - description: Which branch this belongs to, original value - required: true - - name: PROJECT - description: Which project this belongs to, original value - required: true - - name: LAGOON_GIT_SHA - description: git hash sha of the current deployment - required: true - - name: SERVICE_ROUTER_URL - description: URL of the Router for this service - value: '' - - name: OPENSHIFT_PROJECT - description: Name of the Project that this service is in - required: true - - name: REGISTRY - description: Registry where Images are pushed to - required: true - - name: PERSISTENT_STORAGE_PATH - description: Full path to which should be mounted into persistent storage - required: true - - name: PERSISTENT_STORAGE_CLASS - description: Name of the Storage Class to use - value: '' - - name: PERSISTENT_STORAGE_SIZE - description: Size of the Storage to request - value: '5Gi' - - name: DEPLOYMENT_STRATEGY - description: Strategy of Deploymentconfig - value: 'Rolling' - - name: NGINX_SERVICE_IMAGE - description: Pullable image of nginx service - required: true - - name: PHP_SERVICE_IMAGE - description: Pullable image of php service - required: true - - name: NGINX_SERVICE_NAME - description: Name of nginx service - value: 'nginx' - - name: PHP_SERVICE_NAME - description: Name of php service - value: 'php' - - name: CRONJOBS - description: Oneliner of Cronjobs - value: '' - - name: ENVIRONMENT_TYPE - description: production level of this environment - required: true -objects: - - apiVersion: v1 - kind: DeploymentConfig - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - name: ${SERVICE_NAME} - spec: - replicas: 1 - selector: - service: ${SERVICE_NAME} - strategy: - type: ${DEPLOYMENT_STRATEGY} - template: - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - spec: - tolerations: - - effect: NoSchedule - key: autoscaled - operator: Equal - value: 'true' - - effect: NoSchedule - key: appuio.ch/autoscaled - operator: Equal - value: 'true' - volumes: - - name: ${SERVICE_NAME} - persistentVolumeClaim: - claimName: ${SERVICE_NAME} - containers: - - image: ${NGINX_SERVICE_IMAGE} - name: ${NGINX_SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} - ports: - - containerPort: 8080 - protocol: TCP - readinessProbe: - httpGet: - path: /nginx_status - port: 50000 - initialDelaySeconds: 5 - timeoutSeconds: 3 - livenessProbe: - httpGet: - path: /nginx_status - port: 50000 - initialDelaySeconds: 90 - timeoutSeconds: 3 - failureThreshold: 5 - envFrom: - - configMapRef: - name: lagoon-env - env: - ## LAGOON_GIT_SHA is injected directly and not loaded via `lagoon-env` config - ## This will cause the cli to redeploy on every deployment, even the files have not changed - - name: LAGOON_GIT_SHA - value: ${LAGOON_GIT_SHA} - - name: NGINX_FASTCGI_PASS - value: '127.0.0.1' - volumeMounts: - - name: ${SERVICE_NAME} - mountPath: ${PERSISTENT_STORAGE_PATH} - resources: - requests: - cpu: 10m - memory: 10Mi - - image: ${PHP_SERVICE_IMAGE} - name: ${PHP_SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} - ports: - - containerPort: 9000 - protocol: TCP - readinessProbe: - exec: - command: - - /usr/sbin/check_fcgi - initialDelaySeconds: 2 - periodSeconds: 5 - livenessProbe: - exec: - command: - - /usr/sbin/check_fcgi - initialDelaySeconds: 60 - periodSeconds: 5 - envFrom: - - configMapRef: - name: lagoon-env - env: - ## LAGOON_GIT_SHA is injected directly and not loaded via `lagoon-env` config - ## This will cause the cli to redeploy on every deployment, even the files have not changed - - name: LAGOON_GIT_SHA - value: ${LAGOON_GIT_SHA} - - name: SERVICE_NAME - value: ${SERVICE_NAME} - - name: CRONJOBS - value: ${CRONJOBS} - volumeMounts: - - name: ${SERVICE_NAME} - mountPath: ${PERSISTENT_STORAGE_PATH} - resources: - requests: - cpu: 10m - memory: 10Mi - test: false - triggers: - - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx-php-redis-persistent/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/nginx-php-redis-persistent/deployment.ymlbak deleted file mode 100644 index 584e7a2832..0000000000 --- a/images/oc-build-deploy-dind/openshift-templates/nginx-php-redis-persistent/deployment.ymlbak +++ /dev/null @@ -1,211 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - creationTimestamp: null - name: lagoon-openshift-template-nginx-php-redis -parameters: - - name: SERVICE_NAME - description: Name of this service - required: true - - name: SAFE_BRANCH - description: Which branch this belongs to, special chars replaced with dashes - required: true - - name: SAFE_PROJECT - description: Which project this belongs to, special chars replaced with dashes - required: true - - name: BRANCH - description: Which branch this belongs to, original value - required: true - - name: PROJECT - description: Which project this belongs to, original value - required: true - - name: LAGOON_GIT_SHA - description: git hash sha of the current deployment - required: true - - name: SERVICE_ROUTER_URL - description: URL of the Router for this service - value: '' - - name: OPENSHIFT_PROJECT - description: Name of the Project that this service is in - required: true - - name: REGISTRY - description: Registry where Images are pushed to - required: true - - name: PERSISTENT_STORAGE_PATH - description: Full path to which should be mounted into persistent storage - required: true - - name: PERSISTENT_STORAGE_CLASS - description: Name of the Storage Class to use - value: '' - - name: PERSISTENT_STORAGE_SIZE - description: Size of the Storage to request - value: '5Gi' - - name: DEPLOYMENT_STRATEGY - description: Strategy of Deploymentconfig - value: 'Rolling' - - name: NGINX_SERVICE_IMAGE - description: Pullable image of nginx service - required: true - - name: PHP_SERVICE_IMAGE - description: Pullable image of php service - required: true - - name: REDIS_SERVICE_IMAGE - description: Pullable image of php service - required: true - - name: NGINX_SERVICE_NAME - description: Name of nginx service - value: 'nginx' - - name: PHP_SERVICE_NAME - description: Name of php service - value: 'php' - - name: REDIS_SERVICE_NAME - description: Name of php service - value: 'redis' - - name: CRONJOBS - description: Oneliner of Cronjobs - value: '' - - name: ENVIRONMENT_TYPE - description: production level of this environment - required: true -objects: - - apiVersion: v1 - kind: DeploymentConfig - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - name: ${SERVICE_NAME} - spec: - replicas: 1 - selector: - service: ${SERVICE_NAME} - strategy: - type: ${DEPLOYMENT_STRATEGY} - template: - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - spec: - tolerations: - - effect: NoSchedule - key: autoscaled - operator: Equal - value: 'true' - - effect: NoSchedule - key: appuio.ch/autoscaled - operator: Equal - value: 'true' - volumes: - - name: ${SERVICE_NAME} - persistentVolumeClaim: - claimName: ${SERVICE_NAME} - containers: - - image: ${NGINX_SERVICE_IMAGE} - name: ${NGINX_SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} - ports: - - containerPort: 8080 - protocol: TCP - readinessProbe: - httpGet: - path: /nginx_status - port: 50000 - initialDelaySeconds: 5 - timeoutSeconds: 3 - livenessProbe: - httpGet: - path: /nginx_status - port: 50000 - initialDelaySeconds: 90 - timeoutSeconds: 3 - failureThreshold: 5 - envFrom: - - configMapRef: - name: lagoon-env - env: - ## LAGOON_GIT_SHA is injected directly and not loaded via `lagoon-env` config - ## This will cause the cli to redeploy on every deployment, even the files have not changed - - name: LAGOON_GIT_SHA - value: ${LAGOON_GIT_SHA} - - name: NGINX_FASTCGI_PASS - value: '127.0.0.1' - - name: REDIS_HOST - value: '127.0.0.1' - volumeMounts: - - name: ${SERVICE_NAME} - mountPath: ${PERSISTENT_STORAGE_PATH} - resources: - requests: - cpu: 10m - memory: 10Mi - - image: ${PHP_SERVICE_IMAGE} - name: ${PHP_SERVICE_NAME} - ports: - - containerPort: 9000 - protocol: TCP - readinessProbe: - exec: - command: - - /usr/sbin/check_fcgi - initialDelaySeconds: 2 - periodSeconds: 5 - livenessProbe: - exec: - command: - - /usr/sbin/check_fcgi - initialDelaySeconds: 60 - periodSeconds: 5 - envFrom: - - configMapRef: - name: lagoon-env - env: - ## LAGOON_GIT_SHA is injected directly and not loaded via `lagoon-env` config - ## This will cause the cli to redeploy on every deployment, even the files have not changed - - name: LAGOON_GIT_SHA - value: ${LAGOON_GIT_SHA} - - name: SERVICE_NAME - value: ${SERVICE_NAME} - - name: CRONJOBS - value: ${CRONJOBS} - - name: REDIS_HOST - value: '127.0.0.1' - volumeMounts: - - name: ${SERVICE_NAME} - mountPath: ${PERSISTENT_STORAGE_PATH} - resources: - requests: - cpu: 10m - memory: 10Mi - - image: ${REDIS_SERVICE_IMAGE} - name: ${REDIS_SERVICE_NAME} - ports: - - containerPort: 6379 - protocol: TCP - readinessProbe: - tcpSocket: - port: 6379 - initialDelaySeconds: 15 - timeoutSeconds: 1 - livenessProbe: - tcpSocket: - port: 6379 - initialDelaySeconds: 120 - periodSeconds: 5 - envFrom: - - configMapRef: - name: lagoon-env - env: - - name: SERVICE_NAME - value: ${SERVICE_NAME} - resources: - requests: - cpu: 10m - memory: 10Mi - test: false - triggers: - - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx-php/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/nginx-php/deployment.ymlbak deleted file mode 100644 index 8b1a685d42..0000000000 --- a/images/oc-build-deploy-dind/openshift-templates/nginx-php/deployment.ymlbak +++ /dev/null @@ -1,158 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - creationTimestamp: null - name: lagoon-openshift-template-nginx-php -parameters: - - name: SERVICE_NAME - description: Name of this service - required: true - - name: SAFE_BRANCH - description: Which branch this belongs to, special chars replaced with dashes - required: true - - name: SAFE_PROJECT - description: Which project this belongs to, special chars replaced with dashes - required: true - - name: BRANCH - description: Which branch this belongs to, original value - required: true - - name: PROJECT - description: Which project this belongs to, original value - required: true - - name: LAGOON_GIT_SHA - description: git hash sha of the current deployment - required: true - - name: SERVICE_ROUTER_URL - description: URL of the Router for this service - value: '' - - name: OPENSHIFT_PROJECT - description: Name of the Project that this service is in - required: true - - name: REGISTRY - description: Registry where Images are pushed to - required: true - - name: DEPLOYMENT_STRATEGY - description: Strategy of Deploymentconfig - value: 'Rolling' - - name: NGINX_SERVICE_IMAGE - description: Pullable image of nginx service - required: true - - name: PHP_SERVICE_IMAGE - description: Pullable image of php service - required: true - - name: NGINX_SERVICE_NAME - description: Name of nginx service - value: 'nginx' - - name: PHP_SERVICE_NAME - description: Name of php service - value: 'php' - - name: CRONJOBS - description: Oneliner of Cronjobs - value: '' - - name: ENVIRONMENT_TYPE - description: production level of this environment - required: true -objects: - - apiVersion: v1 - kind: DeploymentConfig - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - name: ${SERVICE_NAME} - spec: - replicas: 1 - selector: - service: ${SERVICE_NAME} - strategy: - type: ${DEPLOYMENT_STRATEGY} - template: - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - spec: - tolerations: - - effect: NoSchedule - key: autoscaled - operator: Equal - value: 'true' - - effect: NoSchedule - key: appuio.ch/autoscaled - operator: Equal - value: 'true' - containers: - - image: ${NGINX_SERVICE_IMAGE} - name: ${NGINX_SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} - ports: - - containerPort: 8080 - protocol: TCP - readinessProbe: - httpGet: - path: /nginx_status - port: 50000 - initialDelaySeconds: 5 - timeoutSeconds: 3 - livenessProbe: - httpGet: - path: /nginx_status - port: 50000 - initialDelaySeconds: 90 - timeoutSeconds: 3 - failureThreshold: 5 - envFrom: - - configMapRef: - name: lagoon-env - env: - ## LAGOON_GIT_SHA is injected directly and not loaded via `lagoon-env` config - ## This will cause the cli to redeploy on every deployment, even the files have not changed - - name: LAGOON_GIT_SHA - value: ${LAGOON_GIT_SHA} - - name: NGINX_FASTCGI_PASS - value: '127.0.0.1' - resources: - requests: - cpu: 10m - memory: 10Mi - - image: ${PHP_SERVICE_IMAGE} - name: ${PHP_SERVICE_NAME} - ports: - - containerPort: 9000 - protocol: TCP - readinessProbe: - exec: - command: - - /usr/sbin/check_fcgi - initialDelaySeconds: 2 - periodSeconds: 5 - livenessProbe: - exec: - command: - - /usr/sbin/check_fcgi - initialDelaySeconds: 60 - periodSeconds: 5 - envFrom: - - configMapRef: - name: lagoon-env - env: - ## LAGOON_GIT_SHA is injected directly and not loaded via `lagoon-env` config - ## This will cause the cli to redeploy on every deployment, even the files have not changed - - name: LAGOON_GIT_SHA - value: ${LAGOON_GIT_SHA} - - name: SERVICE_NAME - value: ${SERVICE_NAME} - - name: CRONJOBS - value: ${CRONJOBS} - resources: - requests: - cpu: 10m - memory: 10Mi - test: false - triggers: - - type: ConfigChange - status: {} diff --git a/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.ymlbak deleted file mode 100644 index e916b34f8a..0000000000 --- a/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.ymlbak +++ /dev/null @@ -1,119 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - creationTimestamp: null - name: lagoon-openshift-template-nginx -parameters: - - name: SERVICE_NAME - description: Name of this service - required: true - - name: SAFE_BRANCH - description: Which branch this belongs to, special chars replaced with dashes - required: true - - name: SAFE_PROJECT - description: Which project this belongs to, special chars replaced with dashes - required: true - - name: BRANCH - description: Which branch this belongs to, original value - required: true - - name: PROJECT - description: Which project this belongs to, original value - required: true - - name: LAGOON_GIT_SHA - description: git hash sha of the current deployment - required: true - - name: SERVICE_ROUTER_URL - description: URL of the Router for this service - value: '' - - name: OPENSHIFT_PROJECT - description: Name of the Project that this service is in - required: true - - name: REGISTRY - description: Registry where Images are pushed to - required: true - - name: DEPLOYMENT_STRATEGY - description: Strategy of Deploymentconfig - value: 'Rolling' - - name: SERVICE_IMAGE - description: Pullable image of service - required: true - - name: CRONJOBS - description: Oneliner of Cronjobs - value: '' - - name: ENVIRONMENT_TYPE - description: production level of this environment - required: true -objects: - - apiVersion: v1 - kind: DeploymentConfig - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - name: ${SERVICE_NAME} - spec: - - replicas: 1 - selector: - service: ${SERVICE_NAME} - strategy: - type: ${DEPLOYMENT_STRATEGY} - template: - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - spec: - tolerations: - - effect: NoSchedule - key: autoscaled - operator: Equal - value: 'true' - - effect: NoSchedule - key: appuio.ch/autoscaled - operator: Equal - value: 'true' - containers: - - image: ${SERVICE_IMAGE} - name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} - ports: - - containerPort: 8080 - protocol: TCP - readinessProbe: - httpGet: - path: /nginx_status - port: 50000 - initialDelaySeconds: 5 - timeoutSeconds: 3 - livenessProbe: - httpGet: - path: /nginx_status - port: 50000 - initialDelaySeconds: 90 - timeoutSeconds: 3 - failureThreshold: 5 - envFrom: - - configMapRef: - name: lagoon-env - env: - ## LAGOON_GIT_SHA is injected directly and not loaded via `lagoon-env` config - ## This will cause the cli to redeploy on every deployment, even the files have not changed - - name: LAGOON_GIT_SHA - value: ${LAGOON_GIT_SHA} - - name: SERVICE_NAME - value: ${SERVICE_NAME} - - name: CRONJOBS - value: ${CRONJOBS} - resources: - requests: - cpu: 10m - memory: 10Mi - test: false - triggers: - - type: ConfigChange - status: {} diff --git a/images/oc-build-deploy-dind/openshift-templates/node-persistent/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/node-persistent/deployment.ymlbak deleted file mode 100644 index 0ecde97c80..0000000000 --- a/images/oc-build-deploy-dind/openshift-templates/node-persistent/deployment.ymlbak +++ /dev/null @@ -1,133 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - creationTimestamp: null - name: lagoon-openshift-template-node -parameters: - - name: SERVICE_NAME - description: Name of this service - required: true - - name: SAFE_BRANCH - description: Which branch this belongs to, special chars replaced with dashes - required: true - - name: SAFE_PROJECT - description: Which project this belongs to, special chars replaced with dashes - required: true - - name: BRANCH - description: Which branch this belongs to, original value - required: true - - name: PROJECT - description: Which project this belongs to, original value - required: true - - name: LAGOON_GIT_SHA - description: git hash sha of the current deployment - required: true - - name: SERVICE_ROUTER_URL - description: URL of the Router for this service - value: '' - - name: OPENSHIFT_PROJECT - description: Name of the Project that this service is in - required: true - - name: REGISTRY - description: Registry where Images are pushed to - required: true - - name: PERSISTENT_STORAGE_PATH - description: Full path to which should be mounted into persistent storage - required: true - - name: PERSISTENT_STORAGE_CLASS - description: Name of the Storage Class to use - value: '' - - name: PERSISTENT_STORAGE_SIZE - description: Size of the Storage to request - value: '5Gi' - - name: DEPLOYMENT_STRATEGY - description: Strategy of Deploymentconfig - value: 'Rolling' - - name: SERVICE_IMAGE - description: Pullable image of service - required: true - - name: CRONJOBS - description: Oneliner of Cronjobs - value: '' - - name: ENVIRONMENT_TYPE - description: production level of this environment - required: true -objects: - - apiVersion: v1 - kind: DeploymentConfig - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - name: ${SERVICE_NAME} - spec: - replicas: 1 - selector: - service: ${SERVICE_NAME} - strategy: - type: ${DEPLOYMENT_STRATEGY} - template: - metadata: - annotations: - appuio.ch/backupcommand: /bin/sh -c "/bin/busybox tar -cf - -C ${PERSISTENT_STORAGE_PATH} ." - backup.appuio.ch/file-extension: .${SERVICE_NAME}.tar - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - spec: - tolerations: - - effect: NoSchedule - key: autoscaled - operator: Equal - value: 'true' - - effect: NoSchedule - key: appuio.ch/autoscaled - operator: Equal - value: 'true' - volumes: - - name: ${SERVICE_NAME} - persistentVolumeClaim: - claimName: ${SERVICE_NAME} - containers: - - image: ${SERVICE_IMAGE} - name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} - ports: - - containerPort: 3000 - protocol: TCP - readinessProbe: - tcpSocket: - port: 3000 - initialDelaySeconds: 15 - timeoutSeconds: 1 - livenessProbe: - tcpSocket: - port: 3000 - initialDelaySeconds: 60 - periodSeconds: 5 - envFrom: - - configMapRef: - name: lagoon-env - env: - ## LAGOON_GIT_SHA is injected directly and not loaded via `lagoon-env` config - ## This will cause the cli to redeploy on every deployment, even the files have not changed - - name: LAGOON_GIT_SHA - value: ${LAGOON_GIT_SHA} - - name: SERVICE_NAME - value: ${SERVICE_NAME} - - name: CRONJOBS - value: ${CRONJOBS} - volumeMounts: - - name: ${SERVICE_NAME} - mountPath: ${PERSISTENT_STORAGE_PATH} - resources: - requests: - cpu: 10m - memory: 10Mi - test: false - triggers: - - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/node/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/node/deployment.ymlbak deleted file mode 100644 index 1cc596e322..0000000000 --- a/images/oc-build-deploy-dind/openshift-templates/node/deployment.ymlbak +++ /dev/null @@ -1,114 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - creationTimestamp: null - name: lagoon-openshift-template-node -parameters: - - name: SERVICE_NAME - description: Name of this service - required: true - - name: SAFE_BRANCH - description: Which branch this belongs to, special chars replaced with dashes - required: true - - name: SAFE_PROJECT - description: Which project this belongs to, special chars replaced with dashes - required: true - - name: BRANCH - description: Which branch this belongs to, original value - required: true - - name: PROJECT - description: Which project this belongs to, original value - required: true - - name: LAGOON_GIT_SHA - description: git hash sha of the current deployment - required: true - - name: SERVICE_ROUTER_URL - description: URL of the Router for this service - value: '' - - name: OPENSHIFT_PROJECT - description: Name of the Project that this service is in - required: true - - name: REGISTRY - description: Registry where Images are pushed to - required: true - - name: DEPLOYMENT_STRATEGY - description: Strategy of Deploymentconfig - value: 'Rolling' - - name: SERVICE_IMAGE - description: Pullable image of service - required: true - - name: CRONJOBS - description: Oneliner of Cronjobs - value: '' - - name: ENVIRONMENT_TYPE - description: production level of this environment - required: true -objects: - - apiVersion: v1 - kind: DeploymentConfig - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - name: ${SERVICE_NAME} - spec: - replicas: 1 - selector: - service: ${SERVICE_NAME} - strategy: - type: ${DEPLOYMENT_STRATEGY} - template: - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - spec: - tolerations: - - effect: NoSchedule - key: autoscaled - operator: Equal - value: 'true' - - effect: NoSchedule - key: appuio.ch/autoscaled - operator: Equal - value: 'true' - containers: - - image: ${SERVICE_IMAGE} - name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} - ports: - - containerPort: 3000 - protocol: TCP - readinessProbe: - tcpSocket: - port: 3000 - initialDelaySeconds: 15 - timeoutSeconds: 1 - livenessProbe: - tcpSocket: - port: 3000 - initialDelaySeconds: 60 - periodSeconds: 5 - envFrom: - - configMapRef: - name: lagoon-env - env: - ## LAGOON_GIT_SHA is injected directly and not loaded via `lagoon-env` config - ## This will cause the cli to redeploy on every deployment, even the files have not changed - - name: LAGOON_GIT_SHA - value: ${LAGOON_GIT_SHA} - - name: SERVICE_NAME - value: ${SERVICE_NAME} - - name: CRONJOBS - value: ${CRONJOBS} - resources: - requests: - cpu: 10m - memory: 10Mi - test: false - triggers: - - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/postgres/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/postgres/deployment.ymlbak deleted file mode 100644 index b68adc423f..0000000000 --- a/images/oc-build-deploy-dind/openshift-templates/postgres/deployment.ymlbak +++ /dev/null @@ -1,108 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - creationTimestamp: null - name: lagoon-openshift-template-postgres -parameters: - - name: SERVICE_NAME - description: Name of this service - required: true - - name: SAFE_BRANCH - description: Which branch this belongs to, special chars replaced with dashes - required: true - - name: SAFE_PROJECT - description: Which project this belongs to, special chars replaced with dashes - required: true - - name: BRANCH - description: Which branch this belongs to, original value - required: true - - name: PROJECT - description: Which project this belongs to, original value - required: true - - name: LAGOON_GIT_SHA - description: git hash sha of the current deployment - required: true - - name: SERVICE_ROUTER_URL - description: URL of the Router for this service - value: "" - - name: OPENSHIFT_PROJECT - description: Name of the Project that this service is in - required: true - - name: REGISTRY - description: Registry where Images are pushed to - required: true - - name: DEPLOYMENT_STRATEGY - description: Strategy of Deploymentconfig - value: "Recreate" - - name: POSTGRES_SERVICE_IMAGE - description: Pullable image of postgres service - required: true - - name: CRONJOBS - description: Oneliner of Cronjobs - value: "" - - name: ENVIRONMENT_TYPE - description: production level of this environment - required: true -objects: -- apiVersion: v1 - kind: DeploymentConfig - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - name: ${SERVICE_NAME} - spec: - replicas: 1 - selector: - service: ${SERVICE_NAME} - strategy: - type: ${DEPLOYMENT_STRATEGY} - template: - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - spec: - volumes: - - name: ${SERVICE_NAME} - persistentVolumeClaim: - claimName: ${SERVICE_NAME} - containers: - - image: ${POSTGRES_SERVICE_IMAGE} - name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} - ports: - - containerPort: 5432 - protocol: TCP - readinessProbe: - tcpSocket: - port: 5432 - initialDelaySeconds: 15 - timeoutSeconds: 1 - livenessProbe: - tcpSocket: - port: 5432 - initialDelaySeconds: 120 - periodSeconds: 5 - volumeMounts: - - name: ${SERVICE_NAME} - mountPath: /var/lib/postgresql/data - envFrom: - - configMapRef: - name: lagoon-env - env: - - name: SERVICE_NAME - value: ${SERVICE_NAME} - - name: CRONJOBS - value: ${CRONJOBS} - resources: - requests: - cpu: 10m - memory: 10Mi - test: false - triggers: - - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/rabbitmq/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/rabbitmq/deployment.ymlbak deleted file mode 100644 index 9da67df087..0000000000 --- a/images/oc-build-deploy-dind/openshift-templates/rabbitmq/deployment.ymlbak +++ /dev/null @@ -1,107 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - creationTimestamp: null - name: lagoon-openshift-template-rabbitmq -parameters: - - name: SERVICE_NAME - description: Name of this service - required: true - - name: SAFE_BRANCH - description: Which branch this belongs to, special chars replaced with dashes - required: true - - name: SAFE_PROJECT - description: Which project this belongs to, special chars replaced with dashes - required: true - - name: BRANCH - description: Which branch this belongs to, original value - required: true - - name: PROJECT - description: Which project this belongs to, original value - required: true - - name: LAGOON_GIT_SHA - description: git hash sha of the current deployment - required: true - - name: SERVICE_ROUTER_URL - description: URL of the Router for this service - value: "" - - name: OPENSHIFT_PROJECT - description: Name of the Project that this service is in - required: true - - name: REGISTRY - description: Registry where Images are pushed to - required: true - - name: DEPLOYMENT_STRATEGY - description: Strategy of Deploymentconfig - value: "Rolling" - - name: SERVICE_IMAGE - description: Pullable image of service - required: true - - name: CRONJOBS - description: Oneliner of Cronjobs - value: "" - - name: ENVIRONMENT_TYPE - description: production level of this environment - required: true -objects: -- apiVersion: v1 - kind: DeploymentConfig - metadata: - creationTimestamp: null - labels: - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - name: ${SERVICE_NAME} - spec: - replicas: 1 - selector: - service: ${SERVICE_NAME} - strategy: - type: ${DEPLOYMENT_STRATEGY} - template: - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - spec: - containers: - - image: ${SERVICE_IMAGE} - name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} - ports: - - containerPort: 15672 - protocol: TCP - - containerPort: 5672 - protocol: TCP - readinessProbe: - tcpSocket: - port: 5672 - initialDelaySeconds: 15 - timeoutSeconds: 1 - envFrom: - - configMapRef: - name: lagoon-env - env: - - name: SERVICE_NAME - value: ${SERVICE_NAME} - - name: CRONJOBS - value: ${CRONJOBS} - - name: RABBITMQ_NODENAME - value: rabbitmq@localhost - resources: - requests: - cpu: 10m - memory: 10Mi - volumeMounts: - - mountPath: /var/lib/rabbitmq - name: ${SERVICE_NAME}-volume - volumes: - - name: ${SERVICE_NAME}-volume - persistentVolumeClaim: - claimName: ${SERVICE_NAME}-volume - test: false - triggers: - - type: ConfigChange - status: {} diff --git a/images/oc-build-deploy-dind/openshift-templates/redis-persistent/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/redis-persistent/deployment.ymlbak deleted file mode 100644 index 3825418fef..0000000000 --- a/images/oc-build-deploy-dind/openshift-templates/redis-persistent/deployment.ymlbak +++ /dev/null @@ -1,120 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - creationTimestamp: null - name: lagoon-openshift-template-redis -parameters: - - name: SERVICE_NAME - description: Name of this service - required: true - - name: SAFE_BRANCH - description: Which branch this belongs to, special chars replaced with dashes - required: true - - name: SAFE_PROJECT - description: Which project this belongs to, special chars replaced with dashes - required: true - - name: BRANCH - description: Which branch this belongs to, original value - required: true - - name: PROJECT - description: Which project this belongs to, original value - required: true - - name: LAGOON_GIT_SHA - description: git hash sha of the current deployment - required: true - - name: SERVICE_ROUTER_URL - description: URL of the Router for this service - value: "" - - name: OPENSHIFT_PROJECT - description: Name of the Project that this service is in - required: true - - name: REGISTRY - description: Registry where Images are pushed to - required: true - - name: DEPLOYMENT_STRATEGY - description: Strategy of Deploymentconfig - value: "Recreate" - - name: SERVICE_IMAGE - description: Pullable image of service - required: true - - name: CRONJOBS - description: Oneliner of Cronjobs - value: "" - - name: PERSISTENT_STORAGE_PATH - description: Full path to which should be mounted into persistent storage - value: "/data" - - name: PERSISTENT_STORAGE_CLASS - description: Name of the Storage Class to use - value: "bulk" - - name: PERSISTENT_STORAGE_SIZE - description: Size of the Storage to request - value: "1Gi" - - name: ENVIRONMENT_TYPE - description: production level of this environment - required: true -objects: -- apiVersion: v1 - kind: DeploymentConfig - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - name: ${SERVICE_NAME} - spec: - replicas: 1 - selector: - service: ${SERVICE_NAME} - strategy: - type: ${DEPLOYMENT_STRATEGY} - template: - metadata: - annotations: - appuio.ch/backupcommand: /bin/sh -c "/bin/busybox tar -cf - -C /data ." - backup.appuio.ch/file-extension: .${SERVICE_NAME}.tar - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - spec: - volumes: - - name: ${SERVICE_NAME} - persistentVolumeClaim: - claimName: ${SERVICE_NAME} - containers: - - image: ${SERVICE_IMAGE} - name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} - ports: - - containerPort: 6379 - protocol: TCP - volumeMounts: - - name: ${SERVICE_NAME} - mountPath: /data - readinessProbe: - tcpSocket: - port: 6379 - initialDelaySeconds: 15 - timeoutSeconds: 1 - livenessProbe: - tcpSocket: - port: 6379 - initialDelaySeconds: 120 - periodSeconds: 5 - envFrom: - - configMapRef: - name: lagoon-env - env: - - name: SERVICE_NAME - value: ${SERVICE_NAME} - - name: CRONJOBS - value: ${CRONJOBS} - resources: - requests: - cpu: 10m - memory: 10Mi - test: false - triggers: - - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/redis/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/redis/deployment.ymlbak deleted file mode 100644 index 515b272c2a..0000000000 --- a/images/oc-build-deploy-dind/openshift-templates/redis/deployment.ymlbak +++ /dev/null @@ -1,101 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - creationTimestamp: null - name: lagoon-openshift-template-redis -parameters: - - name: SERVICE_NAME - description: Name of this service - required: true - - name: SAFE_BRANCH - description: Which branch this belongs to, special chars replaced with dashes - required: true - - name: SAFE_PROJECT - description: Which project this belongs to, special chars replaced with dashes - required: true - - name: BRANCH - description: Which branch this belongs to, original value - required: true - - name: PROJECT - description: Which project this belongs to, original value - required: true - - name: LAGOON_GIT_SHA - description: git hash sha of the current deployment - required: true - - name: SERVICE_ROUTER_URL - description: URL of the Router for this service - value: "" - - name: OPENSHIFT_PROJECT - description: Name of the Project that this service is in - required: true - - name: REGISTRY - description: Registry where Images are pushed to - required: true - - name: DEPLOYMENT_STRATEGY - description: Strategy of Deploymentconfig - value: "Rolling" - - name: SERVICE_IMAGE - description: Pullable image of service - required: true - - name: CRONJOBS - description: Oneliner of Cronjobs - value: "" - - name: ENVIRONMENT_TYPE - description: production level of this environment - required: true -objects: -- apiVersion: v1 - kind: DeploymentConfig - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - name: ${SERVICE_NAME} - spec: - replicas: 1 - selector: - service: ${SERVICE_NAME} - strategy: - type: ${DEPLOYMENT_STRATEGY} - template: - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - spec: - containers: - - image: ${SERVICE_IMAGE} - name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} - ports: - - containerPort: 6379 - protocol: TCP - readinessProbe: - tcpSocket: - port: 6379 - initialDelaySeconds: 15 - timeoutSeconds: 1 - livenessProbe: - tcpSocket: - port: 6379 - initialDelaySeconds: 120 - periodSeconds: 5 - envFrom: - - configMapRef: - name: lagoon-env - env: - - name: SERVICE_NAME - value: ${SERVICE_NAME} - - name: CRONJOBS - value: ${CRONJOBS} - resources: - requests: - cpu: 10m - memory: 10Mi - test: false - triggers: - - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/solr/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/solr/deployment.ymlbak deleted file mode 100644 index 0eb8db2545..0000000000 --- a/images/oc-build-deploy-dind/openshift-templates/solr/deployment.ymlbak +++ /dev/null @@ -1,117 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - creationTimestamp: null - name: lagoon-openshift-template-solr -parameters: - - name: SERVICE_NAME - description: Name of this service - required: true - - name: SAFE_BRANCH - description: Which branch this belongs to, special chars replaced with dashes - required: true - - name: SAFE_PROJECT - description: Which project this belongs to, special chars replaced with dashes - required: true - - name: BRANCH - description: Which branch this belongs to, original value - required: true - - name: PROJECT - description: Which project this belongs to, original value - required: true - - name: LAGOON_GIT_SHA - description: git hash sha of the current deployment - required: true - - name: SERVICE_ROUTER_URL - description: URL of the Router for this service - value: "" - - name: OPENSHIFT_PROJECT - description: Name of the Project that this service is in - required: true - - name: REGISTRY - description: Registry where Images are pushed to - required: true - - name: DEPLOYMENT_STRATEGY - description: Strategy of Deploymentconfig - value: "Recreate" - - name: SERVICE_IMAGE - description: Pullable image of service - required: true - - name: CRONJOBS - description: Oneliner of Cronjobs - value: "" - - name: PERSISTENT_STORAGE_SIZE - description: Size of the Storage to request - value: "1Gi" - - name: ENVIRONMENT_TYPE - description: production level of this environment - required: true -objects: -- apiVersion: v1 - kind: DeploymentConfig - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - name: ${SERVICE_NAME} - spec: - replicas: 1 - selector: - service: ${SERVICE_NAME} - strategy: - type: ${DEPLOYMENT_STRATEGY} - template: - metadata: - annotations: - appuio.ch/backupcommand: /bin/sh -c "/bin/busybox tar -cf - -C /opt/solr/server/solr/mycores ." - backup.appuio.ch/file-extension: .${SERVICE_NAME}.tar - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - spec: - volumes: - - name: ${SERVICE_NAME} - persistentVolumeClaim: - claimName: ${SERVICE_NAME} - containers: - - image: ${SERVICE_IMAGE} - name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} - ports: - - containerPort: 8149 - protocol: TCP - readinessProbe: - httpGet: - path: /solr - port: 8983 - initialDelaySeconds: 5 - timeoutSeconds: 3 - livenessProbe: - httpGet: - path: /solr - port: 8983 - initialDelaySeconds: 90 - timeoutSeconds: 3 - failureThreshold: 5 - envFrom: - - configMapRef: - name: lagoon-env - env: - - name: SERVICE_NAME - value: ${SERVICE_NAME} - - name: CRONJOBS - value: ${CRONJOBS} - volumeMounts: - - name: ${SERVICE_NAME} - mountPath: /var/solr - resources: - requests: - cpu: 10m - memory: 10Mi - test: false - triggers: - - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/varnish-persistent/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/varnish-persistent/deployment.ymlbak deleted file mode 100644 index 28e634a17a..0000000000 --- a/images/oc-build-deploy-dind/openshift-templates/varnish-persistent/deployment.ymlbak +++ /dev/null @@ -1,120 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - creationTimestamp: null - name: lagoon-openshift-template-varnish -parameters: - - name: SERVICE_NAME - description: Name of this service - required: true - - name: SAFE_BRANCH - description: Which branch this belongs to, special chars replaced with dashes - required: true - - name: SAFE_PROJECT - description: Which project this belongs to, special chars replaced with dashes - required: true - - name: BRANCH - description: Which branch this belongs to, original value - required: true - - name: PROJECT - description: Which project this belongs to, original value - required: true - - name: LAGOON_GIT_SHA - description: git hash sha of the current deployment - required: true - - name: SERVICE_ROUTER_URL - description: URL of the Router for this service - value: '' - - name: OPENSHIFT_PROJECT - description: Name of the Project that this service is in - required: true - - name: REGISTRY - description: Registry where Images are pushed to - required: true - - name: DEPLOYMENT_STRATEGY - description: Strategy of Deploymentconfig - value: 'Rolling' - - name: SERVICE_IMAGE - description: Pullable image of service - required: true - - name: CRONJOBS - description: Oneliner of Cronjobs - value: '' - - name: ENVIRONMENT_TYPE - description: production level of this environment - required: true -objects: - - apiVersion: v1 - kind: DeploymentConfig - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - name: ${SERVICE_NAME} - spec: - replicas: 1 - selector: - service: ${SERVICE_NAME} - strategy: - type: ${DEPLOYMENT_STRATEGY} - template: - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - spec: - tolerations: - - effect: NoSchedule - key: autoscaled - operator: Equal - value: 'true' - - effect: NoSchedule - key: appuio.ch/autoscaled - operator: Equal - value: 'true' - volumes: - - name: ${SERVICE_NAME} - persistentVolumeClaim: - claimName: ${SERVICE_NAME} - containers: - - image: ${SERVICE_IMAGE} - name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} - ports: - - containerPort: 8080 - protocol: TCP - volumeMounts: - - name: ${SERVICE_NAME} - mountPath: /var/cache/varnish - readinessProbe: - httpGet: - path: /varnish_status - port: 8080 - initialDelaySeconds: 5 - timeoutSeconds: 3 - livenessProbe: - httpGet: - path: /varnish_status - port: 8080 - initialDelaySeconds: 90 - timeoutSeconds: 3 - failureThreshold: 5 - envFrom: - - configMapRef: - name: lagoon-env - env: - - name: SERVICE_NAME - value: ${SERVICE_NAME} - - name: CRONJOBS - value: ${CRONJOBS} - resources: - requests: - cpu: 10m - memory: 10Mi - test: false - triggers: - - type: ConfigChange diff --git a/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.ymlbak b/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.ymlbak deleted file mode 100644 index d04a0b632b..0000000000 --- a/images/oc-build-deploy-dind/openshift-templates/varnish/deployment.ymlbak +++ /dev/null @@ -1,113 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - creationTimestamp: null - name: lagoon-openshift-template-varnish -parameters: - - name: SERVICE_NAME - description: Name of this service - required: true - - name: SAFE_BRANCH - description: Which branch this belongs to, special chars replaced with dashes - required: true - - name: SAFE_PROJECT - description: Which project this belongs to, special chars replaced with dashes - required: true - - name: BRANCH - description: Which branch this belongs to, original value - required: true - - name: PROJECT - description: Which project this belongs to, original value - required: true - - name: LAGOON_GIT_SHA - description: git hash sha of the current deployment - required: true - - name: SERVICE_ROUTER_URL - description: URL of the Router for this service - value: '' - - name: OPENSHIFT_PROJECT - description: Name of the Project that this service is in - required: true - - name: REGISTRY - description: Registry where Images are pushed to - required: true - - name: DEPLOYMENT_STRATEGY - description: Strategy of Deploymentconfig - value: 'Rolling' - - name: SERVICE_IMAGE - description: Pullable image of service - required: true - - name: CRONJOBS - description: Oneliner of Cronjobs - value: '' - - name: ENVIRONMENT_TYPE - description: production level of this environment - required: true -objects: - - apiVersion: v1 - kind: DeploymentConfig - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - name: ${SERVICE_NAME} - spec: - replicas: 1 - selector: - service: ${SERVICE_NAME} - strategy: - type: ${DEPLOYMENT_STRATEGY} - template: - metadata: - creationTimestamp: null - labels: - service: ${SERVICE_NAME} - branch: ${SAFE_BRANCH} - project: ${SAFE_PROJECT} - spec: - tolerations: - - effect: NoSchedule - key: autoscaled - operator: Equal - value: 'true' - - effect: NoSchedule - key: appuio.ch/autoscaled - operator: Equal - value: 'true' - containers: - - image: ${SERVICE_IMAGE} - name: ${SERVICE_NAME} - priorityClassName: priority-${ENVIRONMENT_TYPE} - ports: - - containerPort: 8080 - protocol: TCP - readinessProbe: - httpGet: - path: /varnish_status - port: 8080 - initialDelaySeconds: 5 - timeoutSeconds: 3 - livenessProbe: - httpGet: - path: /varnish_status - port: 8080 - initialDelaySeconds: 90 - timeoutSeconds: 3 - failureThreshold: 5 - envFrom: - - configMapRef: - name: lagoon-env - env: - - name: SERVICE_NAME - value: ${SERVICE_NAME} - - name: CRONJOBS - value: ${CRONJOBS} - resources: - requests: - cpu: 10m - memory: 10Mi - test: false - triggers: - - type: ConfigChange From 4bda311101696ac6d8464bfaf58f0187ddfbf6e8 Mon Sep 17 00:00:00 2001 From: Tyler Ward Date: Tue, 28 May 2019 16:41:34 -0700 Subject: [PATCH 15/15] remove backup copy of file --- .../openshift-templates/configmap.ymlbak | 55 ------------------- 1 file changed, 55 deletions(-) delete mode 100644 images/oc-build-deploy-dind/openshift-templates/configmap.ymlbak diff --git a/images/oc-build-deploy-dind/openshift-templates/configmap.ymlbak b/images/oc-build-deploy-dind/openshift-templates/configmap.ymlbak deleted file mode 100644 index 7bbf6c3def..0000000000 --- a/images/oc-build-deploy-dind/openshift-templates/configmap.ymlbak +++ /dev/null @@ -1,55 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - creationTimestamp: null - name: lagoon-openshift-template-configmap -parameters: - - name: NAME - description: Name of this configmap - required: true - - name: SAFE_BRANCH - description: Which branch this belongs to, special chars replaced with dashes - required: true - - name: SAFE_PROJECT - description: Which project this belongs to, special chars replaced with dashes - required: true - - name: BRANCH - description: Which branch this belongs to, original value - required: true - - name: PROJECT - description: Which project this belongs to, original value - required: true - - name: OPENSHIFT_NAME - description: The name of the openshift cluster this project is running on - value: "" - - name: ENVIRONMENT_TYPE - description: Which environment type this project is - value: development - - name: ROUTE - description: The main route of this project - value: "" - - name: ROUTES - description: All routes of this project - value: "" - - name: MONITORING_URLS - description: The routes specified for monitoring the production environment of this project - value: "" - - name: AUTOGENERATED_ROUTES - description: Routes which were automatically generated by Lagoon - value: "" -objects: -- kind: ConfigMap - apiVersion: v1 - metadata: - name: ${NAME} - data: - LAGOON_GIT_SAFE_BRANCH: ${SAFE_BRANCH} - LAGOON_GIT_BRANCH: ${BRANCH} - LAGOON_SAFE_PROJECT: ${SAFE_PROJECT} - LAGOON_PROJECT: ${PROJECT} - LAGOON_ENVIRONMENT_TYPE: ${ENVIRONMENT_TYPE} - LAGOON_ROUTE: ${ROUTE} - LAGOON_ROUTES: ${ROUTES} - LAGOON_MONITORING_URLS: ${MONITORING_URLS} - LAGOON_OPENSHIFT_NAME: ${OPENSHIFT_NAME} - LAGOON_AUTOGENERATED_ROUTES: ${AUTOGENERATED_ROUTES}