How to change php values in wordpress running on kubeapps kubernetes How to change php values in wordpress running on kubeapps kubernetes kubernetes kubernetes

How to change php values in wordpress running on kubeapps kubernetes


Solution

The only proper way to change the php values I found is by using a custom HTAccess file. To achieve that you first of all need to create a configMap. This configMap is separated from the Wordpress app and can be used for multiple instances of Wordpress running on your Kubernetes cluster. The following is an example of a working configMap. You should take care of the namespace you choose. kubeapps is the default namespace, if you have chosen a different one you should apply the same for your configMap otherwise the configMap might not be found.

apiVersion: v1kind: ConfigMapmetadata:  name: prod-wordpress-cm  namespace: kubeappsdata:  wordpress-htaccess.conf: |    php_value upload_max_filesize 64M    php_value post_max_size 64M    php_value max_execution_time 180    php_value max_input_time 180

When you successfully applied the configMap to your cluster by running kubectl apply -f prod-wordpress-cm.yaml you can reference it in the Kubeapps helm chart values.yaml which holds your instance specific configuration (for details see: https://hub.kubeapps.com/charts/bitnami/wordpress and https://github.com/bitnami/bitnami-docker-wordpress). Ensure that you enter the same configMap name you have chosen above.

## Set Apache allowOverride to None## ref: https://github.com/bitnami/bitnami-docker-wordpress#environment-variables##allowOverrideNone: true# ConfigMap with custom wordpress-htaccess.conf file (requires allowOverrideNone to true)customHTAccessCM: prod-wordpress-cm

And you are done. Hope that helps saving some time for others.