@@ -394,3 +394,92 @@ jobs:
394394 if : failure() && matrix.setup-postgresql-args
395395 run : |
396396 kubectl logs statefulset/postgresql
397+
398+ test-gateway-ingress :
399+ # The main test configures autohttps, but this conflicts with testing
400+ # ingress/gateway which assume they can directly connect to proxy-public
401+ # This is a minimal test that checks connections via a gateway is possible
402+ timeout-minutes : 20
403+
404+ strategy :
405+ # Keep running even if one variation of the job fail
406+ fail-fast : false
407+ matrix :
408+ ingress-type :
409+ - gateway
410+ - ingress
411+
412+ runs-on : ubuntu-24.04
413+
414+ steps :
415+ - uses : actions/checkout@v4
416+ with :
417+ # chartpress requires git history to set chart version and image tags
418+ # correctly
419+ fetch-depth : 0
420+
421+ # Enable Gateway API in K3s
422+ # https://github.com/k3s-io/k3s/issues/12183#issuecomment-2818989109
423+ # This will create gateway.networking.k8s.io/v1 kube-system/traefik-gateway
424+ - name : pre-configure k3s installation
425+ if : matrix.ingress-type == 'gateway'
426+ run : |
427+ sudo mkdir -p /var/lib/rancher/k3s/server/manifests
428+ sudo cp ci/traefik-config.yaml /var/lib/rancher/k3s/server/manifests/
429+
430+ # Starts a k8s cluster with NetworkPolicy enforcement and installs both
431+ # kubectl and helm
432+ #
433+ # ref: https://github.com/jupyterhub/action-k3s-helm/
434+ - uses : jupyterhub/action-k3s-helm@v4
435+ with :
436+ k3s-channel : stable
437+ metrics-enabled : false
438+ traefik-enabled : true
439+ docker-enabled : true
440+
441+ - uses : actions/setup-python@v5
442+ with :
443+ python-version : " 3.11"
444+
445+ # Build our images if needed and update values.yaml with the tags
446+ - name : Install and run chartpress
447+ run : |
448+ pip3 install -r dev-requirements.txt
449+ chartpress
450+ env :
451+ DOCKER_BUILDKIT : " 1"
452+
453+ - name : Install local chart (gateway)
454+ if : matrix.ingress-type == 'gateway'
455+ run : >-
456+ helm upgrade --install jupyterhub ./jupyterhub
457+ --set proxy.service.type=ClusterIP
458+ --set httpRoute.enabled=true
459+ --set httpRoute.gateway.name=traefik-gateway
460+ --set httpRoute.gateway.namespace=kube-system
461+
462+ # K3S traefik listens on host:80/443
463+ - name : Install local chart (ingress)
464+ if : matrix.ingress-type == 'ingress'
465+ run : >-
466+ helm upgrade --install jupyterhub ./jupyterhub
467+ --set proxy.service.type=ClusterIP
468+ --set ingress.enabled=true
469+ --set ingress.hosts[0]=localhost
470+
471+ - name : " Await local chart"
472+ uses : jupyterhub/action-k8s-await-workloads@v3
473+ with :
474+ timeout : 150
475+ max-restarts : 1
476+
477+ - name : Test ingress
478+ run : |
479+ curl -vL http://localhost/
480+ curl -vL http://localhost/ | grep '<title>JupyterHub</title>'
481+
482+ - name : Get traefik logs
483+ if : always()
484+ run : |
485+ kubectl -nkube-system logs deploy/traefik
0 commit comments