All Projects → splunk → jupyterhub-istio-proxy

splunk / jupyterhub-istio-proxy

Licence: Apache-2.0 license
JupyterHub proxy implementation for kubernetes clusters running istio service mesh

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to jupyterhub-istio-proxy

rk
The remote Jupyter kernel/kernels administration utility
Stars: ✭ 53 (+103.85%)
Mutual labels:  jupyterhub
book-source-code
Accompanying source code for Istio in Action (Manning)
Stars: ✭ 175 (+573.08%)
Mutual labels:  istio
persistent binderhub
A Helm chart repo to install persistent BinderHub
Stars: ✭ 18 (-30.77%)
Mutual labels:  jupyterhub
service-mesh-patterns
Templates of service mesh configurations imbued with best practices.
Stars: ✭ 68 (+161.54%)
Mutual labels:  istio
istio-talk
A talk on Istio and related demos
Stars: ✭ 11 (-57.69%)
Mutual labels:  istio
pilot-load
Deploys many lightweight XDS clients to generate load on an XDS server (Pilot)
Stars: ✭ 30 (+15.38%)
Mutual labels:  istio
grpc-lb
Kubernetes 中的 gRPC 负载均衡
Stars: ✭ 15 (-42.31%)
Mutual labels:  istio
istio-workspace
Safely develop and test on any Kubernetes cluster without affecting others.
Stars: ✭ 55 (+111.54%)
Mutual labels:  istio
cloud-native-notes
☁️ 云原生技术面试必备基础知识
Stars: ✭ 48 (+84.62%)
Mutual labels:  istio
sidecache
Sidecar cache for kubernetes applications.
Stars: ✭ 38 (+46.15%)
Mutual labels:  istio
examples
Examples to demonstrate how to use PipeCD
Stars: ✭ 21 (-19.23%)
Mutual labels:  istio
istio-weekly
Demos, slides, resources and other stuff from Istio Weekly and Istio Big Talk episodes
Stars: ✭ 61 (+134.62%)
Mutual labels:  istio
debianized-jupyterhub
📦 ♃ Debian packaging of JupyterHub, a multi-user server for Jupyter notebooks
Stars: ✭ 28 (+7.69%)
Mutual labels:  jupyterhub
opentracing-istio-troubleshooting
Tackle the challenge of observability in a Kubernetes application that consists of multiple microservices running in the Open Liberty application server.
Stars: ✭ 16 (-38.46%)
Mutual labels:  istio
team-compass
A repository for team interaction, syncing, and handling meeting notes across the JupyterHub ecosystem.
Stars: ✭ 59 (+126.92%)
Mutual labels:  jupyterhub
math-server-docker
The ideal multi-user Data Science server with Jupyterhub and RStudio, ready for Python, R and Julia languages.
Stars: ✭ 70 (+169.23%)
Mutual labels:  jupyterhub
datahub
JupyterHubs for use by Berkeley enrolled students
Stars: ✭ 40 (+53.85%)
Mutual labels:  jupyterhub
cf-k8s-networking
building a cloud foundry without gorouter....
Stars: ✭ 33 (+26.92%)
Mutual labels:  istio
engarde
Parse default envoy (and istio-proxy) access logs like a champ with engarde and jq
Stars: ✭ 82 (+215.38%)
Mutual labels:  istio
qhub
🪴 Nebari - your open source data science platform
Stars: ✭ 175 (+573.08%)
Mutual labels:  jupyterhub

jupyterhub-istio-proxy

jupyterhub-istio-proxy is a scalable solution for Jupyterhub's high network traffic demands. It implements the jupyterhub proxy api to configure istio based on requests from hub.

The following requests are supported:

  1. GET /api/routes: Gets all routes that have been configured on istio
  2. POST /api/routes/<path>: Add the route to istio
  3. DELETE /api/routes/<path>: Remove the route from istio

Since the proxy is stateless, it can be scaled horizontally. Multiple replicas can be used to ensure uptime during deployments and handle pod failure.

Prerequisites

In order to use the jupyterhub-istio-proxy the following prerequisites need to be met.

  1. The Kubernetes cluster should have istio enabled.
  2. If an istio gateway is used, it should be setup to handle traffic for the FQDN where the jupyterhub instance is exposed.
  3. The service account used for deploying the jupyterhub-istio-proxy should have ability to list, get, create and delete istio virtual services in the namespace where the deployment is done. Refer Kubernetes RBAC for details.

Difference to the configurable-http-proxy

Unlike the default configurable-http-proxy that ships with Jupyterhub, the traffic is not routed through the proxy itself. The proxy configures istio to handle all traffic to the notebook servers as well as Jupyterhub. As a result, the proxy-public service is not needed when using jupyterhub-istio-proxy. For more information see https://medium.com/@harsimran.maan/running-jupyterhub-with-istio-service-mesh-on-kubernetes-a-troubleshooting-journey-707039f36a7b

Deployment

The proxy can be deployed to a Kubernetes namespace running Jupyterhub by applying the following config: Change SUB_DOMAIN_HOST to a value to a hostname where jupyterhub is hosted. The ISTIO_GATEWAY value should be set to the gateway which handles traffic for jupyterhub. If your cluster has a non-default domain, you can specify that with CLUSTER_DOMAIN

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: jupyterhub
    component: proxy
  name: proxy
spec:
  replicas: 3
  selector:
    matchLabels:
      app: jupyterhub
      component: proxy
      release: RELEASE-NAME
  strategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: jupyterhub
        component: proxy
        release: RELEASE-NAME
    spec:
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - podAffinityTerm:
              labelSelector:
                matchExpressions:
                - key: name
                  operator: In
                  values:
                  - proxy
              topologyKey: kubernetes.io/hostname
            weight: 100
      containers:
        - command:
            - /proxy/jupyterhub-istio-proxy
          env:
            - name: CONFIGPROXY_AUTH_TOKEN
              valueFrom:
                secretKeyRef:
                  key: proxy.token
                  name: hub-secret
            - name: ISTIO_GATEWAY
              value: jupyterhub-gateway
            - name: K8S_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: SUB_DOMAIN_HOST
              value: '*'
            - name: VIRTUAL_SERVICE_PREFIX
              value: jupyterhub
            - name: WAIT_FOR_WARMUP
              value: "true"
            - name: CLUSTER_DOMAIN
              value: "cluster.local"
          image: splunk/jupyterhub-istio-proxy:0.3.0
          imagePullPolicy: IfNotPresent
          name: proxy
          ports:
            - containerPort: 8000
              name: proxy-api
              protocol: TCP
          resources:
            limits:
              cpu: "1"
              memory: 256M
            requests:
              cpu: 100m
              memory: 256M
          securityContext:
            allowPrivilegeEscalation: false
      securityContext:
        runAsNonRoot: true
      terminationGracePeriodSeconds: 60
---
apiVersion: v1
kind: Service
metadata:
  name: proxy-api
spec:
  ports:
    - name: http-proxy-api
      port: 8001
      protocol: TCP
      targetPort: 8000
  selector:
    component: proxy
  type: ClusterIP
---

Jupyterhub user pod creation flow when using jupyterhub-istio-proxy. jupyterhub-istio-proxy

Dev Setup

The project requires Go 1.17.3+. Run the tests

make test

Testing setup

https://github.com/golang/mock is used for creating mocks for testing.

mockgen --source=proxy/istio.go -destination=proxy/istio_mock_test.go -write_package_comment -package=proxy
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].