-
Notifications
You must be signed in to change notification settings - Fork 32
Allow customize http vhost config using HttpdCustomization.CustomConfigSecret #402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: stuggi The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…igSecret This change allows to customize the httpd vhost config using this parameter to specify a secret that contains service config data. The content of each provided snippet gets rendered as a go template and placed into /etc/httpd/conf/httpd_custom_<key> . At the end of the vhost config in the default httpd template these custom configs get included using `Include conf/httpd_custom_*`. For information on how sections in httpd configuration get merged, check section "How the sections are merged" in https://httpd.apache.org/docs/current/sections.html#merging All possible parameters which can be use in a template can be looked up in the rendered config-data secret of the service like: $ oc get cm -n openstack horizon-config-data -o json | jq -r .data.TemplateParameters | base64 -d or in the running pod of the service in the file: $ cat /var/lib/config-data/default/TemplateParameters The content is a versioned dump of the parameters of the service operator, like: ~~~ KeystoneEndpointInternal: https://keystone-internal.openstack.svc:5000 Override: false SSLCertificateFile: /etc/pki/tls/certs/horizon.crt SSLCertificateKeyFile: /etc/pki/tls/private/horizon.key ServerName: horizon.openstack.svc TLS: true MemcachedServers: memcached-0.memcached.openstack.svc:11212 ... ~~~ Depends-On: openstack-k8s-operators/lib-common#591 Depends-On: openstack-k8s-operators/lib-common#593 Jira: https://issues.redhat.com/browse/OSPRH-13100 Signed-off-by: Martin Schuppert <[email protected]>
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
this is true for api services, which have extraMounts. We added this approach to keystone before it had extraMounts there. I think got added there since then. Do we plan to add extraMounts to all api services? wondering if there should be a single documented way for consistency on how to customize http config for all services and not a mix of using extraMounts or this approach where we do not have them. |
@fmount not sure if it is required in other operators, but could you use templates with extraMounts, like in this example openstack-k8s-operators/keystone-operator#525 (comment) , needed for keystone federation. iirc that would be not possible. |
Right, templating is not possible in that case, but I think we get keystone covered in that case because the feature is already in. [1] openstack-k8s-operators/keystone-operator#525 (comment) |
do I get it right, what you suggest is to add the include like in https://github.com/openstack-k8s-operators/glance-operator/blob/eee52cfdc598521211804db5f7b16ec80461f750/templates/common/config/httpd.conf#L30 to the vhost template where we have extraMounts, so that a user could add optional static params using this file? |
Yeah, although I think it doesn't necessarily need to be within the |
if we just need to be able to customize the global params, yes we could to it in the generic httpd.conf, but if you want to customize/override a vhost specific setting I think we have to load it there, no? similar to this PR |
Correct. I can improve my change and add |
Done [1] |
sounds good to me if there is no templating required. we can follow up on that when there is the need |
ack, thanks, @mcgonago I think then the agreement is that we can go with #510 as an immediate solution to the problem if @stuggi agrees. |
This change allows to customize the httpd vhost config using this parameter to specify a secret that contains service config data. The content of each provided snippet gets rendered as a go template and placed into /etc/httpd/conf/httpd_custom_ .
At the end of the vhost config in the default httpd template these custom configs get included using
Include conf/httpd_custom_*.For information on how sections in httpd configuration get merged, check section "How the sections are merged" in https://httpd.apache.org/docs/current/sections.html#merging
All possible parameters which can be use in a template can be looked up in the rendered config-data cm of the service like:
or in the running pod of the service in the file:
The content is a versioned dump of the parameters of the service operator, like:
Depends-On: openstack-k8s-operators/lib-common#591
Depends-On: openstack-k8s-operators/lib-common#593
Jira: https://issues.redhat.com/browse/OSPRH-13100