jupyterlab的大使配置

时间:2018-06-17 13:57:40

标签: kubernetes reverse-proxy envoyproxy

我试图用大使替换nginx作为代理,这是kubernetes上envoyproxy的实现。我完全按照here

中的说明完成了

但似乎没有什么真的有效,有没有人可以帮助使用适当的配置?

1 个答案:

答案 0 :(得分:0)

我有解决方案

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