I'm seeking your help with a Helm-related issue (Kubernetes package manager).
I wanted to use Helm to deploy an instance of:
WordPress
MariaDB
I find it to be a very useful tool!
Specifically, I’m interested in how to declare a custom local path where .zip
files of certain WordPress plugins are stored. These plugins should be installed during the Helm installation process.
Currently, in the values.yaml
file (which centralizes the configuration for WP/MariaDB), there is a parameter called wordpressPlugins
that allows plugin installation in two ways:
Declaring the plugin name, which Helm then downloads from WordPress (requires internet access).
Providing the URL of a public repository on GitHub.
I would like to know how to reference a local path instead. Any guidance would be greatly appreciated!
The goal is to automatically download and install WordPress plugins without requiring an internet connection.
I attempted to achieve this using the following approach, but I encountered a failure:
I downloaded WordPress from Bitnami.
Inside the downloaded WordPress directory, I created a folder named
plugins
.I placed the
.zip
files of the plugins I had downloaded into this folder.In the
values.yaml
file, underwordpressPlugins
, I specified the path to the folder containing the.zip
plugin files.I verified the read and write permissions of the folder.
After deploying everything, the WordPress pod enters a CrashLoopBackOff state.
The issue is caused by this approach because, if I hadn't specified anything in wordpressPlugins
, WordPress would have started without any problems. So, the CrashLoopBackOff is triggered by an incorrect instruction.
There isn't much information available online about this. If you have any knowledge or experience with this, please share it with me. I would really appreciate it. Thank you!
I'm seeking your help with a Helm-related issue (Kubernetes package manager).
I wanted to use Helm to deploy an instance of:
WordPress
MariaDB
I find it to be a very useful tool!
Specifically, I’m interested in how to declare a custom local path where .zip
files of certain WordPress plugins are stored. These plugins should be installed during the Helm installation process.
Currently, in the values.yaml
file (which centralizes the configuration for WP/MariaDB), there is a parameter called wordpressPlugins
that allows plugin installation in two ways:
Declaring the plugin name, which Helm then downloads from WordPress. (requires internet access).
Providing the URL of a public repository on GitHub.
I would like to know how to reference a local path instead. Any guidance would be greatly appreciated!
The goal is to automatically download and install WordPress plugins without requiring an internet connection.
I attempted to achieve this using the following approach, but I encountered a failure:
I downloaded WordPress from Bitnami.
Inside the downloaded WordPress directory, I created a folder named
plugins
.I placed the
.zip
files of the plugins I had downloaded into this folder.In the
values.yaml
file, underwordpressPlugins
, I specified the path to the folder containing the.zip
plugin files.I verified the read and write permissions of the folder.
After deploying everything, the WordPress pod enters a CrashLoopBackOff state.
The issue is caused by this approach because, if I hadn't specified anything in wordpressPlugins
, WordPress would have started without any problems. So, the CrashLoopBackOff is triggered by an incorrect instruction.
There isn't much information available online about this. If you have any knowledge or experience with this, please share it with me. I would really appreciate it. Thank you!
Share Improve this question asked Mar 19 at 8:40 DefendYourKingdomDefendYourKingdom 12 bronze badges 3- I have not a solution but wordpressPlugins cannot be used for installing Themes locally. Here ist the description of the parameter.link. For installing custom themes locally you might need an sideCarContainer: link It is definitely not an easy task as there is an issue opened on that. link – Cristoforo86 Commented Mar 19 at 9:00
- @Cristoforo86 Thank you for taking the time to answer my question and for specifying the themes, but the question is about plugins, also because putting instructions for the themes in the wordpressPlugins parameter is really a very funny approach. Thanks anyway :) – DefendYourKingdom Commented Mar 19 at 9:46
- Unfortunately I cannot edit my comment, but I clearly meant to write "plugins" and not "themes". – Cristoforo86 Commented Mar 19 at 10:28
1 Answer
Reset to default 0There is 2 way you can add custom path:
Using Helm Values File:
Add the custom path for plugin
wordpress:
plugins:
customPluginsPath: /path/to/custom/plugins/
Using Config File:
Step1: Create the K8S for your Plugin
If you have .zip
files for WordPress plugins stored locally, you can create a ConfigMap to store them in Kubernetes:
kubectl create configmap wordpress-plugins --from-file=/path/to/custom/plugins/
Step2: Mount the ConfigMap to the WordPress Pod :
extraVolumes:
- name: plugins-volume
configMap:
name: wordpress-plugins # Name of the ConfigMap
extraVolumeMounts:
- name: plugins-volume
mountPath: /var/www/html/wp-content/plugins # Mount the plugins at the correct directory inside WordPress container
You may also want to run a post-install
script to unzip the plugin files after WordPress is deployed. This can be achieved using an initContainer
:
initContainers:
- name: unzip-plugins
image: busybox
command: ["sh", "-c", "unzip /plugins/*.zip -d /var/www/html/wp-content/plugins"]
volumeMounts:
- name: plugins-volume
mountPath: /plugins
- name: wordpress-volume
mountPath: /var/www/html/wp-content/plugins
Install Wordpress using helm chart :
helm upgrade --install my-wordpress bitnami/wordpress -f values-wordpress.yaml