Repository: jupyterhub/zero-to-jupyterhub-k8s

Issue #1314: Ability to configure our Ingress resource with a default backend
Created: 2019-06-20T11:13:13Z
Hello everyone,
I just started to deploy Jupyterhub and trying to set up some features.
At the moment I'm struggling configuring the ingress route. I don't want to specify an explicit host for jupyterhub, being accessible by IP, so far.
I already have an Ingress Controller in my k8s cluster, and I'm using the paths to route my applications. So I want to configure an ingress route for my pre-existing Nginx ingress controller.
I have the configuration on ingress as follows:
ingress:
  enabled: true
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
    nginx.ingress.kubernetes.io/rewrite-target: /$1
  pathSuffix: '(.*)'
And when upgrading jupyterhub I get the following error:
UPGRADE FAILED
Error: failed to create resource: Ingress.extensions "jupyterhub" is invalid: spec: Invalid value: [] extensions.IngressRule(nil): either `backend` or `rules` must be specified
Error: UPGRADE FAILED: failed to create resource: Ingress.extensions "jupyterhub" is invalid: spec: Invalid value: []extensions.IngressRule(nil): either `backend` or `rules` must be specified

I understand that it's because I didn't assign any value to 'hosts' and
Is there any way around this?

Duplicate issue #1353: Ingress with backend config + readiness probe
Created: 2019-08-09T21:28:57Z
Hi,
We've started using jupyterhub on our kubernetes cluster (and so far it's great!).
I've experienced limitation on current ingress options.
We use google cloud armor to centralize security policies
https://cloud.google.com/kubernetes-engine/docs/how-to/cloud-armor-backendconfig
We typically need to expose the proxy->hub service and be able to access it through our vpn.
It would be great to add the options to be able to have an ingress defined for which we would be able to configure those policies.
The ingress current config in jhub8's repo doesn't work for us, though I've created one asides that satisfies our needs:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    ingress.gcp.kubernetes.io/pre-shared-cert: star-***
    beta.cloud.google.com/backend-config: '{"ports": {"80": "jupyterhub-backend-config"}}'
  name: jupyterhub-ingress
spec:
  rules:
  - http:
      paths:
      - backend:
          serviceName: proxy-public
          servicePort: 80

That references this backend configuration:
apiVersion: v1
items:
- apiVersion: cloud.google.com/v1beta1
  kind: BackendConfig
  metadata:
    generation: 1
    name: jupyterhub-backend-config
    namespace: jhub
  spec:
    securityPolicy:
      name: security-policy-allowing-vpn
kind: List

And I've also needed to customize the proxy deployment as ingress needs to healtcheck for a readiness/liveness probes on public-proxy service:
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /hub/login
            port: 8000
            scheme: HTTP
          initialDelaySeconds: 5
          periodSeconds: 15
          successThreshold: 1
          timeoutSeconds: 1

It would be great to have those options added into jhub k8s repo.
Thanks!

Closing comment (2020-10-07T05:47:26Z): It would be great to add the options to be able to have an ingress defined for which we would be able to configure those policies.
The ingress current config in jhub8's repo doesn't work for us, though I've created one asides that satisfies our needs:

It took a while to figure out what didn't work with the current ingress, and I think the issue is that it requires a specific host to be specified, but the host is optional.

If the host is unspecified, the Ingress routes all traffic based on the specified IngressRuleValue

Our ingress is assuming we provide one or more host entries in the ingress.hosts configuration. I think a concrete solution, is to create a rule without host being specified if ingress.hosts isn't set.
This is an issue tightly related to #1314, and I suggest both are to be resolved with a single PR, I'll close this issue and append that issue with the relevant information.

Regarding the readinessProbe for the proxy pod, it is configurable at proxy.chp.readinessProbe now.