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