From 3981223ebb3b393e057efe78f3f2fb7f718d18ca Mon Sep 17 00:00:00 2001 From: pieter Date: Fri, 21 Nov 2025 01:46:16 +0000 Subject: [PATCH] =?UTF-8?q?templates/post-install-job.yaml=20=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/post-install-job.yaml | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 templates/post-install-job.yaml diff --git a/templates/post-install-job.yaml b/templates/post-install-job.yaml new file mode 100644 index 0000000..2e23b9b --- /dev/null +++ b/templates/post-install-job.yaml @@ -0,0 +1,39 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ include "wordpress-nginx.fullname" . }}-show-password + labels: + {{- include "wordpress-nginx.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": post-install + "helm.sh/hook-weight": "1" + "helm.sh/hook-delete-policy": before-hook-creation +spec: + template: + metadata: + name: {{ include "wordpress-nginx.fullname" . }}-show-password + spec: + restartPolicy: Never + containers: + - name: show-password + image: busybox:latest + command: + - /bin/sh + - -c + - | + echo "================================================" + echo "WordPress Installation Information" + echo "================================================" + echo "" + echo "Admin User: {{ .Values.wordpress.adminUser }}" + {{- if .Values.wordpress.adminPassword }} + echo "Admin Password: {{ .Values.wordpress.adminPassword }}" + {{- else }} + echo "Admin Password: (Auto-generated - check Secret or Pod logs)" + echo "" + echo "To retrieve the auto-generated password, run:" + echo "kubectl get secret {{ include "wordpress-nginx.fullname" . }}-secret -o jsonpath='{.data.admin-password}' | base64 -d" + {{- end }} + echo "" + echo "Site URL: {{ .Values.wordpress.siteUrl }}" + echo "================================================" \ No newline at end of file