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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Create Longhorn CLI focusing on non CR resource operations #7927

Open
innobead opened this issue Feb 15, 2024 · 4 comments
Open

[FEATURE] Create Longhorn CLI focusing on non CR resource operations #7927

innobead opened this issue Feb 15, 2024 · 4 comments
Assignees
Labels
area/cli highlight Important feature/issue to highlight kind/feature Feature request, new feature priority/0 Must be fixed in this release (managed by PO) require/auto-e2e-test Require adding/updating auto e2e test cases if they can be automated require/doc Require updating the longhorn.io documentation require/lep Require adding/updating enhancement proposal require/manual-test-plan Require adding/updating manual test cases if they can't be automated
Milestone

Comments

@innobead
Copy link
Member

innobead commented Feb 15, 2024

Is your feature request related to a problem? Please describe (馃憤 if you like this request)

Create a Longhorn CLI focusing on non-custom-resource operations, as users can operate resources via Kubectl or similar tools, K8s user experience. However, some operations like install prerequisites, preflight check before installation/upgrade, runtime periodical check, headless support bundle download, check known issue mentioned in the knowledge pages, etc. are only partially operated through UI.

We should provide a CLI to help with these headless operations for general functions, debugging, benchmarking, troubleshooting, etc.

Change https://github.com/longhorn/longhorn-preflight to longhorn/cli and implement the corresponding functions.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

@innobead innobead added kind/feature Feature request, new feature priority/0 Must be fixed in this release (managed by PO) require/auto-e2e-test Require adding/updating auto e2e test cases if they can be automated require/doc Require updating the longhorn.io documentation require/lep Require adding/updating enhancement proposal require/manual-test-plan Require adding/updating manual test cases if they can't be automated labels Feb 15, 2024
@innobead innobead added this to the v1.7.0 milestone Feb 15, 2024
@innobead innobead added the highlight Important feature/issue to highlight label Feb 15, 2024
@shuo-wu
Copy link
Contributor

shuo-wu commented Feb 27, 2024

We can leverage this CLI to guide users understand & config Longhorn systems on demands:

  1. Use an interactive way to help config Longhorn nodes, disks, settings, backups, and so on.
  2. Step by Step. In each step, we will explain what's for and list all options.

For example:

$ longhorn-cli guide

Do you need to launch v1 volumes in your clusters? v1 volumes are low-spec friendly but have limited performance.
yes/no: yes

How many CPUs you wish to reserve for the component (longhorn-instance-manger pod) that runs v1 volumes on each node?
Please input the reserved CPU percentage:

......

======

Do you need to add extra disks for the below nodes?
  1. Node 1: default disk
  2. Node 2: default disk
  3. Node 2: default disk
Please input the nodes we want to add disks: 1, 2, 3

The available disk type is:
  1. Block device (for v2 volumes)
  2. Filesystem (for v1 volumes)
Please select the disk type: 2

Please input the disk path: /var/lib/longhorn-extra

......
======

Do you have a backupstore?
  Currently, Longhorn supports:
  1. NFS. nfs://xxxxxx
  2. S3. xxx
  3. CIFS. xxx
If YES, please input the backup target: s3://xxxxx

What's the credential of the backup target?
Please input the secret name: minio-secret 
......


Besides, this CLI can handle some complicated operations such as recurring-job creation and configuration. Without this, users have to get a template YAML, check all fields and the corresponding options, modify it, create CRs, and bind it to some volumes. It's too trivial. An interactive CLI definitely helps.

@derekbit
Copy link
Member

derekbit commented Mar 8, 2024

Some functionalities of the CLI

@c3y1huang
Copy link
Contributor

Filesystem

  • Filesystem check

@derekbit , could you help to create an issue for the filesystem check with some context?

@longhorn-io-github-bot
Copy link

longhorn-io-github-bot commented Apr 30, 2024

Pre Ready-For-Testing Checklist

  • Where is the reproduce steps/test steps documented?
    The reproduce steps/test steps are at:

  • Is there a workaround for the issue? If so, where is it documented?
    The workaround is at:

  • Does the PR include the explanation for the fix or the feature?

  • Does the PR include deployment change (YAML/Chart)? If so, where are the PRs for both YAML file and Chart?
    The PR for the YAML change is at:
    The PR for the chart change is at:

  • Have the backend code been merged (Manager, Engine, Instance Manager, BackupStore etc) (including backport-needed/*)?
    The PR is at:

  • Which areas/issues this PR might have potential impacts on?
    Area troubleshoot, CLI
    Issues

  • If labeled: require/LEP Has the Longhorn Enhancement Proposal PR submitted?
    The LEP PR is at Feat(LEP): Longhorn toolbox CLI聽#8428

  • If labeled: area/ui Has the UI issue filed or ready to be merged (including backport-needed/*)?
    The UI issue/PR is at

  • If labeled: require/doc Has the necessary document PR submitted or merged (including backport-needed/*)?
    The documentation issue/PR is at TBU

  • If labeled: require/automation-e2e Has the end-to-end test plan been merged? Have QAs agreed on the automation test case? If only test case skeleton w/o implementation, have you created an implementation issue (including backport-needed/*)
    The automation skeleton PR is at
    The automation test case PR is at
    The issue of automation test case implementation is at (please create by the template)

  • If labeled: require/automation-engine Has the engine integration test been merged (including backport-needed/*)?
    The engine automation PR is at

  • If labeled: require/manual-test-plan Has the manual test plan been documented?
    The updated manual test plan is at TBU

  • If the fix introduces the code for backward compatibility Has a separate issue been filed with the label release/obsolete-compatibility?
    The compatibility issue is filed at

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli highlight Important feature/issue to highlight kind/feature Feature request, new feature priority/0 Must be fixed in this release (managed by PO) require/auto-e2e-test Require adding/updating auto e2e test cases if they can be automated require/doc Require updating the longhorn.io documentation require/lep Require adding/updating enhancement proposal require/manual-test-plan Require adding/updating manual test cases if they can't be automated
Projects
None yet
Development

No branches or pull requests

5 participants