From ef886769ad81eca19161408f1c9e5d4f624106d7 Mon Sep 17 00:00:00 2001 From: Dustin Falgout Date: Wed, 19 Jun 2024 13:36:57 -0500 Subject: [PATCH 1/8] feat: update divi-hub chart --- charts/hub-server/Chart.yaml | 2 +- charts/hub-server/templates/hub-server.yml | 1 + charts/hub-server/values.yaml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/charts/hub-server/Chart.yaml b/charts/hub-server/Chart.yaml index 4534898..af9b89e 100644 --- a/charts/hub-server/Chart.yaml +++ b/charts/hub-server/Chart.yaml @@ -5,4 +5,4 @@ maintainers: - email: dustin@elegantthemes.com name: Elegant Themes name: hub-server -version: 1.1.1 +version: 1.1.2 diff --git a/charts/hub-server/templates/hub-server.yml b/charts/hub-server/templates/hub-server.yml index f520cd0..639efc2 100644 --- a/charts/hub-server/templates/hub-server.yml +++ b/charts/hub-server/templates/hub-server.yml @@ -69,6 +69,7 @@ spec: topologyKey: kubernetes.io/hostname containers: - name: {{ .Release.Name }} + image: {{ .Values.HUB_SERVER_IMAGE | squote }} env: - name: NODE_NAME valueFrom: diff --git a/charts/hub-server/values.yaml b/charts/hub-server/values.yaml index d0718b4..2dbffdd 100644 --- a/charts/hub-server/values.yaml +++ b/charts/hub-server/values.yaml @@ -4,6 +4,7 @@ DIVI_HUB_PRIVATE_KEY_64: DIVI_HUB_WEBSITES_QUEUE_SIZE: GITHUB_TOKEN: HUB_SERVER_ENV: +HUB_SERVER_IMAGE: HUB_SERVER_REPO_URL: HUB_SERVER_VERSION: INSTALL_PATH: From e1d3f623f086d37b83abc65090cbb45e3f8f344d Mon Sep 17 00:00:00 2001 From: Dustin Falgout Date: Wed, 19 Jun 2024 16:31:24 -0500 Subject: [PATCH 2/8] feat: update divi-hub chart --- charts/hub-server/Chart.yaml | 2 +- charts/hub-server/templates/hub-server.yml | 2 +- charts/hub-server/templates/secrets.yml | 2 ++ charts/hub-server/values.yaml | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/charts/hub-server/Chart.yaml b/charts/hub-server/Chart.yaml index af9b89e..62f861b 100644 --- a/charts/hub-server/Chart.yaml +++ b/charts/hub-server/Chart.yaml @@ -5,4 +5,4 @@ maintainers: - email: dustin@elegantthemes.com name: Elegant Themes name: hub-server -version: 1.1.2 +version: 1.1.3 diff --git a/charts/hub-server/templates/hub-server.yml b/charts/hub-server/templates/hub-server.yml index 639efc2..3543308 100644 --- a/charts/hub-server/templates/hub-server.yml +++ b/charts/hub-server/templates/hub-server.yml @@ -86,7 +86,7 @@ spec: - name: PHP_OPCACHE_VALIDATE_TIMESTAMPS value: "1" - image: {{ .Values.ET_IMAGE | squote }} + image: {{ .Values.HUB_SERVER_IMAGE | squote }} livenessProbe: exec: command: diff --git a/charts/hub-server/templates/secrets.yml b/charts/hub-server/templates/secrets.yml index 4e26dc6..6060065 100644 --- a/charts/hub-server/templates/secrets.yml +++ b/charts/hub-server/templates/secrets.yml @@ -16,5 +16,7 @@ stringData: HUB_SERVER_REPO_URL={{ .Values.HUB_SERVER_REPO_URL | squote }} IMAGE_VERSION={{ .Values.HUB_SERVER_VERSION | squote }} REDIS_HOST={{ .Values.REDIS_HOSTNAME | squote }} + REDIS_SENTINEL_HOST={{ .Values.REDIS_HOSTNAME | squote }} + REDIS_SENTINEL_SERVICE={{ .Values.REDIS_SENTINEL_SERVICE | squote }} VIRTUAL_HOST={{ .Values.VIRTUAL_HOST | squote }} diff --git a/charts/hub-server/values.yaml b/charts/hub-server/values.yaml index 2dbffdd..1dcc231 100644 --- a/charts/hub-server/values.yaml +++ b/charts/hub-server/values.yaml @@ -10,4 +10,5 @@ HUB_SERVER_VERSION: INSTALL_PATH: PUBLIC_KEY: REDIS_HOSTNAME: +REDIS_SENTINEL_SERVICE: VIRTUAL_HOST: From 07f75699e636c401408f0714794ff33e0c37504d Mon Sep 17 00:00:00 2001 From: Dustin Falgout Date: Wed, 19 Jun 2024 17:07:00 -0500 Subject: [PATCH 3/8] feat: update divi-hub chart --- charts/hub-server/Chart.yaml | 2 +- charts/hub-server/templates/_helpers.tpl | 36 ++++++++++++++ charts/hub-server/templates/hub-server.yml | 56 +++++++++++++++++++--- charts/hub-server/values.yaml | 4 +- 4 files changed, 89 insertions(+), 9 deletions(-) create mode 100644 charts/hub-server/templates/_helpers.tpl diff --git a/charts/hub-server/Chart.yaml b/charts/hub-server/Chart.yaml index 62f861b..7391841 100644 --- a/charts/hub-server/Chart.yaml +++ b/charts/hub-server/Chart.yaml @@ -5,4 +5,4 @@ maintainers: - email: dustin@elegantthemes.com name: Elegant Themes name: hub-server -version: 1.1.3 +version: 1.1.4 diff --git a/charts/hub-server/templates/_helpers.tpl b/charts/hub-server/templates/_helpers.tpl new file mode 100644 index 0000000..9c8a8a1 --- /dev/null +++ b/charts/hub-server/templates/_helpers.tpl @@ -0,0 +1,36 @@ +{{ define "hub.container.worker" }} + - name: worker-{{ .index }} + env: + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: HUB_SERVER_PATH + value: {{ .Values.HUB_SERVER_PATH | squote }} + - name: VIRTUAL_HOST + value: {{ .Values.VIRTUAL_HOST | squote }} + - name: HUB_SERVER_REPO_URL + value: {{ .Values.HUB_SERVER_REPO_URL | squote }} + - name: IMAGE_VERSION + value: {{ .Values.HUB_SERVER_VERSION | squote }} + - name: HUB_SERVER_WORKER + value: '1' + - name: PHP_OPCACHE_FILE_CACHE + value: {{ ternary "/var/cache/php" "" (eq "production" .Values.HUB_SERVER_ENV) | squote }} + - name: PHP_OPCACHE_VALIDATE_TIMESTAMPS + value: {{ ternary "false" "true" (eq "production" .Values.HUB_SERVER_ENV) | squote }} + image: {{ .Values.HUB_SERVER_IMAGE | squote }} + resources: + requests: + cpu: 100m + memory: 100Mi + limits: + cpu: '4' + memory: 4G + volumeMounts: + - name: wordpress + mountPath: /srv + - name: config + mountPath: /config + readOnly: true +{{ end }} diff --git a/charts/hub-server/templates/hub-server.yml b/charts/hub-server/templates/hub-server.yml index 3543308..a390901 100644 --- a/charts/hub-server/templates/hub-server.yml +++ b/charts/hub-server/templates/hub-server.yml @@ -67,16 +67,53 @@ spec: namespaces: - dc-screenshot topologyKey: kubernetes.io/hostname + initContainers: + - name: init + env: + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: HUB_SERVER_PATH + value: {{ .Values.HUB_SERVER_PATH | squote }} + - name: VIRTUAL_HOST + value: {{ .Values.VIRTUAL_HOST | squote }} + - name: HUB_SERVER_REPO_URL + value: {{ .Values.HUB_SERVER_REPO_URL | squote }} + - name: IMAGE_VERSION + value: {{ .Values.HUB_SERVER_VERSION | squote }} + - name: HUB_SERVER_INIT + value: '1' + - 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.HUB_SERVER_IMAGE | squote }} + command: [ '/etc/cont-init.d/init' ] + resources: + requests: + cpu: 100m + memory: 100Mi + limits: + cpu: '4' + memory: 2G + volumeMounts: + - name: wordpress + mountPath: /srv + - name: config + mountPath: /config + readOnly: true + containers: - - name: {{ .Release.Name }} + - name: app image: {{ .Values.HUB_SERVER_IMAGE | squote }} env: - name: NODE_NAME valueFrom: fieldRef: fieldPath: spec.nodeName - - name: INSTALL_PATH - value: {{ .Values.INSTALL_PATH | squote }} + - name: HUB_SERVER_PATH + value: {{ .Values.HUB_SERVER_PATH | squote }} - name: VIRTUAL_HOST value: {{ .Values.VIRTUAL_HOST | squote }} - name: PHP_MEMORY_LIMIT @@ -93,7 +130,7 @@ spec: - 'bash' - '-c' - 'SCRIPT_NAME=/healthz' - - 'SCRIPT_FILENAME={{ .Values.INSTALL_PATH }}/public/healthz.php' + - 'SCRIPT_FILENAME={{ .Values.HUB_SERVER_PATH }}/public/healthz.php' - 'REQUEST_METHOD=GET' - 'cgi-fcgi' - '-bind' @@ -109,7 +146,7 @@ spec: - 'bash' - '-c' - 'SCRIPT_NAME=/healthz' - - 'SCRIPT_FILENAME={{ .Values.INSTALL_PATH }}/public/healthz.php' + - 'SCRIPT_FILENAME={{ .Values.HUB_SERVER_PATH }}/public/healthz.php' - 'REQUEST_METHOD=GET' - 'cgi-fcgi' - '-bind' @@ -122,17 +159,22 @@ spec: memory: 100Mi limits: cpu: 5000m - memory: 3G + memory: 2G startupProbe: exec: command: - cat - - {{ .Values.INSTALL_PATH }}/public/healthz.php + - {{ .Values.HUB_SERVER_PATH }}/public/healthz.php failureThreshold: 30 periodSeconds: 10 volumeMounts: - name: wordpress mountPath: /srv + +{{ range $_, $index := untilStep 1 (int .Values.HUB_SERVER_WORKERS) 1 }} +{{ include "hub.container.worker" (dict "Values" $.Values "index" $index) }} +{{ end }} + tolerations: - key: node.kubernetes.io/disk-pressure operator: Exists diff --git a/charts/hub-server/values.yaml b/charts/hub-server/values.yaml index 1dcc231..796bec7 100644 --- a/charts/hub-server/values.yaml +++ b/charts/hub-server/values.yaml @@ -7,7 +7,9 @@ HUB_SERVER_ENV: HUB_SERVER_IMAGE: HUB_SERVER_REPO_URL: HUB_SERVER_VERSION: -INSTALL_PATH: +HUB_SERVER_WORKERS: +HUB_SERVER_PATH: +PHP_MEMORY_LIMIT: PUBLIC_KEY: REDIS_HOSTNAME: REDIS_SENTINEL_SERVICE: From aab59cb55b38e41e8828c9fb68d35eabd6a20640 Mon Sep 17 00:00:00 2001 From: Dustin Falgout Date: Thu, 20 Jun 2024 10:54:42 -0500 Subject: [PATCH 4/8] feat: update divi-hub chart --- charts/hub-server/Chart.yaml | 2 +- charts/hub-server/templates/hub-server.yml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/charts/hub-server/Chart.yaml b/charts/hub-server/Chart.yaml index 7391841..9bc7085 100644 --- a/charts/hub-server/Chart.yaml +++ b/charts/hub-server/Chart.yaml @@ -5,4 +5,4 @@ maintainers: - email: dustin@elegantthemes.com name: Elegant Themes name: hub-server -version: 1.1.4 +version: 1.1.5 diff --git a/charts/hub-server/templates/hub-server.yml b/charts/hub-server/templates/hub-server.yml index a390901..4c36fc8 100644 --- a/charts/hub-server/templates/hub-server.yml +++ b/charts/hub-server/templates/hub-server.yml @@ -187,3 +187,6 @@ spec: hostPath: path: /srv type: DirectoryOrCreate + - name: config + secret: + secretName: secrets From 50596fdd3fde131edadd6cc3ecf8bcfa695589f7 Mon Sep 17 00:00:00 2001 From: Dustin Falgout Date: Thu, 20 Jun 2024 11:12:39 -0500 Subject: [PATCH 5/8] feat: update divi-hub chart --- charts/hub-server/Chart.yaml | 2 +- charts/hub-server/templates/secrets.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/hub-server/Chart.yaml b/charts/hub-server/Chart.yaml index 9bc7085..b24351c 100644 --- a/charts/hub-server/Chart.yaml +++ b/charts/hub-server/Chart.yaml @@ -5,4 +5,4 @@ maintainers: - email: dustin@elegantthemes.com name: Elegant Themes name: hub-server -version: 1.1.5 +version: 1.1.6 diff --git a/charts/hub-server/templates/secrets.yml b/charts/hub-server/templates/secrets.yml index 6060065..a1365b5 100644 --- a/charts/hub-server/templates/secrets.yml +++ b/charts/hub-server/templates/secrets.yml @@ -12,7 +12,7 @@ stringData: DIVI_HUB_WEBSITES_QUEUE_SIZE={{ .Values.DIVI_HUB_WEBSITES_QUEUE_SIZE | squote }} DIVI_HUB_IP_ADDRESS={{ .Values.DIVI_HUB_IP_ADDRESS | squote }} DIVI_HUB_PRIVATE_KEY_64={{ .Values.DIVI_HUB_PRIVATE_KEY_64 | b64enc | squote }} - HUB_SERVER_PATH={{ .Values.INSTALL_PATH | squote }} + HUB_SERVER_PATH={{ .Values.HUB_SERVER_PATH | squote }} HUB_SERVER_REPO_URL={{ .Values.HUB_SERVER_REPO_URL | squote }} IMAGE_VERSION={{ .Values.HUB_SERVER_VERSION | squote }} REDIS_HOST={{ .Values.REDIS_HOSTNAME | squote }} From 6d927bfb231faeae8f7e20920e8662d1cbb3b8c1 Mon Sep 17 00:00:00 2001 From: Dustin Falgout Date: Thu, 20 Jun 2024 13:12:05 -0500 Subject: [PATCH 6/8] feat: update divi-hub chart --- charts/hub-server/Chart.yaml | 2 +- charts/hub-server/templates/hub-server.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/hub-server/Chart.yaml b/charts/hub-server/Chart.yaml index b24351c..2435499 100644 --- a/charts/hub-server/Chart.yaml +++ b/charts/hub-server/Chart.yaml @@ -5,4 +5,4 @@ maintainers: - email: dustin@elegantthemes.com name: Elegant Themes name: hub-server -version: 1.1.6 +version: 1.1.7 diff --git a/charts/hub-server/templates/hub-server.yml b/charts/hub-server/templates/hub-server.yml index 4c36fc8..82126f1 100644 --- a/charts/hub-server/templates/hub-server.yml +++ b/charts/hub-server/templates/hub-server.yml @@ -21,7 +21,7 @@ metadata: labels: app: {{ .Release.Name }} spec: - replicas: {{ .Values.REPLICAS }} + replicas: 3 strategy: rollingUpdate: maxSurge: 0 From 2b016151bdcbe8bcb1b28ec078e5548f029b6b93 Mon Sep 17 00:00:00 2001 From: Dustin Falgout Date: Fri, 21 Jun 2024 11:38:45 -0500 Subject: [PATCH 7/8] feat: update divi-hub chart --- charts/hub-server/Chart.yaml | 2 +- charts/hub-server/templates/hub-server.yml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/charts/hub-server/Chart.yaml b/charts/hub-server/Chart.yaml index 2435499..60efed7 100644 --- a/charts/hub-server/Chart.yaml +++ b/charts/hub-server/Chart.yaml @@ -5,4 +5,4 @@ maintainers: - email: dustin@elegantthemes.com name: Elegant Themes name: hub-server -version: 1.1.7 +version: 1.1.8 diff --git a/charts/hub-server/templates/hub-server.yml b/charts/hub-server/templates/hub-server.yml index 82126f1..71b689a 100644 --- a/charts/hub-server/templates/hub-server.yml +++ b/charts/hub-server/templates/hub-server.yml @@ -170,6 +170,9 @@ spec: volumeMounts: - name: wordpress mountPath: /srv + - name: config + mountPath: /config + readOnly: true {{ range $_, $index := untilStep 1 (int .Values.HUB_SERVER_WORKERS) 1 }} {{ include "hub.container.worker" (dict "Values" $.Values "index" $index) }} From 7e755ab00a2a139f6ebc714130d128ce8f42650b Mon Sep 17 00:00:00 2001 From: Dustin Falgout Date: Fri, 21 Jun 2024 12:10:40 -0500 Subject: [PATCH 8/8] feat: update divi-hub chart --- charts/hub-server/Chart.yaml | 2 +- charts/hub-server/templates/secrets.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/hub-server/Chart.yaml b/charts/hub-server/Chart.yaml index 60efed7..9dc09a4 100644 --- a/charts/hub-server/Chart.yaml +++ b/charts/hub-server/Chart.yaml @@ -5,4 +5,4 @@ maintainers: - email: dustin@elegantthemes.com name: Elegant Themes name: hub-server -version: 1.1.8 +version: 1.1.9 diff --git a/charts/hub-server/templates/secrets.yml b/charts/hub-server/templates/secrets.yml index a1365b5..cd3685f 100644 --- a/charts/hub-server/templates/secrets.yml +++ b/charts/hub-server/templates/secrets.yml @@ -7,7 +7,7 @@ stringData: GITHUB_TOKEN: {{ .Values.GITHUB_TOKEN | squote }} .env: | APP_ENV={{ .Values.HUB_SERVER_ENV | squote }} - APP_URL={{ .Values.VIRTUAL_HOST | squote }} + APP_URL='https://{{ .Values.VIRTUAL_HOST }}' DIVI_HUB_ENDPOINT={{ .Values.DIVI_HUB_ENDPOINT | squote }} DIVI_HUB_WEBSITES_QUEUE_SIZE={{ .Values.DIVI_HUB_WEBSITES_QUEUE_SIZE | squote }} DIVI_HUB_IP_ADDRESS={{ .Values.DIVI_HUB_IP_ADDRESS | squote }}