-
Notifications
You must be signed in to change notification settings - Fork 455
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
[SDK] Fix namespace label #2493
base: master
Are you sure you want to change the base?
[SDK] Fix namespace label #2493
Conversation
Signed-off-by: helenxie-bit <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: helenxie-bit <[email protected]>
/cc @kubeflow/wg-automl-leads @Electronic-Waste @tariq-hasan |
@helenxie-bit: GitHub didn't allow me to request PR reviews from the following users: tariq-hasan. Note that only kubeflow members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically LGTM. Just a question:)
namespace_labels = client.CoreV1Api().read_namespace(namespace).metadata.labels | ||
if "katib.kubeflow.org/metrics-collector-injection" not in namespace_labels: | ||
namespace_labels["katib.kubeflow.org/metrics-collector-injection"] = ( | ||
"enabled" | ||
) | ||
client.CoreV1Api().patch_namespace( | ||
namespace, {"metadata": {"labels": namespace_labels}} | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also encountered this error and fixed it with kubectl label
command. Is this label designed on purpose for users who want to enable sidecar container injection? I'm curious about this👀 @kubeflow/wg-automl-leads
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should patch the namespace in our SDK with this label.
If users want to create Katib Experiments in their namespace, the label must be presented.
As you can see we apply this label to the namespace:
- https://github.com/kubeflow/katib/blob/master/manifests/v1beta1/components/namespace/namespace.yaml#L7
- https://github.com/kubeflow/manifests/blob/master/apps/profiles/upstream/base/namespace-labels.yaml#L15
We just need to add it to the Katib documentation guides.
@Electronic-Waste @helenxie-bit Please can you create tracking issue to update docs ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll create an issue describing this
/hold |
What this PR does / why we need it:
Fix the error
the namespace lacks label \"katib.kubeflow.org/metrics-collector-injection: enabled\"
when using Katib SDK to create Experiment.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #2492
Checklist: