-
Notifications
You must be signed in to change notification settings - Fork 348
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 auto create namespace #9328
feat: add auto create namespace #9328
Conversation
✅ Deploy Preview for determined-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
9523e69
to
f35e221
Compare
536fb59
to
1023ffd
Compare
f35e221
to
d073e49
Compare
1023ffd
to
42325e3
Compare
d073e49
to
77c9422
Compare
89914b0
to
149e49c
Compare
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.
LGTM
harness/determined/cli/workspace.py
Outdated
@@ -194,12 +195,12 @@ def create_workspace(args: argparse.Namespace) -> None: | |||
agent_user_group = _parse_agent_user_group_args(args) | |||
checkpoint_storage = _parse_checkpoint_storage_args(args) | |||
|
|||
if args.cluster_name and not args.namespace: | |||
if args.cluster_name and (not args.namespace and not args.auto_create_namespace): |
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.
is there a cleaner way to represent this logic instead of A & (!B & !C)
? maybe just remove the parentheses?
5a9a17e
to
a40904e
Compare
Docsite preview being generated for this PR. |
380b4da
to
5cbca53
Compare
5d25015
to
9164a9f
Compare
9164a9f
to
75163c4
Compare
5b4fd87
into
wksp-namespace-binding
Ticket
DET-10224
Description
Implement backend logic for auto-creating Kubernetes namespaces and implement the CLI arguments for this feature.
det w create <workspace-name> --cluster-name <cluster_name> --auto-create-namespace
,det w create <workspace_name> --auto-create-namespace-all-clusters
,det w bindings set <workspace-name> --cluster-name <cluster_name> --auto-create-namespace
, anddet w bindings set <workspace-name> --auto-create-namespace-all-clusters
Test Plan
c1
andc2
respectively.det w create <workspace-name> --cluster-name c1 --auto-create-namespace
kubectl get namespaces
and verify that the namespace name returned from the above CLI command is listeddet w bindings list
and verify that the correct workspace-namespace bindings show up (default
forc2
, and the auto-created namespace name forc1
Now, create a workspace and verify that the auto-create feature works with
det w bindings set
Run
det w create <second_workspace_name>
Run
det w bindings set <second_workspace_name> --auto-create-namespace --cluster_name c2
Run
det w bindings list
and verify that the auto-created namespace is listed for clusterc1
while the default namespace is listed for clusterc2
Run
det w create <third_workspace_name> --auto-create-namespace-all-clusters
and verify that the output of this command shows workspace-namespace bindings to an auto-created namespace for both clusters.Run
det w bindings list
and verify that both auto-created namespaces show up appropriately.-Run
det w create <fourth_workspace_name>
anddet w bindings set <fourth_workspace_name> --auto-create-namespace-all-clusters
and verify the output shows the auto-created workspace-namespace bindings.det w bindings list <fourth_workspace_name>
to verify that both auto-created namespaces show up appropriately.Checklist
docs/release-notes/
.See Release Note for details.