diff --git a/UPGRADE.md b/UPGRADE.md index 378aa7e..f02b750 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -12,6 +12,7 @@ ## Upgrade from v5.0.0 to v5.1.0 +- changed container order for Redis ([#74](https://github.com/shopsys/deployment/pull/74)) - cache warmup is now run as an init container instead of a `postStart` lifecycle hook ([#73](https://github.com/shopsys/deployment/pull/73)) - cron pod is now always deleted gracefully ([#72](https://github.com/shopsys/deployment/pull/72)) - health check for webserver now uses PHP-FPM `ping` endpoint instead of nginx `stub_status` ([#71](https://github.com/shopsys/deployment/pull/71)) diff --git a/deploy/parts/deploy.sh b/deploy/parts/deploy.sh index b48cfcb..49278ef 100644 --- a/deploy/parts/deploy.sh +++ b/deploy/parts/deploy.sh @@ -54,11 +54,11 @@ if [ "${RUNNING_PRODUCTION}" -eq "0" ] || [ "${DOWNSCALE_RESOURCE:-0}" -eq "1" ] yq e -i '.spec.template.spec.containers[0].resources.requests.cpu = "0.01"' "${CONFIGURATION_TARGET_PATH}/deployments/storefront.yaml" yq e -i '.spec.template.spec.containers[0].resources.requests.cpu = "0.01"' "${CONFIGURATION_TARGET_PATH}/deployments/webserver-php-fpm.yaml" yq e -i '.spec.template.spec.containers[1].resources.requests.cpu = "0.01"' "${CONFIGURATION_TARGET_PATH}/deployments/webserver-php-fpm.yaml" - yq e -i '.spec.template.spec.containers[1].resources.requests.cpu = "0.01"' "${CONFIGURATION_TARGET_PATH}/deployments/redis.yaml" + yq e -i '.spec.template.spec.containers[0].resources.requests.cpu = "0.01"' "${CONFIGURATION_TARGET_PATH}/deployments/redis.yaml" yq e -i '.spec.template.spec.containers[0].resources.requests.cpu = "0.01"' "${CONFIGURATION_TARGET_PATH}/deployments/rabbitmq.yaml" yq e -i '.spec.template.spec.containers[0].resources.requests.memory = "100Mi"' "${CONFIGURATION_TARGET_PATH}/deployments/webserver-php-fpm.yaml" - yq e -i '.spec.template.spec.containers[1].resources.requests.memory = "100Mi"' "${CONFIGURATION_TARGET_PATH}/deployments/redis.yaml" + yq e -i '.spec.template.spec.containers[0].resources.requests.memory = "100Mi"' "${CONFIGURATION_TARGET_PATH}/deployments/redis.yaml" echo -e "[${GREEN}OK${NO_COLOR}]" else diff --git a/kubernetes/deployments/redis.yaml b/kubernetes/deployments/redis.yaml index 715b7dc..d5f4aaf 100644 --- a/kubernetes/deployments/redis.yaml +++ b/kubernetes/deployments/redis.yaml @@ -27,19 +27,6 @@ spec: name: redis defaultMode: 0755 containers: - - name: redis-exporter - image: "oliver006/redis_exporter" - imagePullPolicy: Always - ports: - - name: exporter - containerPort: 9121 - protocol: TCP - resources: - limits: - memory: 128Mi - requests: - cpu: 10m - memory: 128Mi - name: redis image: "{{REDIS_VERSION}}" ports: @@ -76,3 +63,16 @@ spec: requests: memory: "2500Mi" cpu: "100m" + - name: redis-exporter + image: "oliver006/redis_exporter" + imagePullPolicy: Always + ports: + - name: exporter + containerPort: 9121 + protocol: TCP + resources: + limits: + memory: 128Mi + requests: + cpu: 10m + memory: 128Mi diff --git a/tests/scenarios/basic-production/expected/migrate-continuous-deploy.yaml b/tests/scenarios/basic-production/expected/migrate-continuous-deploy.yaml index 79076f9..db00365 100644 --- a/tests/scenarios/basic-production/expected/migrate-continuous-deploy.yaml +++ b/tests/scenarios/basic-production/expected/migrate-continuous-deploy.yaml @@ -236,19 +236,6 @@ spec: app: redis spec: containers: - - image: oliver006/redis_exporter - imagePullPolicy: Always - name: redis-exporter - ports: - - containerPort: 9121 - name: exporter - protocol: TCP - resources: - limits: - memory: 128Mi - requests: - cpu: 10m - memory: 128Mi - args: - /usr/local/etc/redis/redis.conf image: redis:7.4-alpine @@ -285,6 +272,19 @@ spec: - mountPath: /usr/local/etc/redis/redis.conf name: config subPath: redis.conf + - image: oliver006/redis_exporter + imagePullPolicy: Always + name: redis-exporter + ports: + - containerPort: 9121 + name: exporter + protocol: TCP + resources: + limits: + memory: 128Mi + requests: + cpu: 10m + memory: 128Mi volumes: - configMap: defaultMode: 493 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 bf040b1..00b1604 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 @@ -236,19 +236,6 @@ spec: app: redis spec: containers: - - image: oliver006/redis_exporter - imagePullPolicy: Always - name: redis-exporter - ports: - - containerPort: 9121 - name: exporter - protocol: TCP - resources: - limits: - memory: 128Mi - requests: - cpu: 10m - memory: 128Mi - args: - /usr/local/etc/redis/redis.conf image: redis:7.4-alpine @@ -285,6 +272,19 @@ spec: - mountPath: /usr/local/etc/redis/redis.conf name: config subPath: redis.conf + - image: oliver006/redis_exporter + imagePullPolicy: Always + name: redis-exporter + ports: + - containerPort: 9121 + name: exporter + protocol: TCP + resources: + limits: + memory: 128Mi + requests: + cpu: 10m + memory: 128Mi volumes: - configMap: defaultMode: 493 diff --git a/tests/scenarios/basic-production/expected/migrate-first-deploy.yaml b/tests/scenarios/basic-production/expected/migrate-first-deploy.yaml index 7b9ec6c..f754b94 100644 --- a/tests/scenarios/basic-production/expected/migrate-first-deploy.yaml +++ b/tests/scenarios/basic-production/expected/migrate-first-deploy.yaml @@ -236,19 +236,6 @@ spec: app: redis spec: containers: - - image: oliver006/redis_exporter - imagePullPolicy: Always - name: redis-exporter - ports: - - containerPort: 9121 - name: exporter - protocol: TCP - resources: - limits: - memory: 128Mi - requests: - cpu: 10m - memory: 128Mi - args: - /usr/local/etc/redis/redis.conf image: redis:7.4-alpine @@ -285,6 +272,19 @@ spec: - mountPath: /usr/local/etc/redis/redis.conf name: config subPath: redis.conf + - image: oliver006/redis_exporter + imagePullPolicy: Always + name: redis-exporter + ports: + - containerPort: 9121 + name: exporter + protocol: TCP + resources: + limits: + memory: 128Mi + requests: + cpu: 10m + memory: 128Mi volumes: - configMap: defaultMode: 493 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 0e74d2e..f6cdf4f 100644 --- a/tests/scenarios/development-single-domain/expected/migrate-continuous-deploy.yaml +++ b/tests/scenarios/development-single-domain/expected/migrate-continuous-deploy.yaml @@ -117,19 +117,6 @@ spec: app: redis spec: containers: - - image: oliver006/redis_exporter - imagePullPolicy: Always - name: redis-exporter - ports: - - containerPort: 9121 - name: exporter - protocol: TCP - resources: - limits: - memory: 128Mi - requests: - cpu: 10m - memory: 128Mi - args: - /usr/local/etc/redis/redis.conf image: redis:7.4-alpine @@ -166,6 +153,19 @@ spec: - mountPath: /usr/local/etc/redis/redis.conf name: config subPath: redis.conf + - image: oliver006/redis_exporter + imagePullPolicy: Always + name: redis-exporter + ports: + - containerPort: 9121 + name: exporter + protocol: TCP + resources: + limits: + memory: 128Mi + requests: + cpu: 10m + memory: 128Mi volumes: - configMap: defaultMode: 493 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 76dc46e..14a9bc2 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 @@ -117,19 +117,6 @@ spec: app: redis spec: containers: - - image: oliver006/redis_exporter - imagePullPolicy: Always - name: redis-exporter - ports: - - containerPort: 9121 - name: exporter - protocol: TCP - resources: - limits: - memory: 128Mi - requests: - cpu: 10m - memory: 128Mi - args: - /usr/local/etc/redis/redis.conf image: redis:7.4-alpine @@ -166,6 +153,19 @@ spec: - mountPath: /usr/local/etc/redis/redis.conf name: config subPath: redis.conf + - image: oliver006/redis_exporter + imagePullPolicy: Always + name: redis-exporter + ports: + - containerPort: 9121 + name: exporter + protocol: TCP + resources: + limits: + memory: 128Mi + requests: + cpu: 10m + memory: 128Mi volumes: - configMap: defaultMode: 493 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 a047f20..1596709 100644 --- a/tests/scenarios/development-single-domain/expected/migrate-first-deploy.yaml +++ b/tests/scenarios/development-single-domain/expected/migrate-first-deploy.yaml @@ -117,19 +117,6 @@ spec: app: redis spec: containers: - - image: oliver006/redis_exporter - imagePullPolicy: Always - name: redis-exporter - ports: - - containerPort: 9121 - name: exporter - protocol: TCP - resources: - limits: - memory: 128Mi - requests: - cpu: 10m - memory: 128Mi - args: - /usr/local/etc/redis/redis.conf image: redis:7.4-alpine @@ -166,6 +153,19 @@ spec: - mountPath: /usr/local/etc/redis/redis.conf name: config subPath: redis.conf + - image: oliver006/redis_exporter + imagePullPolicy: Always + name: redis-exporter + ports: + - containerPort: 9121 + name: exporter + protocol: TCP + resources: + limits: + memory: 128Mi + requests: + cpu: 10m + memory: 128Mi volumes: - configMap: defaultMode: 493 diff --git a/tests/scenarios/escaping-env/expected/migrate-continuous-deploy.yaml b/tests/scenarios/escaping-env/expected/migrate-continuous-deploy.yaml index 340088c..95f63d7 100644 --- a/tests/scenarios/escaping-env/expected/migrate-continuous-deploy.yaml +++ b/tests/scenarios/escaping-env/expected/migrate-continuous-deploy.yaml @@ -238,19 +238,6 @@ spec: app: redis spec: containers: - - image: oliver006/redis_exporter - imagePullPolicy: Always - name: redis-exporter - ports: - - containerPort: 9121 - name: exporter - protocol: TCP - resources: - limits: - memory: 128Mi - requests: - cpu: 10m - memory: 128Mi - args: - /usr/local/etc/redis/redis.conf image: redis:7.4-alpine @@ -287,6 +274,19 @@ spec: - mountPath: /usr/local/etc/redis/redis.conf name: config subPath: redis.conf + - image: oliver006/redis_exporter + imagePullPolicy: Always + name: redis-exporter + ports: + - containerPort: 9121 + name: exporter + protocol: TCP + resources: + limits: + memory: 128Mi + requests: + cpu: 10m + memory: 128Mi volumes: - configMap: defaultMode: 493 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 b81c351..f4a6620 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 @@ -238,19 +238,6 @@ spec: app: redis spec: containers: - - image: oliver006/redis_exporter - imagePullPolicy: Always - name: redis-exporter - ports: - - containerPort: 9121 - name: exporter - protocol: TCP - resources: - limits: - memory: 128Mi - requests: - cpu: 10m - memory: 128Mi - args: - /usr/local/etc/redis/redis.conf image: redis:7.4-alpine @@ -287,6 +274,19 @@ spec: - mountPath: /usr/local/etc/redis/redis.conf name: config subPath: redis.conf + - image: oliver006/redis_exporter + imagePullPolicy: Always + name: redis-exporter + ports: + - containerPort: 9121 + name: exporter + protocol: TCP + resources: + limits: + memory: 128Mi + requests: + cpu: 10m + memory: 128Mi volumes: - configMap: defaultMode: 493 diff --git a/tests/scenarios/escaping-env/expected/migrate-first-deploy.yaml b/tests/scenarios/escaping-env/expected/migrate-first-deploy.yaml index 62b915e..3ae5277 100644 --- a/tests/scenarios/escaping-env/expected/migrate-first-deploy.yaml +++ b/tests/scenarios/escaping-env/expected/migrate-first-deploy.yaml @@ -238,19 +238,6 @@ spec: app: redis spec: containers: - - image: oliver006/redis_exporter - imagePullPolicy: Always - name: redis-exporter - ports: - - containerPort: 9121 - name: exporter - protocol: TCP - resources: - limits: - memory: 128Mi - requests: - cpu: 10m - memory: 128Mi - args: - /usr/local/etc/redis/redis.conf image: redis:7.4-alpine @@ -287,6 +274,19 @@ spec: - mountPath: /usr/local/etc/redis/redis.conf name: config subPath: redis.conf + - image: oliver006/redis_exporter + imagePullPolicy: Always + name: redis-exporter + ports: + - containerPort: 9121 + name: exporter + protocol: TCP + resources: + limits: + memory: 128Mi + requests: + cpu: 10m + memory: 128Mi volumes: - configMap: defaultMode: 493 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 c4225cb..d053b0b 100644 --- a/tests/scenarios/production-with-cloudflare/expected/migrate-continuous-deploy.yaml +++ b/tests/scenarios/production-with-cloudflare/expected/migrate-continuous-deploy.yaml @@ -353,19 +353,6 @@ spec: app: redis spec: containers: - - image: oliver006/redis_exporter - imagePullPolicy: Always - name: redis-exporter - ports: - - containerPort: 9121 - name: exporter - protocol: TCP - resources: - limits: - memory: 128Mi - requests: - cpu: 10m - memory: 128Mi - args: - /usr/local/etc/redis/redis.conf image: redis:7.4-alpine @@ -402,6 +389,19 @@ spec: - mountPath: /usr/local/etc/redis/redis.conf name: config subPath: redis.conf + - image: oliver006/redis_exporter + imagePullPolicy: Always + name: redis-exporter + ports: + - containerPort: 9121 + name: exporter + protocol: TCP + resources: + limits: + memory: 128Mi + requests: + cpu: 10m + memory: 128Mi volumes: - configMap: defaultMode: 493 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 780ffd8..02eb055 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 @@ -353,19 +353,6 @@ spec: app: redis spec: containers: - - image: oliver006/redis_exporter - imagePullPolicy: Always - name: redis-exporter - ports: - - containerPort: 9121 - name: exporter - protocol: TCP - resources: - limits: - memory: 128Mi - requests: - cpu: 10m - memory: 128Mi - args: - /usr/local/etc/redis/redis.conf image: redis:7.4-alpine @@ -402,6 +389,19 @@ spec: - mountPath: /usr/local/etc/redis/redis.conf name: config subPath: redis.conf + - image: oliver006/redis_exporter + imagePullPolicy: Always + name: redis-exporter + ports: + - containerPort: 9121 + name: exporter + protocol: TCP + resources: + limits: + memory: 128Mi + requests: + cpu: 10m + memory: 128Mi volumes: - configMap: defaultMode: 493 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 3e0da2b..42dc97a 100644 --- a/tests/scenarios/production-with-cloudflare/expected/migrate-first-deploy.yaml +++ b/tests/scenarios/production-with-cloudflare/expected/migrate-first-deploy.yaml @@ -353,19 +353,6 @@ spec: app: redis spec: containers: - - image: oliver006/redis_exporter - imagePullPolicy: Always - name: redis-exporter - ports: - - containerPort: 9121 - name: exporter - protocol: TCP - resources: - limits: - memory: 128Mi - requests: - cpu: 10m - memory: 128Mi - args: - /usr/local/etc/redis/redis.conf image: redis:7.4-alpine @@ -402,6 +389,19 @@ spec: - mountPath: /usr/local/etc/redis/redis.conf name: config subPath: redis.conf + - image: oliver006/redis_exporter + imagePullPolicy: Always + name: redis-exporter + ports: + - containerPort: 9121 + name: exporter + protocol: TCP + resources: + limits: + memory: 128Mi + requests: + cpu: 10m + memory: 128Mi volumes: - configMap: defaultMode: 493