k8 local deploy – helm – deployment and design clarifications
-
Goal: Deploy wordpress website / framework as a tool and project to learn how to develop an application that is stateful, and follows Agile workflows.
Source for deployment: Helm wordpress 19.2.0 · bitnami/bitnami (artifacthub.io)
Trying to follow KISS and best practices. This deployment path seemed very well maintained and mature, but I am lacking some key components of the design that are not allowing me to successfully deploy.
One key criteria is to deploy where I can “build a website” within “dev” (deployment / namespace ), where I learn how updates to “dev” are synced on merge to “prod” (main branch within SCM).
Issues:
- To deploy WP with Helm, pattern calls out storage class and some variables for claims, but I get errors when I try to setup SC and PVC.
# Deploy command snip: helm upgrade --install ${APP_NAME} bitnami/wordpress --version 19.0.6 --set "wordpressPassword=${wordpressPassword},global.storageClass=${storageClass},mariadb.auth.password=${mariadb_password},mariadb.auth.rootPassword=${mariadb_rootPassword},ingress.annotations=${cilium_annotations},ingress.annotations=${service_annotations},networkPolicy.ingress.namespaceSelector=${NAMESPACE},meta.helm.sh/release-namespace=${NAMESPACE},containerSecurityContext.runAsUser=${container_runas_user},podSecurityContext.fsGroup=${container_runas_user}" --create-namespace --namespace $NAMESPACE # kubernetes deploy result ~$ kubectl get pods -A NAMESPACE wordpress-7dcf6b6ff6-v594s 0/1 CrashLoopBackOff 217 (3m23s ago) 21h NAMESPACE wordpress-mariadb-0 0/1 CrashLoopBackOff 261 (98s ago) 21h ~$ kubectl logs wordpress-mariadb-0 -n NAMESPACE mariadb 16:29:28.65 INFO ==> mariadb 16:29:28.65 INFO ==> Welcome to the Bitnami mariadb container mariadb 16:29:28.65 INFO ==> Subscribe to project updates by watching https://github.com/bitnami/containers mariadb 16:29:28.65 INFO ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues mariadb 16:29:28.65 INFO ==> mariadb 16:29:28.66 INFO ==> ** Starting MariaDB setup ** mariadb 16:29:28.68 INFO ==> Validating settings in MYSQL_*/MARIADB_* env vars mariadb 16:29:28.68 INFO ==> Initializing mariadb database mkdir: cannot create directory '/bitnami/mariadb': Stale file handle $ kubectl get pvc -n NAMESPACE NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE wordpress Bound pvc-e06d1875-7b89-47f1-a683-2d5d9f721553 10Gi RWO nfs-md0-container-sc 23h data-wordpress-mariadb-0 Bound pvc-4246bca0-65db-44ec-8dba-5357e6c4b76c 8Gi RWO nfs-md0-container-sc 23h
So it is deploying pods. And I am passing it variables that it set for passwords, namespace, and even define storage up front so I can later backup, re-attach etc..
--- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: data-wordpress-mariadb-0 namespace: NAMESPACE labels: app.kubernetes.io/component: primary # pulled from baseline deploy bitnami/wp deploy app.kubernetes.io/instance: wordpress # pulled from baseline deploy bitnami/wp deploy app.kubernetes.io/name: mariadb # pulled from baseline deploy bitnami/wp deploy spec: accessModes: - ReadWriteOnce storageClassName: nfs-md0-container-sc resources: requests: storage: 10Gi --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: wp-pv-dev namespace: NAMESPACE spec: accessModes: - ReadWriteOnce storageClassName: nfs-md0-container-sc resources: requests: storage: 10Gi
I pulled labels and pvc names from deployment and input into PVC and Storage class deploy. But I think wp helm expects some other permissions or tagging so it can finish attaching with permissions.
Reason I am trying to pre-allocate the pv, is so I can 1) call it on re-deploy, and as such not loose website content and work 2) backup and also later on attach backup volume for more production like workflow 3) Learn how to do content merging where promotion to prod will necessitate data and content from dev to be applied to live prod
Ask:
- Does anyone have ideas / debug notes on how to get PVC and SC setup where wp helm deploy will consume defined volume
- Does anyone have ideas on how to build a content merge workflow for WP that would play from dev to prod upon merge within the CI process.
Thanks
The page I need help with: [log in to see the link]
- You must be logged in to reply to this topic.