During the deployment process, how do you get your existing app data into an application created by a public Helm Chart for a LAMP stacks?

12/9/2021

Take bitnami/wordpress or bitnami/drupal for example. There are millions of articles on how to run two lines of code (helm get repo / helm install my-release chart) and have a fully working new version of an app in 30 seconds. But I cannot find ANY information about how to get my existing data into that deployment.

In my development workflow, I use two docker images. One is for the app files and the other is for the database. Locally, it's easy enough to get my data into these images. Using MariaDB's docker instructions, I mount a local directory containing my db.sql file into /docker-entrypoint-initdb.d. The same goes for my files - pull them down into a local directory that's then mounted into the container's /var/www folder. Voila! Instant running app with all existing data.

So how do I do this with a public Helm chart?

Scenario: I get local copies of my db.sql and web files. I make my changes. I want to use bitnami/drupal to install this into a cluster (so a colleague can see it, UAT, etc). So how do I do that? If this is a values.yaml issue, how do I configure that file to point to the database file I want to initialize with? Or, how do I use Helm install with --set to do it?

If getting a new app up and running is as easy as helm install my-release bitnami/drupal

then shouldn't it be just as easy to run something like

helm install --set mariadb.docker-entrypoint-initdb.d.file=db.sql --set volume.www.initial.data=/local/web/files new-feature-ticket bitnami/drupal

I know that's pseudo code, but that's exactly the type of answer I'm looking for. I want to be able to deploy this as quickly as I do a new app, but initialized with my existing data, and the bare minimum config need to do so whether that's via values.yaml or --set.

-- user658182
azure-aks
bitnami
docker
kubernetes
kubernetes-helm

0 Answers