kubectl create configmap my-cert --from-file=ca-key.pem=/root/ca-key.pem --from-file=ca.pem=/root/ca.pem
apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: test-ws-1-ingress namespace: default annotations: nginx.ingress.kubernetes.io/ssl-redirect: "true" #nginx.ingress.kubernetes.io/rewrite-target: / #nginx.ingress.kubernetes.io/rewrite-target: /$1 #nginx.ingress.kubernetes.io/app-root: /lab nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" #nginx.ingress.kubernetes.io/proxy-redirect-from: https://$http_host/ #nginx.ingress.kubernetes.io/proxy-redirect-to: https://$http_host//ws-1/ #nginx.ingress.kubernetes.io/configuration-snippet: | # some config #nginx.ingress.kubernetes.io/server-alias: "/lab, /" spec: #tls: #- secretName: kubernetes-dashboard-certs rules: #- host: k8s.example.com - http: paths: #- path: /dashboard(/|$)(.*) - path: /ws-1/ backend: serviceName: test-ws-svc-1 servicePort: 8888 --- kind: Service apiVersion: v1 metadata: name: test-ws-svc-1 spec: selector: app: test-ws-1 tier: backend ports: - protocol: TCP port: 8888 targetPort: http --- apiVersion: apps/v1 kind: Deployment metadata: name: test-ws-1 spec: selector: matchLabels: app: test-ws-1 tier: backend track: stable replicas: 1 template: metadata: labels: app: test-ws-1 tier: backend track: stable spec: containers: - name: test-ws-1 image: "xxx" command: ["jupyter"] args: ["lab","--port", "8888", "--ip", "*", "--allow-root", "--LabApp.base_url='/ws-1/'", "--NotebookApp.token='abcd'", "--NotebookApp.certfile=/test-pd/ca.pem", "--NotebookApp.keyfile=/test-pd/ca-key.pem"] #args: ["lab","--port", "8888", "--ip", "0.0.0.0", "--allow-root"] ports: - name: http containerPort: 8888 volumeMounts: - mountPath: /test-pd name: cert-config volumes: - name: cert-config configMap: name: my-cert