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

reduce redundancy on context to cluster flags in solo deployment create #977

Open
Tracked by #589
jeromy-cannon opened this issue Dec 10, 2024 · 0 comments
Open
Tracked by #589
Assignees
Labels
Internal Requirement Multiple Cluster Support Issues which are only required to enable Solo support for multi-cluster deployments. P1 High priority issue. Required to be completed in the assigned milestone.

Comments

@jeromy-cannon
Copy link
Contributor

jeromy-cannon commented Dec 10, 2024

It seems redundant that we would need to supply both the list of clusters for the deployment (--deployment-clusters) as well as the context to cluster mappings (--context-cluster). Originally, we were going to included this in the LocalConfig design, but we realized that it can be retrieved directly from the kubernetes client and that since it could change it would be better to pull it fresh each time.

I propose that we just remove the --context-cluster, and instead use the --deployment-clusters, and then do a look up for the context using the Kubernetes client API. I think this would also be more re-usable across multiple users machines since the context can be renamed locally and may not match.

The following:

kind delete cluster -n solo
kind create cluster -n solo
rm -Rf ~/.solo
solo init
solo context connect -n jeromy-solo --context kind-solo --cluster-name kind-solo
solo deployment create -n jeromy-solo --deployment-clusters kind-solo
kind delete cluster -n solo
kind create cluster -n solo
rm -Rf ~/.solo
solo init
solo context connect -n jeromy-solo --context kind-solo --cluster-name kind-solo
solo deployment create -n jeromy-solo --deployment-clusters kind-solo

]Deleting cluster "solo" ...
Deleted nodes: ["solo-control-plane"]
Creating cluster "solo" ...
 ✓ Ensuring node image (kindest/node:v1.27.3) 🖼
 ✓ Preparing nodes 📦
 ✓ Writing configuration 📜
 ✓ Starting control-plane 🕹️
 ✓ Installing CNI 🔌
 ✓ Installing StorageClass 💾
Set kubectl context to "kind-solo"
You can now use your cluster with:

kubectl cluster-info --context kind-solo

Not sure what to do next? 😅  Check out https://kind.sigs.k8s.io/docs/user/quick-start/

******************************* Solo *********************************************
Version			: 0.99.0
Kubernetes Context	: kind-solo
Kubernetes Cluster	: kind-solo
**********************************************************************************
(node:85496) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
✔ Setup home directory and cache
✔ Check dependencies [2s]
  ✔ Check dependency: helm [OS: darwin, Release: 23.6.0, Arch: arm64] [2s]
✔ Setup chart manager [1s]
✔ Copy templates in '/Users/user/.solo/cache'


***************************************************************************************
Note: solo stores various artifacts (config, logs, keys etc.) in its home directory: /Users/user/.solo
If a full reset is needed, delete the directory or relevant sub-directories before running 'solo init'.
***************************************************************************************

******************************* Solo *********************************************
Version			: 0.99.0
Kubernetes Context	: kind-solo
Kubernetes Cluster	: kind-solo
Kubernetes Namespace	: jeromy-solo
**********************************************************************************
(node:85504) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
✔ Initialize
✔ Prompt local configuration [21s]
✔ Update local configuration

******************************* Solo *********************************************
Version			: 0.99.0
Kubernetes Context	: kind-solo
Kubernetes Cluster	: kind-solo
Kubernetes Namespace	: jeromy-solo
**********************************************************************************
(node:85515) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
⠇ Initialize
◼ Prompt local configuration
◼ Validate cluster connections
◼ Create remote config

? Enter context cluster mapping:  ›

whereas if I run the following:

kind delete cluster -n solo
kind create cluster -n solo
rm -Rf ~/.solo
solo init
solo context connect -n jeromy-solo --context kind-solo --cluster-name kind-solo
solo deployment create -n jeromy-solo --context-cluster kind-solo=kind-solo
kind delete cluster -n solo
kind create cluster -n solo
rm -Rf ~/.solo
solo init
solo context connect -n jeromy-solo --context kind-solo --cluster-name kind-solo
solo deployment create -n jeromy-solo --context-cluster kind-solo=kind-solo

Deleting cluster "solo" ...
Deleted nodes: ["solo-control-plane"]
Creating cluster "solo" ...
 ✓ Ensuring node image (kindest/node:v1.27.3) 🖼
 ✓ Preparing nodes 📦
 ✓ Writing configuration 📜
 ✓ Starting control-plane 🕹️
 ✓ Installing CNI 🔌
 ✓ Installing StorageClass 💾
Set kubectl context to "kind-solo"
You can now use your cluster with:

kubectl cluster-info --context kind-solo

Not sure what to do next? 😅  Check out https://kind.sigs.k8s.io/docs/user/quick-start/

******************************* Solo *********************************************
Version			: 0.99.0
Kubernetes Context	: kind-solo
Kubernetes Cluster	: kind-solo
**********************************************************************************
(node:85870) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
✔ Setup home directory and cache
✔ Check dependencies [1s]
  ✔ Check dependency: helm [OS: darwin, Release: 23.6.0, Arch: arm64] [1s]
✔ Setup chart manager [1s]
✔ Copy templates in '/Users/user/.solo/cache'


***************************************************************************************
Note: solo stores various artifacts (config, logs, keys etc.) in its home directory: /Users/user/.solo
If a full reset is needed, delete the directory or relevant sub-directories before running 'solo init'.
***************************************************************************************

******************************* Solo *********************************************
Version			: 0.99.0
Kubernetes Context	: kind-solo
Kubernetes Cluster	: kind-solo
Kubernetes Namespace	: jeromy-solo
**********************************************************************************
(node:85887) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
✔ Initialize
✔ Prompt local configuration [1m36s]
✔ Update local configuration

******************************* Solo *********************************************
Version			: 0.99.0
Kubernetes Context	: kind-solo
Kubernetes Cluster	: kind-solo
Kubernetes Namespace	: jeromy-solo
**********************************************************************************
(node:85935) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
⠧ Initialize
◼ Prompt local configuration
◼ Validate cluster connections
◼ Create remote config

? Enter the Solo deployment cluster names (comma separated):  ›
@jeromy-cannon jeromy-cannon added Internal Requirement P1 High priority issue. Required to be completed in the assigned milestone. Multiple Cluster Support Issues which are only required to enable Solo support for multi-cluster deployments. labels Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internal Requirement Multiple Cluster Support Issues which are only required to enable Solo support for multi-cluster deployments. P1 High priority issue. Required to be completed in the assigned milestone.
Projects
None yet
Development

No branches or pull requests

2 participants