Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ambassador route and base_url in notebook controller #2620

Merged
merged 1 commit into from
Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package notebook

import (
"context"
"strconv"
"strings"

v1alpha1 "github.com/kubeflow/kubeflow/components/notebook-controller/pkg/apis/notebook/v1alpha1"
Expand Down Expand Up @@ -226,6 +225,10 @@ func generateStatefulSet(instance *v1alpha1.Notebook) *appsv1.StatefulSet {
},
}
}
container.Env = append(container.Env, corev1.EnvVar{
Name: "NB_PREFIX",
Value: "/notebook/" + instance.Namespace + "/" + instance.Name,
})
if podSpec.SecurityContext == nil {
fsGroup := DefaultFSGroup
podSpec.SecurityContext = &corev1.PodSecurityContext{
Expand Down Expand Up @@ -254,9 +257,9 @@ func generateService(instance *v1alpha1.Notebook) *corev1.Service {
"kind: Mapping",
"name: notebook_" + instance.Namespace + "_" + instance.Name + "_mapping",
"prefix: /notebook/" + instance.Namespace + "/" + instance.Name,
"rewrite: /" + instance.Namespace + "/" + instance.Name,
"rewrite: /notebook/" + instance.Namespace + "/" + instance.Name,
"timeout_ms: 300000",
"service: " + instance.Name + "." + instance.Namespace + ":" + strconv.Itoa(port),
"service: " + instance.Name + "." + instance.Namespace,
"use_websocket: true",
}, "\n"),
},
Expand Down
2 changes: 1 addition & 1 deletion kubeflow/jupyter/prototypes/notebook_controller.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @description notebook controller
// @shortDescription notebooks
// @param name string Name
// @optionalParam controllerImage string gcr.io/kubeflow-images-public/notebook-controller:v20190227-v0.4.0-rc.1-177-g3b973eca-dirty-e62cd5 The image to use for the notebook controller
// @optionalParam controllerImage string gcr.io/kubeflow-images-public/notebook-controller:v20190304-v0.4.0-rc.1-189-g157a3399-dirty-47ed08 The image to use for the notebook controller

local notebooks = import "kubeflow/jupyter/notebook_controller.libsonnet";
local instance = notebooks.new(env, params);
Expand Down