{"id":24328520,"url":"https://github.com/vhscom/chicagoganghistory-helm","last_synced_at":"2026-04-11T09:05:32.874Z","repository":{"id":201746071,"uuid":"467794033","full_name":"vhscom/chicagoganghistory-helm","owner":"vhscom","description":"⛵️ Helm chart that uses Ansible to set up a hardened WordPress with customizations for Chicago Gang History. Mirror of Chicago Gang History Helm on Codeberg. ","archived":false,"fork":false,"pushed_at":"2022-03-09T10:22:57.000Z","size":1505,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"trunk","last_synced_at":"2025-03-11T09:17:43.558Z","etag":null,"topics":["ansible","docker","helm","helm-chart","kubernetes","mariadb","redis","wordpress"],"latest_commit_sha":null,"homepage":"https://codeberg.org/vhs/chicagoganghistory-helm","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vhscom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-03-09T05:46:44.000Z","updated_at":"2022-03-13T08:02:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"9f963097-2038-4ce2-9a6c-dd12fda0d968","html_url":"https://github.com/vhscom/chicagoganghistory-helm","commit_stats":null,"previous_names":["vhscom/chicagoganghistory-helm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vhscom/chicagoganghistory-helm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vhscom%2Fchicagoganghistory-helm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vhscom%2Fchicagoganghistory-helm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vhscom%2Fchicagoganghistory-helm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vhscom%2Fchicagoganghistory-helm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vhscom","download_url":"https://codeload.github.com/vhscom/chicagoganghistory-helm/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vhscom%2Fchicagoganghistory-helm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31674624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T08:18:19.405Z","status":"ssl_error","status_checked_at":"2026-04-11T08:17:08.892Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","docker","helm","helm-chart","kubernetes","mariadb","redis","wordpress"],"created_at":"2025-01-17T23:29:33.618Z","updated_at":"2026-04-11T09:05:32.858Z","avatar_url":"https://github.com/vhscom.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chicago Gang History Helm Chart\n\nThis is a customized Helm chart to accompany the blog post [Moving from Pantheon.io to Kubernetes](https://vhs.codeberg.page/post/move-pantheon-wordpress-site-kubernetes) for using Ansible to set up a hardened WordPress using Kubernetes and Redis. It is based on the sensational [StackSpin wordpress-helm chart](https://open.greenhost.net/stackspin/wordpress-helm) and was used to save over $400/month in hosting fees.\n\n![website screenshot](chicagoganghistory-k3s-valkyrie-fs8.png)\n## Setup\n\n### Prerequisites\n\n1. Make sure you have `kubernetes-cli` and `helm` (version \u003e= 3) installed on\n   your development machine\n2. Make sure you have a running kubernetes cluster that your kubectl is\n   connected to. Check this by running `kubectl version`. It should tell you the\n   client and server version of Kubernetes.\n4. The redis and MariaDB helm charts live in a custom Bitnami chart repository\n   (the ones in the helm stable repository are deprecated and moved there). Get\n   the repository by running:\n\n   ```\n   $ helm repo add bitnami https://charts.bitnami.com/bitnami\n   ```\n5. The chart assumes you have nginx ingress running in IP range `10.0.0.0/8`. If\n   you do, the access logs will show remote IP addresses from the\n   `X-Forwarded-For` header. Otherwise, the proxy IP address is shown in the\n   access logs.\n\n   If you don't use `nginx` ingress and you enable `mu_cron`, make sure to block\n   the path from `wordpress.mu_cron.cronjob.path` from outside traffic.\n\n### Start WordPress on Kubernetes\n\n#### Configuration\n\nCopy `values-local.yaml.example` to `values-local.yaml`. This file contains a\nlot of variables that you can change to adjust the WordPress installation to\nyour needs.\n\nFor a simple WordPress installation, you only need to edit the following values:\n\n|               Parameter               |                 Description                   |              Default              |\n|---------------------------------------|-----------------------------------------------|-----------------------------------|\n| `ansibleVars.WP_URL`                  | The URL of your WordPress website             | http://localhost                  |\n| `ansibleVars.WP_TITLE`                | The title of the site                         | Demo WP                           |\n| `ansibleVars.WP_THEME_ACTIVE`                | A *slug* for the theme you want to install on your site (can also be changed through interface) | twentytwenty |\n| `ansibleVars.WP_EMAIL`                | The administrator's email adress              | youremailhere@example.com         |\n| `database.auth.username`              | Database user                                 | wordpress                         |\n| `database.auth.password`              | `wordpress` db user password                  | You **really** need to set this   |\n| `database.auth.rootPassword `         | root user password                            | You **really** need to set this   |\n| `database.auth.replicationPassword`   | replication user password                     | You **really** need to set this   |\n\nYou can read the descriptions of the other variables in\n`values-local.yaml.example` and of even more variables in `values.yaml`.\n\n##### Note about the `ansibleVars`:\n\nAll the variables under `ansibleVars` are used by the ansible playbook that is\nrun in the init container to configure the WordPress website. You can find their\ndefault values in the `values.yaml` file. You can override single values of\n`ansibleVars.\u003cany variable\u003e` in your `values-local.yaml` file. __NOTE__: if you\nwould want to override variables in `ansibleSecrets`, you have to copy the whole\n`ansibleSecrets` string to `values-local.yaml`!\n\n#### Installation\n\n1. Install the helm dependencies by typing `helm dep update`\n2. Start WordPress by typing running `install.sh`.\n\n   __NOTE__: if you override the image or initImage tags in values.yaml,\n   installation with this script ignores that.\n\nSee [What happens when I install this?](#what-happens-when-i-install-this) for\ninformation on what happens now.\n\n#### Removal\n\nTo undo an installation and remove all traces of it ever existing, use the\n`delete.sh` script. __NOTE__: use this at your own risk! Your databases, uploads, etc. will be removed for ever!\n\n## Troubleshooting\n\nTo debug the **init** container, you can use `kubectl logs`, but because it is\nnot the default container, you need to use the `-c` argument as follows:\n\n```bash\n$ kubectl logs \u003cpod\u003e -c init-wordpress\n```\n\n## What happens when I install this?\n\n### Installed pods\n\nHelm will set up the kubernetes pods that are needed to run your website:\n\n1. A WordPress pod that serves the site\n  - If you have `backup.enabled` or `wordpress.mu_cron.enabled`, or have a\n    non-empty `customCron`, this pod will also contain a sidecar container that\n    runs cron jobs.\n2. Two MariaDB pods running the database (master-slave setup by default, unless\n   you changed this in `values-local.yaml`)\n3. If you configured Redis, a Redis pod is also set up\n\nThe MariaDB and Redis pods are documented in the official [helm charts\nrepository](https://github.com/helm/charts), this file documents the WordPress\npod that will serve the site.\n\n### Init container\n\nThis chart provides an \"init container\" for the WordPress pod. This container\nsets up the wordpress. Each time a pod is (re)started, the init container:\n\n1. Downloads WordPress to a temporary directory\n2. Configures that fresh WordPress\n3. Downloads and activates the plugins specified in\n   `ansibleVars.wordpress_default_plugins`\n\n### WordPress setup\n\nThe WordPress core is installed into ephemeral storage. Updates to the WordPress\ncore should be handled by the helm chart, rather than done through the WP-admin\ninterface. However, the wp-content directory is mounted on a persistent volume\n(as long as `persistence.enabled` is set to `true`), and a configmap containing\nthe `.htaccess` file for the uploads dir is mounted in\n`wp-content/uploads/.htaccess`. This `.htaccess` file can be edited by editing\nthe `wordpress.wp_upload.htaccess` helm value.\n\n## Importing an existing WordPress site\n\nWe assume you have:\n\n- A running kubernetes cluster\n- `kubectl` installed on your machine and configured to connect to your running\n  cluster.\n- `tar` installed\n- A database dump of your old website's database called `dump.sql`.\n- The contents of the `wp-content` folder (usually at\n  `/var/www/html/wp-content`) in a local directory called `wp-content`.\n\n\nMake sure the copy of the wp-content directory and the database dump are made at\nthe same time.\n\nWe will go through the following steps:\n\n1. Set up a new WordPress site by installing this chart\n2. Import the Database\n3. Import the files from wp-content\n\n### Set up a new WordPress site\n\nFollow the instructions under [Start WordPress on\nKubernetes](#start-wordpress-on-kubernetes)\n\nYou might have to edit the following variables to reflect your current site's:\n\n- Set `DB_PREFIX` to the database prefix that your current WordPress uses\n- Set `WP_VERSION` to the version of your current WordPress site.\n- Check if your current WordPress uses Redis. This is usually the case when you\n  have the `redis-cache` plugin installed. If so, enable redis in your\n  `values-local.yaml` by setting `redis.enabled` to `true`.\n\nAfter installing, check if your site is available at the URL you specified in\n`values-local.yaml`. When it is, type `helm ls` to find the name of your\ndeployment. In the rest of this document we will assume that your WordPress\ndeployment is named `wordpress-master`.\n\n### Import the database\n\nMake sure to remove all explicit URLs to your site from the database. If you\nhost your site on `example.com`, WordPress tends to put links in the database as\n`https://example.com/\u003clink to your post\u003e` or `http://example.com/\u003clink to your\npost\u003e`. If you want to try this new deployment on a different domain, that will\nnot work. To fix this, search for `https://example.com` in your database and\nremove it. Repeat this step for `http://example.com`.\n\nWhen your database file is ready, import it with the following command:\n\n```bash\n$ kubectl exec -i wordpress-master-mariadb-master-0 -- mysql -uwordpress -p\u003cyour password\u003e --database=wordpress_db \u003c dump.sql\n```\n\nA breakup of the command:\n\n- `kubectl exec` means you want to execute a command in a container\n- `-i` makes sure that `stdin` is passed to the container. This means that we\n  can use `\u003c dump.sql` to import the database export from your local system.\n- We assume your database is running in a pod named\n  `wordpress-master-mariadb-master-0`.\n- `--` tells kubectl to stop interpreting command line arguments as kubectl\n  arguments\n- `mysql` executes the `mysql` command in the container, with the following\n  arguments:\n  - `-uwordpress` sets the MySQL user to wordpress\n  - `-p` provides the prassword of the `wordpress` user\n  - `--database=wordpress_db` selects the `wordpress_db` database.\n- `\u003c dump.sql` reads the file `dump.sql` and inserts it into the mysql command.\n  Change this if your MySQL database dump has a different filename.\n\n\n### Import the files from wp-content/uploads\n\nSimilar to how you would normally use `scp` to copy files to a server, you can\nuse `kubectl cp` to copy files to your wordpress pod. Make sure that you copy\nyour wp-content directory contents to the directory you have configured as the\n`wp_content` in the `values-local.yaml`. If you haven't configured it, it\ndefaults to `/var/www/wp-content-mount`. Also make sure wp-content/uploads\ndoes not contain a `.htaccess` file because that is provided by this chart.\n\nrun `kubectl get pods` to figure out what the name is of the pod running\nWordPress:\n\n```bash\n$ kubectl get pods\nNAME                                                 READY     STATUS    RESTARTS   AGE\nwordpress-master-0                               1/1       Running   0          20d\nwordpress-master-mariadb-master-0                1/1       Running   9          20d\nwordpress-master-mariadb-slave-0                 1/1       Running   12         20d\n```\n\nIn this case, we have 2 mariadb pods and one WordPress pod. We can copy the\nwp-content contents to the pod with the following command:\n\n```bash\n$ kubectl cp wp-content/ wordpress-master-0:/var/www/wp-content-mount\n```\n\nYou'll have to change the ownership of the files to UID 33 (the `www-data` user in the WordPress container):\n\n```bash\n$ kubectl exec -it wordpress-master-0 -- chown -R 33:33 /var/www/wp-content-mount\n```\n\nNote: this will say\n`chown: changing ownership of '/var/www/wp-content/uploads/.htaccess': Read-only file system`.\nDon't worry, that's the mounted `.htaccess` file. All the other files' ownership *will* have changed.\n\n## Known issues\n\nTake a look at https://open.greenhost.net/stackspin/wordpress-helm/-/issues\nfor issues that are already reported.\n\n## Attribution\n\nMost of this helm chart was made by following\n[this](https://kubernetes.io/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume/)\nand\n[this](https://medium.com/@gajus/the-missing-ci-cd-kubernetes-component-helm-package-manager-1fe002aac680).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvhscom%2Fchicagoganghistory-helm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvhscom%2Fchicagoganghistory-helm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvhscom%2Fchicagoganghistory-helm/lists"}