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

feat: add poddefault for automatic Jupyterlab authentication #6629

Closed
wants to merge 2 commits into from
Closed
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 @@ -38,6 +38,10 @@ spec:
resource: authorizationpolicies
updateStrategy:
method: InPlace
- apiVersion: kubeflow.org/v1alpha1
resource: poddefaults
updateStrategy:
method: InPlace
hooks:
sync:
webhook:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def sync(self, parent, children):
# Compute status based on observed state.
desired_status = {
"kubeflow-pipelines-ready":
len(children["PodDefault.kubeflow.org/v1alpha1"]) == 1 and
len(children["Secret.v1"]) == 1 and
len(children["ConfigMap.v1"]) == desired_configmap_count and
len(children["Deployment.apps/v1"]) == 2 and
Expand Down Expand Up @@ -339,6 +340,51 @@ def sync(self, parent, children):
}
}
},
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest adding a header so this doesn't look like part of the above artifact fetcher resources (I'm not particular about the wording, just don't want it to read that this is part of the artifact server)

Suggested change
{
# Adds "Allow access to Kubeflow Pipelines" button in Notebook spawner UI
{

"apiVersion": "kubeflow.org/v1alpha1",
"kind": "PodDefault",
"metadata": {
"name": "access-ml-pipeline",
"namespace": namespace
},
"spec": {
"desc": "Allow access to Kubeflow Pipelines",
"selector": {
"matchLabels": {
"access-ml-pipeline": "true"
}
},
"volumes": [
{
"name": "volume-kf-pipeline-token",
"projected": {
"sources": [
{
"serviceAccountToken": {
"path": "token",
"expirationSeconds": 7200,
"audience": "pipelines.kubeflow.org"
}
}
]
}
}
],
"volumeMounts": [
{
"mountPath": "/var/run/secrets/kubeflow/pipelines",
"name": "volume-kf-pipeline-token",
"readOnly": True
}
],
"env": [
{
"name": "KF_PIPELINES_SA_TOKEN_PATH",
"value": "/var/run/secrets/kubeflow/pipelines/token"
}
]
}
}
]
print('Received request:\n', json.dumps(parent, indent=2, sort_keys=True))
print('Desired resources except secrets:\n', json.dumps(desired_resources, indent=2, sort_keys=True))
Expand Down