diff --git a/UPGRADE.md b/UPGRADE.md index 00f7143..47b58bc 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -12,6 +12,7 @@ ## Upgrade from v5.0.0 to v5.1.0 +- 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)) - update the `/health` location block in `project-nginx.conf` in your project's `app/orchestration/kubernetes/configmap/nginx.yaml` file to pass the request to PHP-FPM: ```diff diff --git a/deploy/parts/deploy.sh b/deploy/parts/deploy.sh index ad4ed78..b48cfcb 100644 --- a/deploy/parts/deploy.sh +++ b/deploy/parts/deploy.sh @@ -77,14 +77,10 @@ else fi fi -DEPLOYED_CRON_POD=$(kubectl get pods --namespace=${PROJECT_NAME} --field-selector=status.phase=Running -l app=cron -o=jsonpath='{.items[?(@.status.containerStatuses[0].state.running)].metadata.name}') || true - -if [[ -n ${DEPLOYED_CRON_POD} ]]; then - echo -n "Lock crons to prevent run next iteration " - runCommand "ERROR" "kubectl exec -t --namespace=${PROJECT_NAME} ${DEPLOYED_CRON_POD} -- bash -c \"./phing -S cron-lock > /dev/null 2>&1 & disown\"" - - echo -n "Waiting until all cron instances are done " - runCommand "ERROR" "kubectl exec --namespace=${PROJECT_NAME} ${DEPLOYED_CRON_POD} -- ./phing -S cron-watch" +if kubectl get deployment/cron --namespace="${PROJECT_NAME}" >/dev/null 2>&1; then + echo -n "Waiting until all cron instances are done and stop cron" + runCommand "ERROR" "kubectl scale deployment/cron --namespace=${PROJECT_NAME} --replicas=0" + runCommand "ERROR" "kubectl rollout status deployment/cron --namespace=${PROJECT_NAME} --timeout=60m" fi echo "Migrate Application (database migrations, elasticsearch migrations, ...):" @@ -130,7 +126,7 @@ if [ ${MIGRATION_COMPLETE_EXIT_CODE} -eq 1 ]; then echo -e "[${RED}ERROR${NO_COLOR}]" echo -n "Restore previous cron container " - runCommand "SKIP" "kubectl delete pod --namespace=${PROJECT_NAME} ${DEPLOYED_CRON_POD}" + runCommand "SKIP" "kubectl scale deployment/cron --namespace=${PROJECT_NAME} --replicas=1" RUNNING_WEBSERVER_PHP_FPM_POD=$(kubectl get pods --namespace=${PROJECT_NAME} --field-selector=status.phase=Running -l app=webserver-php-fpm -o=jsonpath='{.items[0].metadata.name}') @@ -151,9 +147,6 @@ else kubectl logs job/migrate-application --namespace=${PROJECT_NAME} echo -e "section_end:`date +%s`:migrate_application_logs_section\r\e[0K" echo "" - - echo -n "Deploy new cron container " - runCommand "ERROR" "kustomize build --load-restrictor LoadRestrictionsNone \"${CONFIGURATION_TARGET_PATH}/kustomize/cron\" | kubectl apply -f -" fi echo "Deploy new Webserver and PHP-FPM container:" diff --git a/kubernetes/deployments/cron.yaml b/kubernetes/deployments/cron.yaml index eaf8ec7..70e722c 100644 --- a/kubernetes/deployments/cron.yaml +++ b/kubernetes/deployments/cron.yaml @@ -8,10 +8,7 @@ spec: progressDeadlineSeconds: 1500 replicas: 1 strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 0 - type: RollingUpdate + type: Recreate selector: matchLabels: app: cron @@ -25,6 +22,7 @@ spec: labels: app: cron spec: + terminationGracePeriodSeconds: 3000 tolerations: - key: "workload" operator: "Equal" @@ -38,8 +36,7 @@ spec: matchExpressions: - key: workload operator: In - values: - - background + values: ["background"] volumes: - name: domains-urls configMap: @@ -61,14 +58,30 @@ spec: runAsUser: 0 imagePullPolicy: IfNotPresent workingDir: /var/www/html - command: ["/bin/sh","-c"] - args: ["cd /var/www/html && ./phing warmup > /dev/null && rm -rf /tmp/log-pipe && mkfifo /tmp/log-pipe && chmod 666 /tmp/log-pipe && crontab -u root /var/spool/cron/template && { crond || cron; } && stdbuf -o0 tail -n +1 -f /tmp/log-pipe"] + command: ["/bin/sh","-lc"] + args: + - > + ./phing warmup > /dev/null + + # FIFO for logs + rm -f /tmp/log-pipe && mkfifo /tmp/log-pipe && chmod 666 /tmp/log-pipe + + # crontab + crontab -u root /var/spool/cron/template + + # run on backround + stdbuf -o0 tail -n +1 -f /tmp/log-pipe & + + exec crond -f || exec cron -f lifecycle: preStop: exec: command: - - sleep - - '5' + - /bin/sh + - -lc + - | + ( ./bin/console deploy:cron:lock > /tmp/cron-lock.log 2>&1 || true ) & + ./bin/console deploy:cron:watch || true volumeMounts: - name: domains-urls mountPath: /var/www/html/{{DOMAINS_URLS_FILEPATH}} diff --git a/kubernetes/kustomize/cron/kustomization.yaml b/kubernetes/kustomize/cron/kustomization.yaml deleted file mode 100644 index 6a91ca1..0000000 --- a/kubernetes/kustomize/cron/kustomization.yaml +++ /dev/null @@ -1,10 +0,0 @@ -resources: - - ../../namespace.yaml - - ../../deployments/cron.yaml - - ../../configmap/cron-env.yaml - - ../../configmap/cron-list.yaml -namespace: "{{PROJECT_NAME}}" -configMapGenerator: - - name: domains-urls - files: - - ../../../../../{{DOMAINS_URLS_FILEPATH}} diff --git a/kubernetes/kustomize/webserver/kustomization.yaml b/kubernetes/kustomize/webserver/kustomization.yaml index 50b7351..c424d8e 100644 --- a/kubernetes/kustomize/webserver/kustomization.yaml +++ b/kubernetes/kustomize/webserver/kustomization.yaml @@ -2,11 +2,14 @@ resources: - ../../deployments/webserver-php-fpm.yaml - ../../services/webserver-php-fpm.yaml - ../../deployments/storefront.yaml + - ../../deployments/cron.yaml - ../../services/storefront.yaml - ../../namespace.yaml - ../../configmap/nginx.yaml - ../../configmap/production-php-fpm.yaml - ../../configmap/production-php-opcache.yaml + - ../../configmap/cron-env.yaml + - ../../configmap/cron-list.yaml - ../../ingress/ingress-rabbitmq.yaml namespace: "{{PROJECT_NAME}}" configMapGenerator: diff --git a/tests/scenarios/basic-production/expected/cron.yaml b/tests/scenarios/basic-production/expected/cron.yaml deleted file mode 100644 index 6d85982..0000000 --- a/tests/scenarios/basic-production/expected/cron.yaml +++ /dev/null @@ -1,182 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: myproject-production ---- -apiVersion: v1 -data: - .project_env.sh: | - export ELASTICSEARCH_HOST='http://elasticsearch:9200' - export TRUSTED_PROXY='10.0.0.0/8' - export DATABASE_NAME='myproject-production' - export S3_ENDPOINT='https://s3.example.com' - export MAILER_FORCE_WHITELIST='false' - export DATABASE_USER='myproject-production' - export DATABASE_PORT='5432' - export MESSENGER_TRANSPORT_DSN='amqp://guest:guest@rabbitmq:5672/%2f/messages' - export REDIS_PREFIX='myproject-production' - export DATABASE_PASSWORD='test-db-password' - export DATABASE_HOST='10.0.0.100' - export ELASTIC_SEARCH_INDEX_PREFIX='myproject-production' - export S3_SECRET='test-s3-secret' - export MAILER_DSN='smtp://mailhog:1025' - export S3_BUCKET_NAME='myproject-production' - export S3_ACCESS_KEY='myproject-production' - export APP_SECRET='test-app-secret-key' -kind: ConfigMap -metadata: - name: cron-env - namespace: myproject-production ---- -apiVersion: v1 -data: - cron: |+ - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - */5 * * * * . /root/.project_env.sh && cd /var/www/html/ && ./phing cron > /dev/null 2>&1 - -kind: ConfigMap -metadata: - name: cron-list - namespace: myproject-production ---- -apiVersion: v1 -data: - domains_urls.yaml: | - domains_urls: - - id: 1 - url: https://www.example.com - - id: 2 - url: https://www.example.sk -kind: ConfigMap -metadata: - name: domains-urls-m8t7497btf - namespace: myproject-production ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: cron - name: cron - namespace: myproject-production -spec: - progressDeadlineSeconds: 1500 - replicas: 1 - selector: - matchLabels: - app: cron - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 0 - type: RollingUpdate - template: - metadata: - annotations: - logging/enabled: "true" - project/app: cron - project/environment: production - project/name: myproject - labels: - app: cron - date: "1234567890" - spec: - affinity: - nodeAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - preference: - matchExpressions: - - key: workload - operator: In - values: - - background - weight: 100 - containers: - - args: - - cd /var/www/html && ./phing warmup > /dev/null && rm -rf /tmp/log-pipe && - mkfifo /tmp/log-pipe && chmod 666 /tmp/log-pipe && crontab -u root /var/spool/cron/template - && { crond || cron; } && stdbuf -o0 tail -n +1 -f /tmp/log-pipe - command: - - /bin/sh - - -c - env: - - name: ELASTICSEARCH_HOST - value: http://elasticsearch:9200 - - name: TRUSTED_PROXY - value: 10.0.0.0/8 - - name: DATABASE_NAME - value: myproject-production - - name: S3_ENDPOINT - value: https://s3.example.com - - name: MAILER_FORCE_WHITELIST - value: "false" - - name: DATABASE_USER - value: myproject-production - - name: DATABASE_PORT - value: "5432" - - name: MESSENGER_TRANSPORT_DSN - value: amqp://guest:guest@rabbitmq:5672/%2f/messages - - name: REDIS_PREFIX - value: myproject-production - - name: DATABASE_PASSWORD - value: test-db-password - - name: DATABASE_HOST - value: 10.0.0.100 - - name: ELASTIC_SEARCH_INDEX_PREFIX - value: myproject-production - - name: S3_SECRET - value: test-s3-secret - - name: MAILER_DSN - value: smtp://mailhog:1025 - - name: S3_BUCKET_NAME - value: myproject-production - - name: S3_ACCESS_KEY - value: myproject-production - - name: APP_SECRET - value: test-app-secret-key - image: v1.0.0 - imagePullPolicy: IfNotPresent - lifecycle: - preStop: - exec: - command: - - sleep - - "5" - name: cron - securityContext: - runAsUser: 0 - volumeMounts: - - mountPath: /var/www/html/config/domains_urls.yaml - name: domains-urls - subPath: domains_urls.yaml - - mountPath: /var/spool/cron/template - name: cron-list - subPath: cron - - mountPath: /root/.project_env.sh - name: cron-env - subPath: .project_env.sh - - mountPath: /var/www/html/config/frontend-api - name: fe-api-keys-volume - readOnly: true - workingDir: /var/www/html - imagePullSecrets: - - name: dockerregistry - tolerations: - - effect: NoSchedule - key: workload - operator: Equal - value: background - volumes: - - configMap: - name: domains-urls-m8t7497btf - name: domains-urls - - configMap: - name: cron-list - name: cron-list - - configMap: - name: cron-env - name: cron-env - - name: fe-api-keys-volume - secret: - defaultMode: 420 - secretName: fe-api-keys diff --git a/tests/scenarios/basic-production/expected/webserver.yaml b/tests/scenarios/basic-production/expected/webserver.yaml index c8a38ee..4829d3f 100644 --- a/tests/scenarios/basic-production/expected/webserver.yaml +++ b/tests/scenarios/basic-production/expected/webserver.yaml @@ -4,6 +4,42 @@ metadata: name: myproject-production --- apiVersion: v1 +data: + .project_env.sh: | + export ELASTICSEARCH_HOST='http://elasticsearch:9200' + export TRUSTED_PROXY='10.0.0.0/8' + export DATABASE_NAME='myproject-production' + export S3_ENDPOINT='https://s3.example.com' + export MAILER_FORCE_WHITELIST='false' + export DATABASE_USER='myproject-production' + export DATABASE_PORT='5432' + export MESSENGER_TRANSPORT_DSN='amqp://guest:guest@rabbitmq:5672/%2f/messages' + export REDIS_PREFIX='myproject-production' + export DATABASE_PASSWORD='test-db-password' + export DATABASE_HOST='10.0.0.100' + export ELASTIC_SEARCH_INDEX_PREFIX='myproject-production' + export S3_SECRET='test-s3-secret' + export MAILER_DSN='smtp://mailhog:1025' + export S3_BUCKET_NAME='myproject-production' + export S3_ACCESS_KEY='myproject-production' + export APP_SECRET='test-app-secret-key' +kind: ConfigMap +metadata: + name: cron-env + namespace: myproject-production +--- +apiVersion: v1 +data: + cron: |+ + PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + */5 * * * * . /root/.project_env.sh && cd /var/www/html/ && ./phing cron > /dev/null 2>&1 + +kind: ConfigMap +metadata: + name: cron-list + namespace: myproject-production +--- +apiVersion: v1 data: domains_urls.yaml: | domains_urls: @@ -404,6 +440,139 @@ spec: --- apiVersion: apps/v1 kind: Deployment +metadata: + labels: + app: cron + name: cron + namespace: myproject-production +spec: + progressDeadlineSeconds: 1500 + replicas: 1 + selector: + matchLabels: + app: cron + strategy: + type: Recreate + template: + metadata: + annotations: + logging/enabled: "true" + project/app: cron + project/environment: production + project/name: myproject + labels: + app: cron + date: "1234567890" + spec: + affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - preference: + matchExpressions: + - key: workload + operator: In + values: + - background + weight: 100 + containers: + - args: + - | + ./phing warmup > /dev/null + # FIFO for logs rm -f /tmp/log-pipe && mkfifo /tmp/log-pipe && chmod 666 /tmp/log-pipe + # crontab crontab -u root /var/spool/cron/template + # run on backround stdbuf -o0 tail -n +1 -f /tmp/log-pipe & + exec crond -f || exec cron -f + command: + - /bin/sh + - -lc + env: + - name: ELASTICSEARCH_HOST + value: http://elasticsearch:9200 + - name: TRUSTED_PROXY + value: 10.0.0.0/8 + - name: DATABASE_NAME + value: myproject-production + - name: S3_ENDPOINT + value: https://s3.example.com + - name: MAILER_FORCE_WHITELIST + value: "false" + - name: DATABASE_USER + value: myproject-production + - name: DATABASE_PORT + value: "5432" + - name: MESSENGER_TRANSPORT_DSN + value: amqp://guest:guest@rabbitmq:5672/%2f/messages + - name: REDIS_PREFIX + value: myproject-production + - name: DATABASE_PASSWORD + value: test-db-password + - name: DATABASE_HOST + value: 10.0.0.100 + - name: ELASTIC_SEARCH_INDEX_PREFIX + value: myproject-production + - name: S3_SECRET + value: test-s3-secret + - name: MAILER_DSN + value: smtp://mailhog:1025 + - name: S3_BUCKET_NAME + value: myproject-production + - name: S3_ACCESS_KEY + value: myproject-production + - name: APP_SECRET + value: test-app-secret-key + image: v1.0.0 + imagePullPolicy: IfNotPresent + lifecycle: + preStop: + exec: + command: + - /bin/sh + - -lc + - | + ( ./bin/console deploy:cron:lock > /tmp/cron-lock.log 2>&1 || true ) & + ./bin/console deploy:cron:watch || true + name: cron + securityContext: + runAsUser: 0 + volumeMounts: + - mountPath: /var/www/html/config/domains_urls.yaml + name: domains-urls + subPath: domains_urls.yaml + - mountPath: /var/spool/cron/template + name: cron-list + subPath: cron + - mountPath: /root/.project_env.sh + name: cron-env + subPath: .project_env.sh + - mountPath: /var/www/html/config/frontend-api + name: fe-api-keys-volume + readOnly: true + workingDir: /var/www/html + imagePullSecrets: + - name: dockerregistry + terminationGracePeriodSeconds: 3000 + tolerations: + - effect: NoSchedule + key: workload + operator: Equal + value: background + volumes: + - configMap: + name: domains-urls-m8t7497btf + name: domains-urls + - configMap: + name: cron-list + name: cron-list + - configMap: + name: cron-env + name: cron-env + - name: fe-api-keys-volume + secret: + defaultMode: 420 + secretName: fe-api-keys +--- +apiVersion: apps/v1 +kind: Deployment metadata: name: storefront namespace: myproject-production diff --git a/tests/scenarios/development-single-domain/expected/cron.yaml b/tests/scenarios/development-single-domain/expected/cron.yaml deleted file mode 100644 index faae19b..0000000 --- a/tests/scenarios/development-single-domain/expected/cron.yaml +++ /dev/null @@ -1,180 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: myproject-dev ---- -apiVersion: v1 -data: - .project_env.sh: | - export ELASTICSEARCH_HOST='http://elasticsearch:9200' - export TRUSTED_PROXY='10.0.0.0/8' - export DATABASE_NAME='myproject-dev' - export S3_ENDPOINT='https://s3.example.com' - export MAILER_FORCE_WHITELIST='true' - export DATABASE_USER='myproject-dev' - export DATABASE_PORT='5432' - export MESSENGER_TRANSPORT_DSN='amqp://guest:guest@rabbitmq:5672/%2f/messages' - export REDIS_PREFIX='myproject-dev' - export DATABASE_PASSWORD='test-db-password' - export DATABASE_HOST='10.0.0.100' - export ELASTIC_SEARCH_INDEX_PREFIX='myproject-dev' - export S3_SECRET='test-s3-secret' - export MAILER_DSN='smtp://mailhog:1025' - export S3_BUCKET_NAME='myproject-dev' - export S3_ACCESS_KEY='myproject-dev' - export APP_SECRET='test-app-secret-key' -kind: ConfigMap -metadata: - name: cron-env - namespace: myproject-dev ---- -apiVersion: v1 -data: - cron: |+ - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - */5 * * * * . /root/.project_env.sh && cd /var/www/html/ && ./phing cron > /dev/null 2>&1 - -kind: ConfigMap -metadata: - name: cron-list - namespace: myproject-dev ---- -apiVersion: v1 -data: - domains_urls.yaml: | - domains_urls: - - id: 1 - url: https://dev.example.com -kind: ConfigMap -metadata: - name: domains-urls-5f46tgkghd - namespace: myproject-dev ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: cron - name: cron - namespace: myproject-dev -spec: - progressDeadlineSeconds: 1500 - replicas: 1 - selector: - matchLabels: - app: cron - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 0 - type: RollingUpdate - template: - metadata: - annotations: - logging/enabled: "true" - project/app: cron - project/environment: dev - project/name: myproject - labels: - app: cron - date: "1234567890" - spec: - affinity: - nodeAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - preference: - matchExpressions: - - key: workload - operator: In - values: - - background - weight: 100 - containers: - - args: - - cd /var/www/html && ./phing warmup > /dev/null && rm -rf /tmp/log-pipe && - mkfifo /tmp/log-pipe && chmod 666 /tmp/log-pipe && crontab -u root /var/spool/cron/template - && { crond || cron; } && stdbuf -o0 tail -n +1 -f /tmp/log-pipe - command: - - /bin/sh - - -c - env: - - name: ELASTICSEARCH_HOST - value: http://elasticsearch:9200 - - name: TRUSTED_PROXY - value: 10.0.0.0/8 - - name: DATABASE_NAME - value: myproject-dev - - name: S3_ENDPOINT - value: https://s3.example.com - - name: MAILER_FORCE_WHITELIST - value: "true" - - name: DATABASE_USER - value: myproject-dev - - name: DATABASE_PORT - value: "5432" - - name: MESSENGER_TRANSPORT_DSN - value: amqp://guest:guest@rabbitmq:5672/%2f/messages - - name: REDIS_PREFIX - value: myproject-dev - - name: DATABASE_PASSWORD - value: test-db-password - - name: DATABASE_HOST - value: 10.0.0.100 - - name: ELASTIC_SEARCH_INDEX_PREFIX - value: myproject-dev - - name: S3_SECRET - value: test-s3-secret - - name: MAILER_DSN - value: smtp://mailhog:1025 - - name: S3_BUCKET_NAME - value: myproject-dev - - name: S3_ACCESS_KEY - value: myproject-dev - - name: APP_SECRET - value: test-app-secret-key - image: dev-latest - imagePullPolicy: IfNotPresent - lifecycle: - preStop: - exec: - command: - - sleep - - "5" - name: cron - securityContext: - runAsUser: 0 - volumeMounts: - - mountPath: /var/www/html/config/domains_urls.yaml - name: domains-urls - subPath: domains_urls.yaml - - mountPath: /var/spool/cron/template - name: cron-list - subPath: cron - - mountPath: /root/.project_env.sh - name: cron-env - subPath: .project_env.sh - - mountPath: /var/www/html/config/frontend-api - name: fe-api-keys-volume - readOnly: true - workingDir: /var/www/html - imagePullSecrets: - - name: dockerregistry - tolerations: - - effect: NoSchedule - key: workload - operator: Equal - value: background - volumes: - - configMap: - name: domains-urls-5f46tgkghd - name: domains-urls - - configMap: - name: cron-list - name: cron-list - - configMap: - name: cron-env - name: cron-env - - name: fe-api-keys-volume - secret: - defaultMode: 420 - secretName: fe-api-keys diff --git a/tests/scenarios/development-single-domain/expected/webserver.yaml b/tests/scenarios/development-single-domain/expected/webserver.yaml index dd1b707..071b317 100644 --- a/tests/scenarios/development-single-domain/expected/webserver.yaml +++ b/tests/scenarios/development-single-domain/expected/webserver.yaml @@ -4,6 +4,42 @@ metadata: name: myproject-dev --- apiVersion: v1 +data: + .project_env.sh: | + export ELASTICSEARCH_HOST='http://elasticsearch:9200' + export TRUSTED_PROXY='10.0.0.0/8' + export DATABASE_NAME='myproject-dev' + export S3_ENDPOINT='https://s3.example.com' + export MAILER_FORCE_WHITELIST='true' + export DATABASE_USER='myproject-dev' + export DATABASE_PORT='5432' + export MESSENGER_TRANSPORT_DSN='amqp://guest:guest@rabbitmq:5672/%2f/messages' + export REDIS_PREFIX='myproject-dev' + export DATABASE_PASSWORD='test-db-password' + export DATABASE_HOST='10.0.0.100' + export ELASTIC_SEARCH_INDEX_PREFIX='myproject-dev' + export S3_SECRET='test-s3-secret' + export MAILER_DSN='smtp://mailhog:1025' + export S3_BUCKET_NAME='myproject-dev' + export S3_ACCESS_KEY='myproject-dev' + export APP_SECRET='test-app-secret-key' +kind: ConfigMap +metadata: + name: cron-env + namespace: myproject-dev +--- +apiVersion: v1 +data: + cron: |+ + PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + */5 * * * * . /root/.project_env.sh && cd /var/www/html/ && ./phing cron > /dev/null 2>&1 + +kind: ConfigMap +metadata: + name: cron-list + namespace: myproject-dev +--- +apiVersion: v1 data: domains_urls.yaml: | domains_urls: @@ -402,6 +438,139 @@ spec: --- apiVersion: apps/v1 kind: Deployment +metadata: + labels: + app: cron + name: cron + namespace: myproject-dev +spec: + progressDeadlineSeconds: 1500 + replicas: 1 + selector: + matchLabels: + app: cron + strategy: + type: Recreate + template: + metadata: + annotations: + logging/enabled: "true" + project/app: cron + project/environment: dev + project/name: myproject + labels: + app: cron + date: "1234567890" + spec: + affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - preference: + matchExpressions: + - key: workload + operator: In + values: + - background + weight: 100 + containers: + - args: + - | + ./phing warmup > /dev/null + # FIFO for logs rm -f /tmp/log-pipe && mkfifo /tmp/log-pipe && chmod 666 /tmp/log-pipe + # crontab crontab -u root /var/spool/cron/template + # run on backround stdbuf -o0 tail -n +1 -f /tmp/log-pipe & + exec crond -f || exec cron -f + command: + - /bin/sh + - -lc + env: + - name: ELASTICSEARCH_HOST + value: http://elasticsearch:9200 + - name: TRUSTED_PROXY + value: 10.0.0.0/8 + - name: DATABASE_NAME + value: myproject-dev + - name: S3_ENDPOINT + value: https://s3.example.com + - name: MAILER_FORCE_WHITELIST + value: "true" + - name: DATABASE_USER + value: myproject-dev + - name: DATABASE_PORT + value: "5432" + - name: MESSENGER_TRANSPORT_DSN + value: amqp://guest:guest@rabbitmq:5672/%2f/messages + - name: REDIS_PREFIX + value: myproject-dev + - name: DATABASE_PASSWORD + value: test-db-password + - name: DATABASE_HOST + value: 10.0.0.100 + - name: ELASTIC_SEARCH_INDEX_PREFIX + value: myproject-dev + - name: S3_SECRET + value: test-s3-secret + - name: MAILER_DSN + value: smtp://mailhog:1025 + - name: S3_BUCKET_NAME + value: myproject-dev + - name: S3_ACCESS_KEY + value: myproject-dev + - name: APP_SECRET + value: test-app-secret-key + image: dev-latest + imagePullPolicy: IfNotPresent + lifecycle: + preStop: + exec: + command: + - /bin/sh + - -lc + - | + ( ./bin/console deploy:cron:lock > /tmp/cron-lock.log 2>&1 || true ) & + ./bin/console deploy:cron:watch || true + name: cron + securityContext: + runAsUser: 0 + volumeMounts: + - mountPath: /var/www/html/config/domains_urls.yaml + name: domains-urls + subPath: domains_urls.yaml + - mountPath: /var/spool/cron/template + name: cron-list + subPath: cron + - mountPath: /root/.project_env.sh + name: cron-env + subPath: .project_env.sh + - mountPath: /var/www/html/config/frontend-api + name: fe-api-keys-volume + readOnly: true + workingDir: /var/www/html + imagePullSecrets: + - name: dockerregistry + terminationGracePeriodSeconds: 3000 + tolerations: + - effect: NoSchedule + key: workload + operator: Equal + value: background + volumes: + - configMap: + name: domains-urls-5f46tgkghd + name: domains-urls + - configMap: + name: cron-list + name: cron-list + - configMap: + name: cron-env + name: cron-env + - name: fe-api-keys-volume + secret: + defaultMode: 420 + secretName: fe-api-keys +--- +apiVersion: apps/v1 +kind: Deployment metadata: name: storefront namespace: myproject-dev diff --git a/tests/scenarios/escaping-env/expected/cron.yaml b/tests/scenarios/escaping-env/expected/cron.yaml deleted file mode 100644 index 759d1b1..0000000 --- a/tests/scenarios/escaping-env/expected/cron.yaml +++ /dev/null @@ -1,185 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: myproject-production ---- -apiVersion: v1 -data: - .project_env.sh: | - export ELASTICSEARCH_HOST='http://elasticsearch:9200' - export TRUSTED_PROXY='10.0.0.0/8' - export DATABASE_NAME='myproject-production' - export S3_ENDPOINT='https://s3.example.com' - export MAILER_FORCE_WHITELIST='false' - export DATABASE_USER='myproject-production' - export DATABASE_PORT='5432' - export MESSENGER_TRANSPORT_DSN='amqp://guest:guest@rabbitmq:5672/%2f/messages' - export REDIS_PREFIX='myproject-production' - export DATABASE_PASSWORD='test-db-password' - export DATABASE_HOST='10.0.0.100' - export ELASTIC_SEARCH_INDEX_PREFIX='myproject-production' - export SENTRY_RELEASE='479411e7' - export S3_SECRET='test-s3-secret' - export MAILER_DSN='smtp://mailhog:1025' - export S3_BUCKET_NAME='myproject-production' - export S3_ACCESS_KEY='myproject-production' - export APP_SECRET='test-app-secret-key' -kind: ConfigMap -metadata: - name: cron-env - namespace: myproject-production ---- -apiVersion: v1 -data: - cron: |+ - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - */5 * * * * . /root/.project_env.sh && cd /var/www/html/ && ./phing cron > /dev/null 2>&1 - -kind: ConfigMap -metadata: - name: cron-list - namespace: myproject-production ---- -apiVersion: v1 -data: - domains_urls.yaml: | - domains_urls: - - id: 1 - url: https://www.example.com - - id: 2 - url: https://www.example.sk -kind: ConfigMap -metadata: - name: domains-urls-m8t7497btf - namespace: myproject-production ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: cron - name: cron - namespace: myproject-production -spec: - progressDeadlineSeconds: 1500 - replicas: 1 - selector: - matchLabels: - app: cron - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 0 - type: RollingUpdate - template: - metadata: - annotations: - logging/enabled: "true" - project/app: cron - project/environment: production - project/name: myproject - labels: - app: cron - date: "1234567890" - spec: - affinity: - nodeAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - preference: - matchExpressions: - - key: workload - operator: In - values: - - background - weight: 100 - containers: - - args: - - cd /var/www/html && ./phing warmup > /dev/null && rm -rf /tmp/log-pipe && - mkfifo /tmp/log-pipe && chmod 666 /tmp/log-pipe && crontab -u root /var/spool/cron/template - && { crond || cron; } && stdbuf -o0 tail -n +1 -f /tmp/log-pipe - command: - - /bin/sh - - -c - env: - - name: ELASTICSEARCH_HOST - value: http://elasticsearch:9200 - - name: TRUSTED_PROXY - value: 10.0.0.0/8 - - name: DATABASE_NAME - value: myproject-production - - name: S3_ENDPOINT - value: https://s3.example.com - - name: MAILER_FORCE_WHITELIST - value: "false" - - name: DATABASE_USER - value: myproject-production - - name: DATABASE_PORT - value: "5432" - - name: MESSENGER_TRANSPORT_DSN - value: amqp://guest:guest@rabbitmq:5672/%2f/messages - - name: REDIS_PREFIX - value: myproject-production - - name: DATABASE_PASSWORD - value: test-db-password - - name: DATABASE_HOST - value: 10.0.0.100 - - name: ELASTIC_SEARCH_INDEX_PREFIX - value: myproject-production - - name: SENTRY_RELEASE - value: "479411e7" - - name: S3_SECRET - value: test-s3-secret - - name: MAILER_DSN - value: smtp://mailhog:1025 - - name: S3_BUCKET_NAME - value: myproject-production - - name: S3_ACCESS_KEY - value: myproject-production - - name: APP_SECRET - value: test-app-secret-key - image: v1.0.0 - imagePullPolicy: IfNotPresent - lifecycle: - preStop: - exec: - command: - - sleep - - "5" - name: cron - securityContext: - runAsUser: 0 - volumeMounts: - - mountPath: /var/www/html/config/domains_urls.yaml - name: domains-urls - subPath: domains_urls.yaml - - mountPath: /var/spool/cron/template - name: cron-list - subPath: cron - - mountPath: /root/.project_env.sh - name: cron-env - subPath: .project_env.sh - - mountPath: /var/www/html/config/frontend-api - name: fe-api-keys-volume - readOnly: true - workingDir: /var/www/html - imagePullSecrets: - - name: dockerregistry - tolerations: - - effect: NoSchedule - key: workload - operator: Equal - value: background - volumes: - - configMap: - name: domains-urls-m8t7497btf - name: domains-urls - - configMap: - name: cron-list - name: cron-list - - configMap: - name: cron-env - name: cron-env - - name: fe-api-keys-volume - secret: - defaultMode: 420 - secretName: fe-api-keys diff --git a/tests/scenarios/escaping-env/expected/webserver.yaml b/tests/scenarios/escaping-env/expected/webserver.yaml index 2242efc..fe02564 100644 --- a/tests/scenarios/escaping-env/expected/webserver.yaml +++ b/tests/scenarios/escaping-env/expected/webserver.yaml @@ -4,6 +4,43 @@ metadata: name: myproject-production --- apiVersion: v1 +data: + .project_env.sh: | + export ELASTICSEARCH_HOST='http://elasticsearch:9200' + export TRUSTED_PROXY='10.0.0.0/8' + export DATABASE_NAME='myproject-production' + export S3_ENDPOINT='https://s3.example.com' + export MAILER_FORCE_WHITELIST='false' + export DATABASE_USER='myproject-production' + export DATABASE_PORT='5432' + export MESSENGER_TRANSPORT_DSN='amqp://guest:guest@rabbitmq:5672/%2f/messages' + export REDIS_PREFIX='myproject-production' + export DATABASE_PASSWORD='test-db-password' + export DATABASE_HOST='10.0.0.100' + export ELASTIC_SEARCH_INDEX_PREFIX='myproject-production' + export SENTRY_RELEASE='479411e7' + export S3_SECRET='test-s3-secret' + export MAILER_DSN='smtp://mailhog:1025' + export S3_BUCKET_NAME='myproject-production' + export S3_ACCESS_KEY='myproject-production' + export APP_SECRET='test-app-secret-key' +kind: ConfigMap +metadata: + name: cron-env + namespace: myproject-production +--- +apiVersion: v1 +data: + cron: |+ + PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + */5 * * * * . /root/.project_env.sh && cd /var/www/html/ && ./phing cron > /dev/null 2>&1 + +kind: ConfigMap +metadata: + name: cron-list + namespace: myproject-production +--- +apiVersion: v1 data: domains_urls.yaml: | domains_urls: @@ -404,6 +441,141 @@ spec: --- apiVersion: apps/v1 kind: Deployment +metadata: + labels: + app: cron + name: cron + namespace: myproject-production +spec: + progressDeadlineSeconds: 1500 + replicas: 1 + selector: + matchLabels: + app: cron + strategy: + type: Recreate + template: + metadata: + annotations: + logging/enabled: "true" + project/app: cron + project/environment: production + project/name: myproject + labels: + app: cron + date: "1234567890" + spec: + affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - preference: + matchExpressions: + - key: workload + operator: In + values: + - background + weight: 100 + containers: + - args: + - | + ./phing warmup > /dev/null + # FIFO for logs rm -f /tmp/log-pipe && mkfifo /tmp/log-pipe && chmod 666 /tmp/log-pipe + # crontab crontab -u root /var/spool/cron/template + # run on backround stdbuf -o0 tail -n +1 -f /tmp/log-pipe & + exec crond -f || exec cron -f + command: + - /bin/sh + - -lc + env: + - name: ELASTICSEARCH_HOST + value: http://elasticsearch:9200 + - name: TRUSTED_PROXY + value: 10.0.0.0/8 + - name: DATABASE_NAME + value: myproject-production + - name: S3_ENDPOINT + value: https://s3.example.com + - name: MAILER_FORCE_WHITELIST + value: "false" + - name: DATABASE_USER + value: myproject-production + - name: DATABASE_PORT + value: "5432" + - name: MESSENGER_TRANSPORT_DSN + value: amqp://guest:guest@rabbitmq:5672/%2f/messages + - name: REDIS_PREFIX + value: myproject-production + - name: DATABASE_PASSWORD + value: test-db-password + - name: DATABASE_HOST + value: 10.0.0.100 + - name: ELASTIC_SEARCH_INDEX_PREFIX + value: myproject-production + - name: SENTRY_RELEASE + value: "479411e7" + - name: S3_SECRET + value: test-s3-secret + - name: MAILER_DSN + value: smtp://mailhog:1025 + - name: S3_BUCKET_NAME + value: myproject-production + - name: S3_ACCESS_KEY + value: myproject-production + - name: APP_SECRET + value: test-app-secret-key + image: v1.0.0 + imagePullPolicy: IfNotPresent + lifecycle: + preStop: + exec: + command: + - /bin/sh + - -lc + - | + ( ./bin/console deploy:cron:lock > /tmp/cron-lock.log 2>&1 || true ) & + ./bin/console deploy:cron:watch || true + name: cron + securityContext: + runAsUser: 0 + volumeMounts: + - mountPath: /var/www/html/config/domains_urls.yaml + name: domains-urls + subPath: domains_urls.yaml + - mountPath: /var/spool/cron/template + name: cron-list + subPath: cron + - mountPath: /root/.project_env.sh + name: cron-env + subPath: .project_env.sh + - mountPath: /var/www/html/config/frontend-api + name: fe-api-keys-volume + readOnly: true + workingDir: /var/www/html + imagePullSecrets: + - name: dockerregistry + terminationGracePeriodSeconds: 3000 + tolerations: + - effect: NoSchedule + key: workload + operator: Equal + value: background + volumes: + - configMap: + name: domains-urls-m8t7497btf + name: domains-urls + - configMap: + name: cron-list + name: cron-list + - configMap: + name: cron-env + name: cron-env + - name: fe-api-keys-volume + secret: + defaultMode: 420 + secretName: fe-api-keys +--- +apiVersion: apps/v1 +kind: Deployment metadata: name: storefront namespace: myproject-production diff --git a/tests/scenarios/production-with-cloudflare/expected/cron.yaml b/tests/scenarios/production-with-cloudflare/expected/cron.yaml deleted file mode 100644 index 4604bb6..0000000 --- a/tests/scenarios/production-with-cloudflare/expected/cron.yaml +++ /dev/null @@ -1,183 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: shop-production ---- -apiVersion: v1 -data: - .project_env.sh: | - export ELASTICSEARCH_HOST='http://elasticsearch:9200' - export TRUSTED_PROXY='10.0.0.0/8' - export DATABASE_NAME='shop-production' - export S3_ENDPOINT='https://s3.example.com' - export MAILER_FORCE_WHITELIST='false' - export DATABASE_USER='shop-production' - export DATABASE_PORT='5432' - export MESSENGER_TRANSPORT_DSN='amqp://guest:guest@rabbitmq:5672/%2f/messages' - export REDIS_PREFIX='shop-production' - export DATABASE_PASSWORD='test-db-password' - export DATABASE_HOST='10.0.0.100' - export ELASTIC_SEARCH_INDEX_PREFIX='shop-production' - export S3_SECRET='test-s3-secret' - export MAILER_DSN='smtp://mailhog:1025' - export S3_BUCKET_NAME='shop-production' - export S3_ACCESS_KEY='shop-production' - export APP_SECRET='test-app-secret-key' -kind: ConfigMap -metadata: - name: cron-env - namespace: shop-production ---- -apiVersion: v1 -data: - cron: |+ - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - */5 * * * * . /root/.project_env.sh && cd /var/www/html/ && ./phing cron > /dev/null 2>&1 - 0 */2 * * * . /root/.project_env.sh && cd /var/www/html/ && ./phing feed-generator > /dev/null 2>&1 - -kind: ConfigMap -metadata: - name: cron-list - namespace: shop-production ---- -apiVersion: v1 -data: - domains_urls.yaml: | - domains_urls: - - id: 1 - url: https://www.shop.com - - id: 2 - url: https://www.shop.de -kind: ConfigMap -metadata: - name: domains-urls-47t6ghttc4 - namespace: shop-production ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: cron - name: cron - namespace: shop-production -spec: - progressDeadlineSeconds: 1500 - replicas: 1 - selector: - matchLabels: - app: cron - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 0 - type: RollingUpdate - template: - metadata: - annotations: - logging/enabled: "true" - project/app: cron - project/environment: production - project/name: shop - labels: - app: cron - date: "1234567890" - spec: - affinity: - nodeAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - preference: - matchExpressions: - - key: workload - operator: In - values: - - background - weight: 100 - containers: - - args: - - cd /var/www/html && ./phing warmup > /dev/null && rm -rf /tmp/log-pipe && - mkfifo /tmp/log-pipe && chmod 666 /tmp/log-pipe && crontab -u root /var/spool/cron/template - && { crond || cron; } && stdbuf -o0 tail -n +1 -f /tmp/log-pipe - command: - - /bin/sh - - -c - env: - - name: ELASTICSEARCH_HOST - value: http://elasticsearch:9200 - - name: TRUSTED_PROXY - value: 10.0.0.0/8 - - name: DATABASE_NAME - value: shop-production - - name: S3_ENDPOINT - value: https://s3.example.com - - name: MAILER_FORCE_WHITELIST - value: "false" - - name: DATABASE_USER - value: shop-production - - name: DATABASE_PORT - value: "5432" - - name: MESSENGER_TRANSPORT_DSN - value: amqp://guest:guest@rabbitmq:5672/%2f/messages - - name: REDIS_PREFIX - value: shop-production - - name: DATABASE_PASSWORD - value: test-db-password - - name: DATABASE_HOST - value: 10.0.0.100 - - name: ELASTIC_SEARCH_INDEX_PREFIX - value: shop-production - - name: S3_SECRET - value: test-s3-secret - - name: MAILER_DSN - value: smtp://mailhog:1025 - - name: S3_BUCKET_NAME - value: shop-production - - name: S3_ACCESS_KEY - value: shop-production - - name: APP_SECRET - value: test-app-secret-key - image: v2.5.0 - imagePullPolicy: IfNotPresent - lifecycle: - preStop: - exec: - command: - - sleep - - "5" - name: cron - securityContext: - runAsUser: 0 - volumeMounts: - - mountPath: /var/www/html/config/domains_urls.yaml - name: domains-urls - subPath: domains_urls.yaml - - mountPath: /var/spool/cron/template - name: cron-list - subPath: cron - - mountPath: /root/.project_env.sh - name: cron-env - subPath: .project_env.sh - - mountPath: /var/www/html/config/frontend-api - name: fe-api-keys-volume - readOnly: true - workingDir: /var/www/html - imagePullSecrets: - - name: dockerregistry - tolerations: - - effect: NoSchedule - key: workload - operator: Equal - value: background - volumes: - - configMap: - name: domains-urls-47t6ghttc4 - name: domains-urls - - configMap: - name: cron-list - name: cron-list - - configMap: - name: cron-env - name: cron-env - - name: fe-api-keys-volume - secret: - defaultMode: 420 - secretName: fe-api-keys diff --git a/tests/scenarios/production-with-cloudflare/expected/webserver.yaml b/tests/scenarios/production-with-cloudflare/expected/webserver.yaml index b553365..92cbd9e 100644 --- a/tests/scenarios/production-with-cloudflare/expected/webserver.yaml +++ b/tests/scenarios/production-with-cloudflare/expected/webserver.yaml @@ -4,6 +4,43 @@ metadata: name: shop-production --- apiVersion: v1 +data: + .project_env.sh: | + export ELASTICSEARCH_HOST='http://elasticsearch:9200' + export TRUSTED_PROXY='10.0.0.0/8' + export DATABASE_NAME='shop-production' + export S3_ENDPOINT='https://s3.example.com' + export MAILER_FORCE_WHITELIST='false' + export DATABASE_USER='shop-production' + export DATABASE_PORT='5432' + export MESSENGER_TRANSPORT_DSN='amqp://guest:guest@rabbitmq:5672/%2f/messages' + export REDIS_PREFIX='shop-production' + export DATABASE_PASSWORD='test-db-password' + export DATABASE_HOST='10.0.0.100' + export ELASTIC_SEARCH_INDEX_PREFIX='shop-production' + export S3_SECRET='test-s3-secret' + export MAILER_DSN='smtp://mailhog:1025' + export S3_BUCKET_NAME='shop-production' + export S3_ACCESS_KEY='shop-production' + export APP_SECRET='test-app-secret-key' +kind: ConfigMap +metadata: + name: cron-env + namespace: shop-production +--- +apiVersion: v1 +data: + cron: |+ + PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + */5 * * * * . /root/.project_env.sh && cd /var/www/html/ && ./phing cron > /dev/null 2>&1 + 0 */2 * * * . /root/.project_env.sh && cd /var/www/html/ && ./phing feed-generator > /dev/null 2>&1 + +kind: ConfigMap +metadata: + name: cron-list + namespace: shop-production +--- +apiVersion: v1 data: domains_urls.yaml: | domains_urls: @@ -404,6 +441,139 @@ spec: --- apiVersion: apps/v1 kind: Deployment +metadata: + labels: + app: cron + name: cron + namespace: shop-production +spec: + progressDeadlineSeconds: 1500 + replicas: 1 + selector: + matchLabels: + app: cron + strategy: + type: Recreate + template: + metadata: + annotations: + logging/enabled: "true" + project/app: cron + project/environment: production + project/name: shop + labels: + app: cron + date: "1234567890" + spec: + affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - preference: + matchExpressions: + - key: workload + operator: In + values: + - background + weight: 100 + containers: + - args: + - | + ./phing warmup > /dev/null + # FIFO for logs rm -f /tmp/log-pipe && mkfifo /tmp/log-pipe && chmod 666 /tmp/log-pipe + # crontab crontab -u root /var/spool/cron/template + # run on backround stdbuf -o0 tail -n +1 -f /tmp/log-pipe & + exec crond -f || exec cron -f + command: + - /bin/sh + - -lc + env: + - name: ELASTICSEARCH_HOST + value: http://elasticsearch:9200 + - name: TRUSTED_PROXY + value: 10.0.0.0/8 + - name: DATABASE_NAME + value: shop-production + - name: S3_ENDPOINT + value: https://s3.example.com + - name: MAILER_FORCE_WHITELIST + value: "false" + - name: DATABASE_USER + value: shop-production + - name: DATABASE_PORT + value: "5432" + - name: MESSENGER_TRANSPORT_DSN + value: amqp://guest:guest@rabbitmq:5672/%2f/messages + - name: REDIS_PREFIX + value: shop-production + - name: DATABASE_PASSWORD + value: test-db-password + - name: DATABASE_HOST + value: 10.0.0.100 + - name: ELASTIC_SEARCH_INDEX_PREFIX + value: shop-production + - name: S3_SECRET + value: test-s3-secret + - name: MAILER_DSN + value: smtp://mailhog:1025 + - name: S3_BUCKET_NAME + value: shop-production + - name: S3_ACCESS_KEY + value: shop-production + - name: APP_SECRET + value: test-app-secret-key + image: v2.5.0 + imagePullPolicy: IfNotPresent + lifecycle: + preStop: + exec: + command: + - /bin/sh + - -lc + - | + ( ./bin/console deploy:cron:lock > /tmp/cron-lock.log 2>&1 || true ) & + ./bin/console deploy:cron:watch || true + name: cron + securityContext: + runAsUser: 0 + volumeMounts: + - mountPath: /var/www/html/config/domains_urls.yaml + name: domains-urls + subPath: domains_urls.yaml + - mountPath: /var/spool/cron/template + name: cron-list + subPath: cron + - mountPath: /root/.project_env.sh + name: cron-env + subPath: .project_env.sh + - mountPath: /var/www/html/config/frontend-api + name: fe-api-keys-volume + readOnly: true + workingDir: /var/www/html + imagePullSecrets: + - name: dockerregistry + terminationGracePeriodSeconds: 3000 + tolerations: + - effect: NoSchedule + key: workload + operator: Equal + value: background + volumes: + - configMap: + name: domains-urls-47t6ghttc4 + name: domains-urls + - configMap: + name: cron-list + name: cron-list + - configMap: + name: cron-env + name: cron-env + - name: fe-api-keys-volume + secret: + defaultMode: 420 + secretName: fe-api-keys +--- +apiVersion: apps/v1 +kind: Deployment metadata: name: storefront namespace: shop-production