From e82b563fe6209cecf76f1161a068b87b5286d231 Mon Sep 17 00:00:00 2001 From: Dustin Falgout Date: Tue, 1 Mar 2022 17:01:42 -0600 Subject: [PATCH] feat(cloud): add php opcache settings to cloud-screenshot environment. --- charts/cloud-screenshot/Chart.yaml | 2 +- .../cloud-screenshot/templates/_helpers.tpl | 14 ++-- .../templates/cloud-screenshot.yml | 30 +++++--- charts/cloud-screenshot/templates/secrets.yml | 76 +++++++++---------- 4 files changed, 67 insertions(+), 55 deletions(-) diff --git a/charts/cloud-screenshot/Chart.yaml b/charts/cloud-screenshot/Chart.yaml index 60745be..db785c9 100644 --- a/charts/cloud-screenshot/Chart.yaml +++ b/charts/cloud-screenshot/Chart.yaml @@ -5,4 +5,4 @@ maintainers: - email: dustin@elegantthemes.com name: Elegant Themes name: cloud-screenshot -version: 0.9.15 +version: 0.9.16 diff --git a/charts/cloud-screenshot/templates/_helpers.tpl b/charts/cloud-screenshot/templates/_helpers.tpl index 2ef14c7..485f87f 100644 --- a/charts/cloud-screenshot/templates/_helpers.tpl +++ b/charts/cloud-screenshot/templates/_helpers.tpl @@ -6,16 +6,20 @@ fieldRef: fieldPath: spec.nodeName - name: CLOUD_SCREENSHOT_PATH - value: '{{ .Values.INSTALL_PATH }}' + value: {{ .Values.INSTALL_PATH | squote }} - name: VIRTUAL_HOST - value: '{{ .Values.VIRTUAL_HOST }}' + value: {{ .Values.VIRTUAL_HOST | squote }} - name: CLOUD_SCREENSHOT_REPO_URL - value: '{{ .Values.CLOUD_SCREENSHOT_REPO_URL }}' + value: {{ .Values.CLOUD_SCREENSHOT_REPO_URL | squote }} - name: IMAGE_VERSION - value: '{{ .Values.CLOUD_SCREENSHOT_VERSION }}' + value: {{ .Values.CLOUD_SCREENSHOT_VERSION | squote }} - name: CLOUD_SCREENSHOT_WORKER value: '1' - image: '{{ .Values.CLOUD_SCREENSHOT_IMAGE }}' + - name: PHP_OPCACHE_FILE_CACHE + value: {{ ternary "/var/cache/php" "" (eq "production" .Values.WP_ENV) | squote }} + - name: PHP_OPCACHE_VALIDATE_TIMESTAMPS + value: {{ ternary "false" "true" (eq "production" .Values.WP_ENV) | squote }} + image: {{ .Values.CLOUD_SCREENSHOT_IMAGE | squote }} resources: requests: cpu: 100m diff --git a/charts/cloud-screenshot/templates/cloud-screenshot.yml b/charts/cloud-screenshot/templates/cloud-screenshot.yml index 52b59b6..d3f9833 100644 --- a/charts/cloud-screenshot/templates/cloud-screenshot.yml +++ b/charts/cloud-screenshot/templates/cloud-screenshot.yml @@ -56,18 +56,22 @@ spec: fieldRef: fieldPath: spec.nodeName - name: CLOUD_SCREENSHOT_PATH - value: '{{ .Values.INSTALL_PATH }}' + value: {{ .Values.INSTALL_PATH | squote }} - name: VIRTUAL_HOST - value: '{{ .Values.VIRTUAL_HOST }}' + value: {{ .Values.VIRTUAL_HOST | squote }} - name: CLOUD_SCREENSHOT_REPO_URL - value: '{{ .Values.CLOUD_SCREENSHOT_REPO_URL }}' + value: {{ .Values.CLOUD_SCREENSHOT_REPO_URL | squote }} - name: IMAGE_VERSION - value: '{{ .Values.CLOUD_SCREENSHOT_VERSION }}' + value: {{ .Values.CLOUD_SCREENSHOT_VERSION | squote }} - name: CLOUD_SCREENSHOT_INIT value: '1' - name: DIVI_VERSION - value: '{{ .Values.DIVI_VERSION }}' - image: '{{ .Values.CLOUD_SCREENSHOT_IMAGE }}' + value: {{ .Values.DIVI_VERSION | squote }} + - name: PHP_OPCACHE_FILE_CACHE + value: {{ ternary "/var/cache/php" "" (eq "production" .Values.WP_ENV) | squote }} + - name: PHP_OPCACHE_VALIDATE_TIMESTAMPS + value: {{ ternary "false" "true" (eq "production" .Values.WP_ENV) | squote }} + image: {{ .Values.CLOUD_SCREENSHOT_IMAGE | squote }} command: ['/etc/cont-init.d/init'] resources: requests: @@ -90,15 +94,19 @@ spec: fieldRef: fieldPath: spec.nodeName - name: CLOUD_SCREENSHOT_PATH - value: '{{ .Values.INSTALL_PATH }}' + value: {{ .Values.INSTALL_PATH | squote }} - name: VIRTUAL_HOST - value: '{{ .Values.VIRTUAL_HOST }}' + value: {{ .Values.VIRTUAL_HOST | squote }} - name: CLOUD_SCREENSHOT_REPO_URL - value: '{{ .Values.CLOUD_SCREENSHOT_REPO_URL }}' + value: {{ .Values.CLOUD_SCREENSHOT_REPO_URL | squote }} - name: IMAGE_VERSION - value: '{{ .Values.CLOUD_SCREENSHOT_VERSION }}' + value: {{ .Values.CLOUD_SCREENSHOT_VERSION | squote }} + - name: PHP_OPCACHE_FILE_CACHE + value: {{ ternary "/var/cache/php" "" (eq "production" .Values.WP_ENV) | squote }} + - name: PHP_OPCACHE_VALIDATE_TIMESTAMPS + value: {{ ternary "false" "true" (eq "production" .Values.WP_ENV) | squote }} - image: '{{ .Values.CLOUD_SCREENSHOT_IMAGE }}' + image: {{ .Values.CLOUD_SCREENSHOT_IMAGE | squote }} livenessProbe: exec: command: diff --git a/charts/cloud-screenshot/templates/secrets.yml b/charts/cloud-screenshot/templates/secrets.yml index 48af7d6..b14f7d0 100644 --- a/charts/cloud-screenshot/templates/secrets.yml +++ b/charts/cloud-screenshot/templates/secrets.yml @@ -8,44 +8,44 @@ stringData: ADMIN_PASSWORD: {{ .Values.ADMIN_PASSWORD }} ADMIN_EMAIL: {{ .Values.ADMIN_EMAIL }} GITHUB_TOKEN: {{ .Values.GITHUB_TOKEN }} - UPLOADS_ZIP_URL: '{{ .Values.UPLOADS_ZIP_URL }}' + UPLOADS_ZIP_URL: {{ .Values.UPLOADS_ZIP_URL | squote }} .env: | - AUTH_KEY='{{ .Values.AUTH_KEY }}' - AUTH_SALT='{{ .Values.AUTH_SALT }}' - CLOUD_SCREENSHOT_PATH='{{ .Values.INSTALL_PATH }}' - CLOUD_SCREENSHOT_REPO_URL='{{ .Values.CLOUD_SCREENSHOT_REPO_URL }}' - DB_HOST_0='{{ .Values.DB_HOST_0 }}' - DB_HOST_1='{{ .Values.DB_HOST_1 }}' - DB_HOST_2='{{ .Values.DB_HOST_2 }}' - DB_NAME='{{ .Values.DB_NAME }}' - DB_PASSWORD='{{ .Values.DB_PASSWORD }}' - DB_PREFIX='{{ .Values.DB_PREFIX }}' - DB_USER='{{ .Values.DB_USER }}' - IMAGE_VERSION='{{ .Values.CLOUD_SCREENSHOT_VERSION }}' - LOGGED_IN_KEY='{{ .Values.LOGGED_IN_KEY }}' - LOGGED_IN_SALT='{{ .Values.LOGGED_IN_SALT }}' - NONCE_KEY='{{ .Values.NONCE_KEY }}' - NONCE_SALT='{{ .Values.NONCE_SALT }}' - S3_BUCKET_CLOUD_ITEMS='{{ .Values.S3_BUCKET_CLOUD_ITEMS }}' - S3_BUCKET_CLOUD_ITEMS_BACKUP_1='{{ .Values.S3_BUCKET_CLOUD_ITEMS_BACKUP_1 }}' - S3_BUCKET_CLOUD_ITEMS_BACKUP_2='{{ .Values.S3_BUCKET_CLOUD_ITEMS_BACKUP_2 }}' - S3_ENDPOINT_CLOUD_ITEMS='{{ .Values.S3_ENDPOINT_CLOUD_ITEMS }}' - S3_ENDPOINT_CLOUD_ITEMS_BACKUP_1='{{ .Values.S3_ENDPOINT_CLOUD_ITEMS_BACKUP_1 }}' - S3_ENDPOINT_CLOUD_ITEMS_BACKUP_2='{{ .Values.S3_ENDPOINT_CLOUD_ITEMS_BACKUP_2 }}' - S3_KEY_CLOUD_ITEMS='{{ .Values.S3_KEY_CLOUD_ITEMS }}' - S3_KEY_CLOUD_ITEMS_BACKUP_1='{{ .Values.S3_KEY_CLOUD_ITEMS_BACKUP_1 }}' - S3_KEY_CLOUD_ITEMS_BACKUP_2='{{ .Values.S3_KEY_CLOUD_ITEMS_BACKUP_2 }}' - S3_REGION_CLOUD_ITEMS='{{ .Values.S3_REGION_CLOUD_ITEMS }}' - S3_REGION_CLOUD_ITEMS_BACKUP_1='{{ .Values.S3_REGION_CLOUD_ITEMS_BACKUP_1 }}' - S3_REGION_CLOUD_ITEMS_BACKUP_2='{{ .Values.S3_REGION_CLOUD_ITEMS_BACKUP_2 }}' - S3_SECRET_CLOUD_ITEMS='{{ .Values.S3_SECRET_CLOUD_ITEMS }}' - S3_SECRET_CLOUD_ITEMS_BACKUP_1='{{ .Values.S3_SECRET_CLOUD_ITEMS_BACKUP_1 }}' - S3_SECRET_CLOUD_ITEMS_BACKUP_2='{{ .Values.S3_SECRET_CLOUD_ITEMS_BACKUP_2 }}' - SECURE_AUTH_KEY='{{ .Values.SECURE_AUTH_KEY }}' - SECURE_AUTH_SALT='{{ .Values.SECURE_AUTH_SALT }}' - VIRTUAL_HOST='{{ .Values.VIRTUAL_HOST }}' + AUTH_KEY={{ .Values.AUTH_KEY | squote }} + AUTH_SALT={{ .Values.AUTH_SALT | squote }} + CLOUD_SCREENSHOT_PATH={{ .Values.INSTALL_PATH | squote }} + CLOUD_SCREENSHOT_REPO_URL={{ .Values.CLOUD_SCREENSHOT_REPO_URL | squote }} + DB_HOST_0={{ .Values.DB_HOST_0 | squote }} + DB_HOST_1={{ .Values.DB_HOST_1 | squote }} + DB_HOST_2={{ .Values.DB_HOST_2 | squote }} + DB_NAME={{ .Values.DB_NAME | squote }} + DB_PASSWORD={{ .Values.DB_PASSWORD | squote }} + DB_PREFIX={{ .Values.DB_PREFIX | squote }} + DB_USER={{ .Values.DB_USER | squote }} + IMAGE_VERSION={{ .Values.CLOUD_SCREENSHOT_VERSION | squote }} + LOGGED_IN_KEY={{ .Values.LOGGED_IN_KEY | squote }} + LOGGED_IN_SALT={{ .Values.LOGGED_IN_SALT | squote }} + NONCE_KEY={{ .Values.NONCE_KEY | squote }} + NONCE_SALT={{ .Values.NONCE_SALT | squote }} + S3_BUCKET_CLOUD_ITEMS={{ .Values.S3_BUCKET_CLOUD_ITEMS | squote }} + S3_BUCKET_CLOUD_ITEMS_BACKUP_1={{ .Values.S3_BUCKET_CLOUD_ITEMS_BACKUP_1 | squote }} + S3_BUCKET_CLOUD_ITEMS_BACKUP_2={{ .Values.S3_BUCKET_CLOUD_ITEMS_BACKUP_2 | squote }} + S3_ENDPOINT_CLOUD_ITEMS={{ .Values.S3_ENDPOINT_CLOUD_ITEMS | squote }} + S3_ENDPOINT_CLOUD_ITEMS_BACKUP_1={{ .Values.S3_ENDPOINT_CLOUD_ITEMS_BACKUP_1 | squote }} + S3_ENDPOINT_CLOUD_ITEMS_BACKUP_2={{ .Values.S3_ENDPOINT_CLOUD_ITEMS_BACKUP_2 | squote }} + S3_KEY_CLOUD_ITEMS={{ .Values.S3_KEY_CLOUD_ITEMS | squote }} + S3_KEY_CLOUD_ITEMS_BACKUP_1={{ .Values.S3_KEY_CLOUD_ITEMS_BACKUP_1 | squote }} + S3_KEY_CLOUD_ITEMS_BACKUP_2={{ .Values.S3_KEY_CLOUD_ITEMS_BACKUP_2 | squote }} + S3_REGION_CLOUD_ITEMS={{ .Values.S3_REGION_CLOUD_ITEMS | squote }} + S3_REGION_CLOUD_ITEMS_BACKUP_1={{ .Values.S3_REGION_CLOUD_ITEMS_BACKUP_1 | squote }} + S3_REGION_CLOUD_ITEMS_BACKUP_2={{ .Values.S3_REGION_CLOUD_ITEMS_BACKUP_2 | squote }} + S3_SECRET_CLOUD_ITEMS={{ .Values.S3_SECRET_CLOUD_ITEMS | squote }} + S3_SECRET_CLOUD_ITEMS_BACKUP_1={{ .Values.S3_SECRET_CLOUD_ITEMS_BACKUP_1 | squote }} + S3_SECRET_CLOUD_ITEMS_BACKUP_2={{ .Values.S3_SECRET_CLOUD_ITEMS_BACKUP_2 | squote }} + SECURE_AUTH_KEY={{ .Values.SECURE_AUTH_KEY | squote }} + SECURE_AUTH_SALT={{ .Values.SECURE_AUTH_SALT | squote }} + VIRTUAL_HOST={{ .Values.VIRTUAL_HOST | squote }} WP_DEBUG_LOG=true - WP_ENV='{{ .Values.WP_ENV }}' - WP_HOME='{{ .Values.WP_HOME }}' - WP_SITEURL='{{ .Values.WP_SITEURL }}' + WP_ENV={{ .Values.WP_ENV | squote }} + WP_HOME={{ .Values.WP_HOME | squote }} + WP_SITEURL={{ .Values.WP_SITEURL | squote }}