diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 31d7393..14105f4 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -159,12 +159,6 @@ spec: /tmp/wp-cli.phar --path=/var/www/html core update-db 2>/dev/null || echo "No database update needed" fi fi - {{- if .Values.wordpress.adsTxt.enabled }} - - echo "Deploying ads.txt..." - printf '%s\n' '{{ .Values.wordpress.adsTxt.content }}' > /var/www/html/ads.txt - echo "ads.txt deployed" - {{- end }} echo "=== WordPress Initialization Completed ===" volumeMounts: @@ -262,6 +256,11 @@ spec: - name: nginx-config mountPath: /etc/nginx/conf.d/default.conf subPath: default.conf + {{- if .Values.wordpress.adsTxt.enabled }} + - name: adstxt-config + mountPath: /var/www/html/ads.txt + subPath: ads.txt + {{- end }} {{- if .Values.healthCheck.enabled }} livenessProbe: {{- toYaml .Values.healthCheck.livenessProbe | nindent 12 }} @@ -311,6 +310,11 @@ spec: - name: nginx-config configMap: name: {{ include "wordpress-nginx.fullname" . }}-nginx-config + {{- if .Values.wordpress.adsTxt.enabled }} + - name: adstxt-config + configMap: + name: {{ include "wordpress-nginx.fullname" . }}-adstxt + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }}