diff --git a/UPGRADE.md b/UPGRADE.md index 8cae4bd..8db1181 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -12,6 +12,7 @@ ## Upgrade from v5.0.0 to v5.1.0 +- removed `namespace.yaml` manifest from kustomize resources ([#79](https://github.com/shopsys/deployment/pull/79)) - define autoscaling behavior with rolling update strategy ([#78](https://github.com/shopsys/deployment/pull/78)) - removed GCloud-specific docker registry secret creation ([#77](https://github.com/shopsys/deployment/pull/77)) - improved probes and graceful shutdown for storefront ([#76](https://github.com/shopsys/deployment/pull/76)) diff --git a/deploy/parts/deploy.sh b/deploy/parts/deploy.sh index ce2364a..c43041b 100644 --- a/deploy/parts/deploy.sh +++ b/deploy/parts/deploy.sh @@ -104,7 +104,7 @@ if [ $DISPLAY_FINAL_CONFIGURATION -eq "1" ]; then fi echo -n " Apply configuration " -runCommand "ERROR" "kustomize build --load-restrictor LoadRestrictionsNone \"${CONFIGURATION_TARGET_PATH}/kustomize/migrate-application/${KUSTOMIZE_FOLDER}\" | kubectl apply -f -" +runCommand "ERROR" "kustomize build --load-restrictor LoadRestrictionsNone \"${CONFIGURATION_TARGET_PATH}/kustomize/migrate-application/${KUSTOMIZE_FOLDER}\" | kubectl apply -n ${PROJECT_NAME} -f -" echo -n " Waiting for migrate application " @@ -158,7 +158,7 @@ if [ $DISPLAY_FINAL_CONFIGURATION -eq "1" ]; then fi echo -n " Deploy Webserver and PHP-FPM container with Storefront" -runCommand "ERROR" "kustomize build --load-restrictor LoadRestrictionsNone \"${CONFIGURATION_TARGET_PATH}/kustomize/webserver\" | kubectl apply -f -" +runCommand "ERROR" "kustomize build --load-restrictor LoadRestrictionsNone \"${CONFIGURATION_TARGET_PATH}/kustomize/webserver\" | kubectl apply -n ${PROJECT_NAME} -f -" echo -n " Waiting for start new PHP-FPM and Storefront container (In case of fail you need to manually check what is state of application)" runCommand "ERROR" "kubectl rollout status --namespace=${PROJECT_NAME} deployment/webserver-php-fpm deployment/storefront --watch" diff --git a/kubernetes/horizontalPodAutoscaler.yaml b/kubernetes/horizontalPodAutoscaler.yaml index e698dfd..02551c8 100644 --- a/kubernetes/horizontalPodAutoscaler.yaml +++ b/kubernetes/horizontalPodAutoscaler.yaml @@ -2,7 +2,6 @@ apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: webserver-php-fpm - namespace: "{{PROJECT_NAME}}" spec: scaleTargetRef: apiVersion: apps/v1 diff --git a/kubernetes/horizontalStorefrontAutoscaler.yaml b/kubernetes/horizontalStorefrontAutoscaler.yaml index ede46a1..86164c5 100644 --- a/kubernetes/horizontalStorefrontAutoscaler.yaml +++ b/kubernetes/horizontalStorefrontAutoscaler.yaml @@ -2,7 +2,6 @@ apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: storefront - namespace: "{{PROJECT_NAME}}" spec: scaleTargetRef: apiVersion: apps/v1 diff --git a/kubernetes/kustomize/migrate-application/continuous-deploy/kustomization.yaml b/kubernetes/kustomize/migrate-application/continuous-deploy/kustomization.yaml index a89a153..4228f6e 100644 --- a/kubernetes/kustomize/migrate-application/continuous-deploy/kustomization.yaml +++ b/kubernetes/kustomize/migrate-application/continuous-deploy/kustomization.yaml @@ -1,7 +1,6 @@ resources: - ../../../deployments/redis.yaml - ../../../services/redis.yaml - - ../../../namespace.yaml - ../../../configmap/redis.yaml - ../../../configmap/redis-health.yaml - ../../../deployments/rabbitmq.yaml diff --git a/kubernetes/kustomize/migrate-application/first-deploy-with-demo-data/kustomization.yaml b/kubernetes/kustomize/migrate-application/first-deploy-with-demo-data/kustomization.yaml index a89a153..4228f6e 100644 --- a/kubernetes/kustomize/migrate-application/first-deploy-with-demo-data/kustomization.yaml +++ b/kubernetes/kustomize/migrate-application/first-deploy-with-demo-data/kustomization.yaml @@ -1,7 +1,6 @@ resources: - ../../../deployments/redis.yaml - ../../../services/redis.yaml - - ../../../namespace.yaml - ../../../configmap/redis.yaml - ../../../configmap/redis-health.yaml - ../../../deployments/rabbitmq.yaml diff --git a/kubernetes/kustomize/migrate-application/first-deploy/kustomization.yaml b/kubernetes/kustomize/migrate-application/first-deploy/kustomization.yaml index a89a153..4228f6e 100644 --- a/kubernetes/kustomize/migrate-application/first-deploy/kustomization.yaml +++ b/kubernetes/kustomize/migrate-application/first-deploy/kustomization.yaml @@ -1,7 +1,6 @@ resources: - ../../../deployments/redis.yaml - ../../../services/redis.yaml - - ../../../namespace.yaml - ../../../configmap/redis.yaml - ../../../configmap/redis-health.yaml - ../../../deployments/rabbitmq.yaml diff --git a/kubernetes/kustomize/webserver/kustomization.yaml b/kubernetes/kustomize/webserver/kustomization.yaml index c424d8e..08e0f3e 100644 --- a/kubernetes/kustomize/webserver/kustomization.yaml +++ b/kubernetes/kustomize/webserver/kustomization.yaml @@ -4,7 +4,6 @@ resources: - ../../deployments/storefront.yaml - ../../deployments/cron.yaml - ../../services/storefront.yaml - - ../../namespace.yaml - ../../configmap/nginx.yaml - ../../configmap/production-php-fpm.yaml - ../../configmap/production-php-opcache.yaml diff --git a/kubernetes/namespace.yaml b/kubernetes/namespace.yaml deleted file mode 100644 index 74708ba..0000000 --- a/kubernetes/namespace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: "{{PROJECT_NAME}}" diff --git a/tests/scenarios/basic-production/expected/migrate-continuous-deploy.yaml b/tests/scenarios/basic-production/expected/migrate-continuous-deploy.yaml index a621409..9305d46 100644 --- a/tests/scenarios/basic-production/expected/migrate-continuous-deploy.yaml +++ b/tests/scenarios/basic-production/expected/migrate-continuous-deploy.yaml @@ -1,9 +1,4 @@ apiVersion: v1 -kind: Namespace -metadata: - name: myproject-production ---- -apiVersion: v1 data: domains_urls.yaml: | domains_urls: diff --git a/tests/scenarios/basic-production/expected/migrate-first-deploy-with-demo-data.yaml b/tests/scenarios/basic-production/expected/migrate-first-deploy-with-demo-data.yaml index 783a8b9..678ed98 100644 --- a/tests/scenarios/basic-production/expected/migrate-first-deploy-with-demo-data.yaml +++ b/tests/scenarios/basic-production/expected/migrate-first-deploy-with-demo-data.yaml @@ -1,9 +1,4 @@ apiVersion: v1 -kind: Namespace -metadata: - name: myproject-production ---- -apiVersion: v1 data: domains_urls.yaml: | domains_urls: diff --git a/tests/scenarios/basic-production/expected/migrate-first-deploy.yaml b/tests/scenarios/basic-production/expected/migrate-first-deploy.yaml index f2e4508..917eb46 100644 --- a/tests/scenarios/basic-production/expected/migrate-first-deploy.yaml +++ b/tests/scenarios/basic-production/expected/migrate-first-deploy.yaml @@ -1,9 +1,4 @@ apiVersion: v1 -kind: Namespace -metadata: - name: myproject-production ---- -apiVersion: v1 data: domains_urls.yaml: | domains_urls: diff --git a/tests/scenarios/basic-production/expected/namespace.yaml b/tests/scenarios/basic-production/expected/namespace.yaml deleted file mode 100644 index 47f129e..0000000 --- a/tests/scenarios/basic-production/expected/namespace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: "myproject-production" diff --git a/tests/scenarios/basic-production/expected/webserver.yaml b/tests/scenarios/basic-production/expected/webserver.yaml index aba8ece..47f8745 100644 --- a/tests/scenarios/basic-production/expected/webserver.yaml +++ b/tests/scenarios/basic-production/expected/webserver.yaml @@ -1,9 +1,4 @@ apiVersion: v1 -kind: Namespace -metadata: - name: myproject-production ---- -apiVersion: v1 data: .project_env.sh: | export ELASTICSEARCH_HOST='http://elasticsearch:9200' diff --git a/tests/scenarios/development-single-domain/expected/migrate-continuous-deploy.yaml b/tests/scenarios/development-single-domain/expected/migrate-continuous-deploy.yaml index 4aa5e2f..b5ba1ae 100644 --- a/tests/scenarios/development-single-domain/expected/migrate-continuous-deploy.yaml +++ b/tests/scenarios/development-single-domain/expected/migrate-continuous-deploy.yaml @@ -1,9 +1,4 @@ apiVersion: v1 -kind: Namespace -metadata: - name: myproject-dev ---- -apiVersion: v1 data: domains_urls.yaml: | domains_urls: diff --git a/tests/scenarios/development-single-domain/expected/migrate-first-deploy-with-demo-data.yaml b/tests/scenarios/development-single-domain/expected/migrate-first-deploy-with-demo-data.yaml index 3be3276..9de21ed 100644 --- a/tests/scenarios/development-single-domain/expected/migrate-first-deploy-with-demo-data.yaml +++ b/tests/scenarios/development-single-domain/expected/migrate-first-deploy-with-demo-data.yaml @@ -1,9 +1,4 @@ apiVersion: v1 -kind: Namespace -metadata: - name: myproject-dev ---- -apiVersion: v1 data: domains_urls.yaml: | domains_urls: diff --git a/tests/scenarios/development-single-domain/expected/migrate-first-deploy.yaml b/tests/scenarios/development-single-domain/expected/migrate-first-deploy.yaml index 799d038..a4284c3 100644 --- a/tests/scenarios/development-single-domain/expected/migrate-first-deploy.yaml +++ b/tests/scenarios/development-single-domain/expected/migrate-first-deploy.yaml @@ -1,9 +1,4 @@ apiVersion: v1 -kind: Namespace -metadata: - name: myproject-dev ---- -apiVersion: v1 data: domains_urls.yaml: | domains_urls: diff --git a/tests/scenarios/development-single-domain/expected/namespace.yaml b/tests/scenarios/development-single-domain/expected/namespace.yaml deleted file mode 100644 index 9827882..0000000 --- a/tests/scenarios/development-single-domain/expected/namespace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: "myproject-dev" diff --git a/tests/scenarios/development-single-domain/expected/webserver.yaml b/tests/scenarios/development-single-domain/expected/webserver.yaml index 3bc9ebe..b8233d6 100644 --- a/tests/scenarios/development-single-domain/expected/webserver.yaml +++ b/tests/scenarios/development-single-domain/expected/webserver.yaml @@ -1,9 +1,4 @@ apiVersion: v1 -kind: Namespace -metadata: - name: myproject-dev ---- -apiVersion: v1 data: .project_env.sh: | export ELASTICSEARCH_HOST='http://elasticsearch:9200' diff --git a/tests/scenarios/escaping-env/expected/migrate-continuous-deploy.yaml b/tests/scenarios/escaping-env/expected/migrate-continuous-deploy.yaml index ec2fd15..b3080de 100644 --- a/tests/scenarios/escaping-env/expected/migrate-continuous-deploy.yaml +++ b/tests/scenarios/escaping-env/expected/migrate-continuous-deploy.yaml @@ -1,9 +1,4 @@ apiVersion: v1 -kind: Namespace -metadata: - name: myproject-production ---- -apiVersion: v1 data: domains_urls.yaml: | domains_urls: diff --git a/tests/scenarios/escaping-env/expected/migrate-first-deploy-with-demo-data.yaml b/tests/scenarios/escaping-env/expected/migrate-first-deploy-with-demo-data.yaml index 849235c..1653b97 100644 --- a/tests/scenarios/escaping-env/expected/migrate-first-deploy-with-demo-data.yaml +++ b/tests/scenarios/escaping-env/expected/migrate-first-deploy-with-demo-data.yaml @@ -1,9 +1,4 @@ apiVersion: v1 -kind: Namespace -metadata: - name: myproject-production ---- -apiVersion: v1 data: domains_urls.yaml: | domains_urls: diff --git a/tests/scenarios/escaping-env/expected/migrate-first-deploy.yaml b/tests/scenarios/escaping-env/expected/migrate-first-deploy.yaml index 41471b2..74231ec 100644 --- a/tests/scenarios/escaping-env/expected/migrate-first-deploy.yaml +++ b/tests/scenarios/escaping-env/expected/migrate-first-deploy.yaml @@ -1,9 +1,4 @@ apiVersion: v1 -kind: Namespace -metadata: - name: myproject-production ---- -apiVersion: v1 data: domains_urls.yaml: | domains_urls: diff --git a/tests/scenarios/escaping-env/expected/namespace.yaml b/tests/scenarios/escaping-env/expected/namespace.yaml deleted file mode 100644 index 47f129e..0000000 --- a/tests/scenarios/escaping-env/expected/namespace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: "myproject-production" diff --git a/tests/scenarios/escaping-env/expected/webserver.yaml b/tests/scenarios/escaping-env/expected/webserver.yaml index 947d68e..85ee3e6 100644 --- a/tests/scenarios/escaping-env/expected/webserver.yaml +++ b/tests/scenarios/escaping-env/expected/webserver.yaml @@ -1,9 +1,4 @@ apiVersion: v1 -kind: Namespace -metadata: - name: myproject-production ---- -apiVersion: v1 data: .project_env.sh: | export ELASTICSEARCH_HOST='http://elasticsearch:9200' diff --git a/tests/scenarios/production-with-cloudflare/expected/migrate-continuous-deploy.yaml b/tests/scenarios/production-with-cloudflare/expected/migrate-continuous-deploy.yaml index c27a9da..da3b222 100644 --- a/tests/scenarios/production-with-cloudflare/expected/migrate-continuous-deploy.yaml +++ b/tests/scenarios/production-with-cloudflare/expected/migrate-continuous-deploy.yaml @@ -1,9 +1,4 @@ apiVersion: v1 -kind: Namespace -metadata: - name: shop-production ---- -apiVersion: v1 data: domains_urls.yaml: | domains_urls: diff --git a/tests/scenarios/production-with-cloudflare/expected/migrate-first-deploy-with-demo-data.yaml b/tests/scenarios/production-with-cloudflare/expected/migrate-first-deploy-with-demo-data.yaml index 83876d5..12318ab 100644 --- a/tests/scenarios/production-with-cloudflare/expected/migrate-first-deploy-with-demo-data.yaml +++ b/tests/scenarios/production-with-cloudflare/expected/migrate-first-deploy-with-demo-data.yaml @@ -1,9 +1,4 @@ apiVersion: v1 -kind: Namespace -metadata: - name: shop-production ---- -apiVersion: v1 data: domains_urls.yaml: | domains_urls: diff --git a/tests/scenarios/production-with-cloudflare/expected/migrate-first-deploy.yaml b/tests/scenarios/production-with-cloudflare/expected/migrate-first-deploy.yaml index c8ef750..6cd76e8 100644 --- a/tests/scenarios/production-with-cloudflare/expected/migrate-first-deploy.yaml +++ b/tests/scenarios/production-with-cloudflare/expected/migrate-first-deploy.yaml @@ -1,9 +1,4 @@ apiVersion: v1 -kind: Namespace -metadata: - name: shop-production ---- -apiVersion: v1 data: domains_urls.yaml: | domains_urls: diff --git a/tests/scenarios/production-with-cloudflare/expected/namespace.yaml b/tests/scenarios/production-with-cloudflare/expected/namespace.yaml deleted file mode 100644 index b842341..0000000 --- a/tests/scenarios/production-with-cloudflare/expected/namespace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: "shop-production" diff --git a/tests/scenarios/production-with-cloudflare/expected/webserver.yaml b/tests/scenarios/production-with-cloudflare/expected/webserver.yaml index 19269ed..01ff53d 100644 --- a/tests/scenarios/production-with-cloudflare/expected/webserver.yaml +++ b/tests/scenarios/production-with-cloudflare/expected/webserver.yaml @@ -1,9 +1,4 @@ apiVersion: v1 -kind: Namespace -metadata: - name: shop-production ---- -apiVersion: v1 data: .project_env.sh: | export ELASTICSEARCH_HOST='http://elasticsearch:9200'