Skip to content

Commit

Permalink
Add usage example
Browse files Browse the repository at this point in the history
Partially addresses #8
  • Loading branch information
harsimranmaan committed Aug 7, 2020
1 parent b7f5aff commit 7e873ca
Showing 1 changed file with 98 additions and 0 deletions.
98 changes: 98 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,104 @@ The following requests are supported:

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

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.

```yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: jupyterhub
component: proxy
name: proxy
spec:
replicas: 3
revisionHistoryLimit: 1
selector:
matchLabels:
app: jupyterhub
component: proxy
strategy:
type: RollingUpdate
template:
metadata:
labels:
app: jupyterhub
component: proxy
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: istio-gateway/jupyterhub-gateway
- name: K8S_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: SUB_DOMAIN_HOST
value: example.com
- name: VIRTUAL_SERVICE_PREFIX
value: jupyterhub
- name: WAIT_FOR_WARMUP
value: "true"
image: splunk/jupyterhub-istio-proxy:v0.0.1
imagePullPolicy: IfNotPresent
name: proxy
ports:
- containerPort: 8000
name: proxy-public
protocol: TCP
resources:
limits:
cpu: "1"
memory: 256M
requests:
cpu: 100m
memory: 256M
securityContext:
allowPrivilegeEscalation: false
nodeSelector: {}
securityContext:
runAsNonRoot: true
terminationGracePeriodSeconds: 60

---
apiVersion: v1
kind: Service
metadata:
name: proxy-api
spec:
ports:
- name: http-proxy-api
port: 80
protocol: TCP
targetPort: 8000
selector:
component: proxy
type: ClusterIP

```

# Testing setup

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

0 comments on commit 7e873ca

Please sign in to comment.