The neutron-operator provides mechanisms to customize the Apache HTTPD server configuration through the use of custom configuration files. This feature leverages the ExtraMounts functionality to mount custom HTTPD configuration files into the Neutron deployment.
- Custom Configuration Files: Create HTTPD configuration files with your custom settings
- ConfigMap: Create ConfigMaps from files containing the overrides
- OpenStackControlPlane Patch: Patch the control plane to mount the
generated ConfigMap into Neutron containers. The HTTPD configuration
automatically includes files mounted to
/etc/httpd/conf_custom/*.conf
Create your custom HTTPD configuration file(s). As a best practice the filename
could start with the httpd_custom_ prefix, but all *.conf files mounted to
/etc/httpd/conf_custom/ are automatically included by the IncludeOptional
directive in the base httpd configuration.
Example (httpd_custom_connection.conf):
# Custom connection settings for Neutron
MaxKeepAliveRequests 200
KeepAliveTimeout 15Create a Kubernetes ConfigMap containing your custom configuration files:
oc create configmap httpd-overrides --from-file=httpd_custom_connection.confIt is possible to add multiple configuration files containing dedicated configuration directives:
oc create configmap httpd-overrides \
--from-file=httpd_custom_connection.conf \
--from-file=httpd_custom_security.conf \
--from-file=httpd_custom_logging.confThe following example is based on a single customization file and demonstrates
how to set custom MaxKeepAliveRequests and KeepAliveTimeout parameters.
Update your OpenStackControlPlane resource to include the custom HTTPD
configuration files using extraMounts. The simplest approach is to mount
the entire ConfigMap to the target /etc/httpd/conf_custom mount point:
apiVersion: core.openstack.org/v1beta1
kind: OpenStackControlPlane
metadata:
name: openstack
spec:
neutron:
template:
extraMounts:
- extraVol:
- extraVolType: httpd-overrides
mounts:
- mountPath: /etc/httpd/conf_custom
name: httpd-overrides
readOnly: true
volumes:
- configMap:
name: httpd-overrides
name: httpd-overrides- Connection Tuning: Adjust keep-alive settings, connection limits, etc.
- Security Headers: Add custom security headers or configurations
- Logging: Customize Apache logging configuration
- Performance Tuning: Adjust worker processes, thread limits, etc.
After deploying your custom HTTPD configuration, you can verify that the
settings have been properly applied:
First, identify the running Neutron pod:
$ oc get pods -l service=neutronConnect to the Neutron Pod and check that your custom configuration has been loaded:
# Replace <neutron-pod-name> with the actual pod name from step 1
oc rsh -c neutron-httpd <neutron-pod-name>
# Inside the pod, dump the HTTPD configuration and check for your custom settings
httpd -D DUMP_CONFIGYou can also verify other aspects of the configuration:
# Check all loaded configuration files
$ httpd -D DUMP_INCLUDES