ambassador configuration for jupyterlab

6/17/2018

I'm trying to replace nginx as proxy with ambassador which is the implementation of the envoyproxy on kubernetes. I did exactly as shown in here

But nothing seems to really works, is there a way someone can help with the appropriated configuration ?

-- Gilles Essoki
envoyproxy
kubernetes
reverse-proxy

1 Answer

6/27/2018

I have a solution.

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: deploy-lab
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: lab
    spec:
      containers:
      - name: ipython-container
        image: <your image>
        imagePullPolicy: "Always"
        ports:
        - containerPort: 8888
        env <if you have one>:
         - name: BASEURL
           value: jupyter
         - name: PASSWORD
           value: jupyter

---
kind: Service
apiVersion: v1
metadata:
  labels:
    app: lab
  name: jupyter
  annotations:
    getambassador.io/config: |
      ---
      apiVersion: ambassador/v0
      kind:  Mapping
      name:  jupyter_mapping
      service: http://jupyter.<your namespace>.svc.cluster.local:8889
      use_websocket: true
      prefix: /
      rewrite: /
      host_rewrite: http://jupyter.<your namespace>.svc.cluster.local
spec:
  type: ClusterIP
  selector:
    app: lab
  ports:
  - name: jupyter
    protocol: TCP
    port: 8889
    targetPort: 8888
-- Gilles Essoki
Source: StackOverflow