Skip to content

OpenShift

For OpenShift, we will use the same configuration example as we used for Docker/Podman by applying custom configuration to PHP-FPM. First a secret needs to be created of which we do with the following values:

# Custom PHP-FPM pool configuration
kind: Secret
apiVersion: v1
metadata:
name: php-fpm-www-conf
namespace: neogage
data:
www.conf: W3d3d10KbGlzdGVuID0gMTI3LjAuMC4xOjkwMDAKcG0gPSBzdGF0aWMKcG0ubWF4X2NoaWxkcmVuID0gNTAKcG0uc3RhcnRfc2VydmVycyA9IDQKcG0ubWluX3NwYXJlX3NlcnZlcnMgPSA0CnBtLm1heF9zcGFyZV9zZXJ2ZXJzID0gOApwbS5wcm9jZXNzX2lkbGVfdGltZW91dCA9IDEwczsKcG0ubWF4X3JlcXVlc3RzID0gMzAwMA==
type: Opaque

as you can see, the data section holds the configuration changes encoded in base64 for the file www.conf which matches the clear-text configuration earlier in this documentation. The above may require the namespace to be changed if you have deployed NEOGAGE to an alternative namespace/project. This was created in a file called os-php-fpm-www-conf.yaml which we can then apply to OpenShift as follows:

Terminal window
oc create -f os-php-fpm-www-conf.yaml

Once the secret has been created, the deployment for NEOGAGE can be edited to ensure that the volumes and volumeMounts includes the secret and mounts the configuration file to the correct location within the NEOGAGE application container. Below shows just the two sections that we need to add as an example:

spec:
volumes:
- name: php-fpm-www-conf
secret:
secretName: php-fpm-www-conf
defaultMode: 420
containers:
- name:container
volumeMounts:
- name: php-fpm-www-conf
readOnly: true
mountPath: /etc/php83/php-fpm.d

the deployment already has volumes and volumeMounts configured from it's initial deployment, so will just need appending to the appropriate sections shown above.