-
Notifications
You must be signed in to change notification settings - Fork 640
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
Add support for HTTPs when using NodePort. #1688
base: devel
Are you sure you want to change the base?
Conversation
Introduces two new options: - 'nodeport_protocol' - selectable 'http'(default)/'https' - 'nodeport_tls_secret' - name of secret containing TLS certificate and key When 'nodeport_protocol' is set to 'https' the 'nodeport_tls_secret' must contain name of secret containing TLS key and certifacate that will be used by nginx in AWX web container exposing HTTPS traffic through NodePort. Github issues asking for https on nodeport support: ansible#1559, ansible#1563
- port: 80 | ||
protocol: TCP | ||
targetPort: 8052 | ||
name: http | ||
{% if nodeport_port is defined %} | ||
nodePort: {{ nodeport_port }} | ||
{% endif %} | ||
{% elif service_type | lower == "nodeport" and nodeport_protocol | lower == "https" %} | ||
- port: 80 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be 443?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, that is nice catch! yes it should be 443 for consistency. Now addressed in commit 778b32d
I haven't looked closely yet, but we should double-check and make sure that there are not any changes needed in the nginx.conf: |
Yes, this PR is adjusting the nginx.conf - more specifically the "https nodeport" is using same config as the "route passthrough". Or you mean if there are any changes needed inside (lines 131-139) ? |
Any progress on this? |
@rooftopcellist, Are there any further changes needed for this PR to be merged? For completeness I have retested the original submission and today (2024-07-07) I have tried on different branch to merge same changes with current For those wanting to test out the operator image for this PR, instructions below can be adjusted and used. Note you will have to provide the PV or storage AND the SSL certificate for use with https nodeport yourself. Operator container images build by me can be temporarily found (without authentication, https-only) on following URLs:
|
Any chance someone could look at this in reasonable time line? (this is one year old now and waiting on review) |
SUMMARY
Add support for HTTPs when using NodePort.
Introduces two new options:
nodeport_protocol
- selectablehttp
(default)/https
nodeport_tls_secret
- name of secret containing TLS certificate and keyWhen
nodeport_protocol
is set tohttps
thenodeport_tls_secret
must contain name of secret containing TLS key and certificate that will be used by nginx in AWX web container exposing HTTPS traffic through NodePort.Github issues asking for https on nodeport support: #1559, #1563
ISSUE TYPE
ADDITIONAL INFORMATION
Tested on kubernetes 1.28.5, deploying AWX 23.5.1.
Unless the
nodeport_protocol: https
is specified in spec there should be no change in behaviour (NodePort will be HTTP without encryption).When
nodeport_protocol: https
is specified in spec then code will add secret specified innodeport_tls_secret
to web container so that nginx running inside can read both TLS key and certificate from it. Additionally nginx configuration in such case will include SSL configuration on port 8053 and the service pointing to web container will point to port 8053 where HTTPS is exposed instead of the port 8052 with HTTP traffic.A lot of changes are re-using logic from Route TLS configuration. Documentation was updated as well to contain both original example with NodePort operating in HTTP mode and new changed configuration showing the use of HTTPS.
Why is this change useful? To allow kubernetes without ingress to expose AWX web interface via HTTPS - this allows the awx.awx ansible modules to be used as they require the encrypted connection (plain HTTP will not work with them).
Comment and suggestions are welcomed. My responses may be delayed during weekdays.