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: Longhorn toolbox CLI #14

Merged
merged 7 commits into from
Jul 11, 2024
Merged

feat: Longhorn toolbox CLI #14

merged 7 commits into from
Jul 11, 2024

Conversation

c3y1huang
Copy link
Contributor

Which issue(s) this PR fixes:

Issue longhorn/longhorn#7927

What this PR does / why we need it:

See LEP.

Special notes for your reviewer:

None

Additional documentation or context

None

@c3y1huang c3y1huang self-assigned this Apr 26, 2024
@c3y1huang c3y1huang force-pushed the feat-cli branch 26 times, most recently from b1267c0 to 4c9449b Compare April 30, 2024 02:53
@c3y1huang c3y1huang marked this pull request as ready for review April 30, 2024 02:58
@c3y1huang c3y1huang requested a review from a team April 30, 2024 02:58
Comment on lines +30 to +31
Short: "Longhorn commandline interface.",
Long: "CLI (local) for troubleshooting and operations to be used in the Kubernetes cluster.",
Copy link
Member

Choose a reason for hiding this comment

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

nit: tried to undertand the longhornctl-local and longhornctl. The naming is a bit confusing. We can find better names later.

@derekbit
Copy link
Member

derekbit commented Jul 9, 2024

./bin/longhornctl check preflight          
INFO[2024-07-09T15:17:34+08:00] Initializing preflight checker               
W0709 15:17:34.395440 3556587 client_config.go:659] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
W0709 15:17:34.395461 3556587 client_config.go:664] error creating inClusterConfig, falling back to default config: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined
ERRO[2024-07-09T15:17:34+08:00] Failed to initialize preflight checker: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable 

Works after

# export KUBECONFIG=/root/.kube/config    
# ./bin/longhornctl check preflight   

Can we improve it by add an options --kubeconfig for longhornctl and longhornctl-local in the v1.8.0?

@c3y1huang
Copy link
Contributor Author

./bin/longhornctl check preflight          
INFO[2024-07-09T15:17:34+08:00] Initializing preflight checker               
W0709 15:17:34.395440 3556587 client_config.go:659] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
W0709 15:17:34.395461 3556587 client_config.go:664] error creating inClusterConfig, falling back to default config: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined
ERRO[2024-07-09T15:17:34+08:00] Failed to initialize preflight checker: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable 

Works after

# export KUBECONFIG=/root/.kube/config    
# ./bin/longhornctl check preflight   

Can we improve it by add an options --kubeconfig for longhornctl and longhornctl-local in the v1.8.0?

The option flag is available in the global options for the remote CLI; its not used in the local CLI. To see the menu, you can use this command:

./bin/longhornctl global-options

@derekbit
Copy link
Member

derekbit commented Jul 9, 2024

./bin/longhornctl check preflight          
INFO[2024-07-09T15:17:34+08:00] Initializing preflight checker               
W0709 15:17:34.395440 3556587 client_config.go:659] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
W0709 15:17:34.395461 3556587 client_config.go:664] error creating inClusterConfig, falling back to default config: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined
ERRO[2024-07-09T15:17:34+08:00] Failed to initialize preflight checker: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable 

Works after

# export KUBECONFIG=/root/.kube/config    
# ./bin/longhornctl check preflight   

Can we improve it by add an options --kubeconfig for longhornctl and longhornctl-local in the v1.8.0?

The option flag is available in the global options for the remote CLI; its not used in the local CLI. To see the menu, you can use this command:

./bin/longhornctl global-options

Thank you. found it!

@derekbit
Copy link
Member

derekbit commented Jul 10, 2024

Except for the remote and local export functionality, other parts LGTM.

@c3y1huang c3y1huang force-pushed the feat-cli branch 5 times, most recently from 555f58a to 088dd90 Compare July 11, 2024 04:03
longhorn/longhorn-7927

Signed-off-by: Chin-Ya Huang <[email protected]>
longhorn/longhorn-7927

Signed-off-by: Chin-Ya Huang <[email protected]>
longhorn/longhorn-7927

Signed-off-by: Chin-Ya Huang <[email protected]>
longhorn/longhorn-7927

Signed-off-by: Chin-Ya Huang <[email protected]>
longhorn/longhorn-7927

Signed-off-by: Chin-Ya Huang <[email protected]>
longhorn/longhorn-7927

Signed-off-by: Chin-Ya Huang <[email protected]>
longhorn/longhorn-7927

Signed-off-by: Chin-Ya Huang <[email protected]>
Copy link
Member

@derekbit derekbit left a comment

Choose a reason for hiding this comment

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

LGTM

@derekbit derekbit merged commit 7da7de7 into longhorn:master Jul 11, 2024
3 checks passed
@c3y1huang c3y1huang deleted the feat-cli branch July 11, 2024 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants