Millions and millions of volumes orchestrated
Go to file
Derek Su 73d4a9f938 refactor(disk): optimize disk metrics collection to use collector directly
Signed-off-by: Derek Su <derek.su@suse.com>
Signed-off-by: jinhong.kim0 <hookak25@gmail.com>
Co-authored-by: jinhong.kim0 <hookak25@gmail.com>
2025-07-14 12:57:50 +08:00
.github chore(workflow): update permissions of actions/create-github-app-token@v2 2025-07-11 18:28:05 +08:00
api feat(ipv6): add address family support to UploadParametersForBackingImage 2025-06-26 13:34:21 +08:00
app fix(recurringjob): ensure each goroutine uses its own *logrus.Entry 2025-06-06 09:21:33 +08:00
client feat(volume): add APIs for offline rebuilding 2025-04-21 17:29:41 +08:00
constant fix(orphan): prevent creating orphans from a terminating instance 2025-05-16 18:16:20 +09:00
controller refactor(disk): optimize disk metrics collection to use collector directly 2025-07-14 12:57:50 +08:00
csi feat: add StartupProbe for Longhorn CSI plugin 2025-06-03 16:32:34 +08:00
datastore feat: update replica health check 2025-07-03 07:50:27 +00:00
engineapi feat(disk): add disk performance metrics monitoring support 2025-07-11 19:35:07 +08:00
hack Rename hack/clean_crs.sh to hack/clean_crds.sh 2019-11-12 19:25:42 -08:00
k8s refactor(disk): optimize disk metrics collection to use collector directly 2025-07-14 12:57:50 +08:00
manager feat: update replica health check 2025-07-03 07:50:27 +00:00
meta Refactor the version initialization and move the version info into pkg "meta" 2022-02-15 18:36:39 +08:00
metrics_collector refactor(disk): optimize disk metrics collection to use collector directly 2025-07-14 12:57:50 +08:00
package chore(deps): update docker/dockerfile docker tag to v1.17.1 2025-06-22 06:33:05 +00:00
recovery_backend chore: fix lint 2025-03-27 12:41:48 +08:00
scheduler feat: update replica health check 2025-07-03 07:50:27 +00:00
scripts fix(ci): eliminate unnecessary error message 2025-03-27 13:41:10 +08:00
types feat(types): add support for floating point values for guaranteed-instance-manager-cpu 2025-07-11 15:37:44 +08:00
upgrade feat(upgrade): remove v1beta1 api 2025-06-06 00:48:12 +00:00
util feat(volume): modify volume rebuild/va controller 2025-04-21 17:29:41 +08:00
vendor fix(deps): update github.com/longhorn/go-iscsi-helper digest to 69ce6f3 2025-07-13 14:44:26 +00:00
webhook fix: check backup target status before backup creation 2025-07-10 11:55:25 +08:00
.coderabbit.yaml chore: add .coderabbit.yaml 2025-04-16 08:50:53 +08:00
.codespellignore fix: typos 2022-12-12 16:46:49 +08:00
.gitignore feat: self-contained container image build 2025-02-14 18:18:18 +08:00
CODE_OF_CONDUCT.md Add code of conduct 2021-07-29 16:09:39 +08:00
Dockerfile.dapper chore(Dockerfile): use latest golangci-lint 2025-03-12 07:32:54 +00:00
LICENSE Initial commit 2017-05-03 11:17:50 -07:00
Makefile fix(ci): fixed project name 2025-02-17 22:50:08 +08:00
README.md chore: update README.md 2025-01-13 08:34:37 +08:00
codecov.yml Config codecov.yml to prevent codecov status check blocking pull requests. 2022-08-18 15:04:06 +08:00
go.mod fix(deps): update github.com/longhorn/go-iscsi-helper digest to 69ce6f3 2025-07-13 14:44:26 +00:00
go.sum fix(deps): update github.com/longhorn/go-iscsi-helper digest to 69ce6f3 2025-07-13 14:44:26 +00:00
main.go feat(log): add function name and line number in log message 2023-10-20 10:59:13 +08:00
renovate.json Update renovate.json 2024-02-19 12:21:12 +08:00
version chore(version): update version file to v1.10.0-dev 2025-04-25 12:19:22 +00:00

README.md

Longhorn Manager

Build StatusGo Report Card

Manager for Longhorn.

Requirements

  • Kubernetes cluster:
  • Host:
    • iscsiadm/open-iscsi and nfs-common/nfs-utils/nfs-client are installed.
    • The filesystem (ext4 or XFS) supports the file extents feature for data storage.

Run the environment_check.sh script to check if your system meets the listed requirements. For more information, see the Longhorn documentation.

Build

make

Deployment

  • kubectl create -f https://raw.githubusercontent.com/longhorn/longhorn/master/deploy/longhorn.yaml

It will deploy the following components in the longhorn-system namespace:

  • Longhorn Manager
  • Longhorn Instance Manager
  • Longhorn CSI plugin components
  • Longhorn UI

For more information, see the Longhorn documentation.

Cleanup

Longhorn CRD has finalizers in them, so user should delete the volumes and related resource first, give manager a chance to clean up after them.

To prevent damage to the Kubernetes cluster, we recommend deleting all Kubernetes workloads using Longhorn volumes (PersistentVolume, PersistentVolumeClaim, StorageClass, Deployment, StatefulSet, DaemonSet, etc).

  1. Ensure that the value of the Longhorn setting deleting-confirmation-flag is true.
kubectl -n longhorn-system edit setting deleting-confirmation-flag
  1. Create the uninstallation job to cleanly purge CRDs from the system. Verify that uninstallation was successful.
kubectl create -f https://raw.githubusercontent.com/longhorn/longhorn/master/uninstall/uninstall.yaml
kubectl get job/longhorn-uninstall -w

Example output:

$ kubectl create -f https://raw.githubusercontent.com/longhorn/longhorn/master/uninstall/uninstall.yaml
serviceaccount/longhorn-uninstall-service-account created
clusterrole.rbac.authorization.k8s.io/longhorn-uninstall-role created
clusterrolebinding.rbac.authorization.k8s.io/longhorn-uninstall-bind created
job.batch/longhorn-uninstall created

$ kubectl -n longhorn-system get job/longhorn-uninstall -w
NAME                 COMPLETIONS   DURATION   AGE
longhorn-uninstall   0/1           3s         3s
longhorn-uninstall   1/1           20s        20s
^C
  1. Remove remaining components.
kubectl delete -f https://raw.githubusercontent.com/longhorn/longhorn/master/uninstall/uninstall.yaml
kubectl delete -f https://raw.githubusercontent.com/longhorn/longhorn/master/deploy/longhorn.yaml

Tip: If you try kubectl delete -Rf deploy/install first and get stuck there, pressing Ctrl C then running kubectl create -f deploy/uninstall/uninstall.yaml can also help you remove Longhorn. Finally, don't forget to cleanup remaining components by running kubectl delete -f deploy/uninstall/uninstall.yaml.

Unit Test

To execute all unit tests, make sure there are no uncommitted changes and run:

make test

If there are uncommitted changes, only the affected modules will be tested. To execute specific unit tests or all tests matching a regex, run:

TESTS=="NodeControllerSuite.*" make test

Integration test

See longhorn-tests repo

Contribution

Please check the Longhorn repo for the contributing guide.

License

Copyright (c) 2014-2025 The Longhorn Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.