Skip to content
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

https: Only expose port 443 if we really have HTTPS on #1758

Merged
merged 5 commits into from
Sep 8, 2020

Conversation

yuvipanda
Copy link
Collaborator

@yuvipanda yuvipanda commented Aug 27, 2020

For HTTPS, we want to expose port 443 on our service, but
only if it is 'turned on'. Unfortunately, in v 0.9, the
default was set to 'enabled' but it didn't act as enabled
unless hostnames were actually set. This exposed port 443
in proxy-public regardless of wether we were actually
set up for HTTPS or not. This caused weird issues with
AWS, since it was health checking all exposed ports. Since
we didn't have automatic HTTPS setup (since that needs
hostnames), this broke all installs on AWS!

This tries to be backwards compatible change, exposing
port 443 only if we really have https running. This
should fix issues with AWS, and be more 'correct'.

Manual HTTPS doesn't actually need hosts lists to be set,
so we remove that from our documentation.

We also re-introduce 'https.enabled' in our documentation -
manual action (DNS) is needed to enable HTTPS, so this
being explicit is IMO a good thing.

Fixes #1637

Currently, port 443 is exposed by default. This causes
issues when cloud providers (like AWS) health check all
exposed ports. Since nothing is listening to port 443,
it fails & causes general madness.

This requires users explicitly set https to enabled,
but explicit is better than implicit in this case
I think. We have too many HTTPS options to try and
auto-detect that, and currently the option we have
basically fails HTTPS on AWS

Fixes jupyterhub#1637
For HTTPS, we want to expose port 443 on our service, but
only if it is 'turned on'. Unfortunately, in v 0.9, the
default was set to 'enabled' but it didn't act as enabled
unless hostnames were actually set. This exposed port 443
in proxy-public regardless of wether we were actually
set up for HTTPS or not. This caused weird issues with
AWS, since it was health checking all exposed ports. Since
we didn't have automatic HTTPS setup (since that needs
hostnames), this broke all installs on AWS!

This tries to be backwards compatible change, exposing
port 443 only if we *really* have https running. This
should fix issues with AWS, and be more 'correct'.

Manual HTTPS doesn't actually need hosts lists to be set,
so we remove that from our documentation.

Fixes jupyterhub#1637
@yuvipanda yuvipanda changed the title https: Only expose port 443 if we have HTTPS on https: Only expose port 443 if we really have HTTPS on Aug 27, 2020
@@ -182,7 +182,7 @@ proxy:
enabled: true
minAvailable: 1
https:
enabled: true
enabled: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this makes sense as a default, but is something that probably breaks peoples configurations which left it out given our past documentation did so.

Hmmm, should we perhaps mitigate this? We could for example make template rendering fail using Helm's fail function given a certain condition, or we could provide a warning in NOTES.txt. For example, that hosts is specified and https.enabled is false, that would be a typical indication of an issue. Another one would be to not set a default value for this at all in values.yaml, and if it isn't rendering to be true or false but instead to be a blank string we assume it to be true...

Hmm... I'm not sure. What do you think about this potential need to help users transition?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be fine to make it a breaking change, where we notify users of in the release notes, saying they need to avtively set it to enabled if they had it implicitly set enabled before.

I think it would also be fine to let one z2jh release look for a dependency on the default truthiness and actively fail template rendering if we think it would crash some configurations.

consideRatio and others added 2 commits September 1, 2020 11:53
- It wasn't allowed to have a YAML comment before apiVersion, so I
  removed them. An alternative would have been to make the comments Helm
  template comments.
- I updated a comment to be more explicit about port references etc.
- I ensured that we provide the 443 port if we use a k8s secret provided
  to the configurable-http-proxy (proxy pod), and not only if we provide
  certificates. So "type: manual" and "type: secret" will both ensure we
  expose port 443 on the proxy-public service in other words.
@consideRatio
Copy link
Member

I created a PR to merge into this PR, see yuvipanda#1.

Fix syntax errors and avoided a potential bug.
@minrk
Copy link
Member

minrk commented Sep 8, 2020

Thanks folks!

yuvipanda added a commit to 2i2c-org/farallon-image that referenced this pull request Sep 28, 2020
yuvipanda added a commit to yuvipanda/datahub-old-fork that referenced this pull request Oct 5, 2020
jupyterhub/zero-to-jupyterhub-k8s#1758
wasn't actually backwards compatible - we need to explicitly
set this now.
@yuvipanda
Copy link
Collaborator Author

Turns out this wasn't actually backwards compatible somehow. If I don't set https.enabled to true explicitly, it strips HTTPS away from my installs!

@consideRatio
Copy link
Member

@yuvipanda yes =/ I considered that in #1758 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AWS LoadBalancer health checks failing when using release 0.9.0 but not 0.8.2
3 participants