-
Notifications
You must be signed in to change notification settings - Fork 6
[Kubernetes] Introduce on-prem persistent Storage (Longhorn) 🎉 #979
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
Merged
YuryHrytsuk
merged 21 commits into
ITISFoundation:main
from
YuryHrytsuk:kubernetes-introduce-longhorn
May 6, 2025
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
344a7f5
Introduce longhorn chart
YuryHrytsuk f3222af
Further longhorn configuration
YuryHrytsuk b7801e9
Merge remote-tracking branch 'upstream/main' into kubernetes-introduc…
YuryHrytsuk 8719eed
Longhorn: further settings configuration
YuryHrytsuk 2392e1e
Fix longhorn configuration bugs
YuryHrytsuk 389783b
Add comment for deletion longhorn
YuryHrytsuk 36f2276
Merge remote-tracking branch 'upstream/main' into kubernetes-introduc…
YuryHrytsuk e883698
Further longhorn configuration
YuryHrytsuk fa9ed6a
Add README.md for Longhorn wit FAQ
YuryHrytsuk 0a4f1af
Update Longhorn readme
YuryHrytsuk 5450d3c
Update readme
YuryHrytsuk a8eeffc
Futher LH configuration
YuryHrytsuk 7622ab7
Update LH's Readme
YuryHrytsuk 2cc53d5
Update Longhorn Readme
YuryHrytsuk 00ef26d
Improve LH's Readme
YuryHrytsuk 0f5f9a3
LH: Reduce reserved default disk space to 5%
YuryHrytsuk 138e822
Use values to set Longhorn storage class
YuryHrytsuk a726c66
Update LH's Readme
YuryHrytsuk d48f3c0
LH Readme: add requirements reference
YuryHrytsuk 2d309a2
PR Review: bring back portainer s3 pv
YuryHrytsuk 89e3652
LH: decrease portinaer volume size
YuryHrytsuk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # Longhorn (LH) Knowledge Base | ||
|
|
||
| ### Can LH be used for critical services (e.g., Databases)? | ||
|
|
||
| No (as of now). , we should not use it for volumes of critical services. | ||
|
|
||
| As of now, we should avoid using LH for critical services. Instead, we should rely on easier-to-maintain solutions (e.g., application-level replication [Postgres Operators], S3, etc.). Once we get hands-on experience, extensive monitoring and ability to scale LH, we can consider using it for critical services. | ||
|
|
||
| LH uses networking to keep replicas in sync, and IO-heavy workloads may easily overload it, leading to unpredictable consequences. Until we can extensively monitor LH and scale it properly on demand, it should not be used for critical or IO-heavy services. | ||
|
|
||
| ### How does LH decide which node's disk to use as storage? | ||
|
|
||
| It depends on the configuration. There are three possibilities: | ||
| * https://longhorn.io/kb/tip-only-use-storage-on-a-set-of-nodes/ | ||
|
|
||
| When using the `Create Default Disk on Labeled Nodes` option, it relies on the `node.longhorn.io/create-default-disk` Kubernetes node label. | ||
|
|
||
| Source: https://longhorn.io/docs/1.8.1/nodes-and-volumes/nodes/default-disk-and-node-config/#customizing-default-disks-for-new-nodes | ||
|
|
||
| ### Will LH pick up storage from a newly added node? | ||
|
|
||
| By default, LH will use storage on all nodes (including newly created ones) where it runs. If `createDefaultDiskLabeledNodes` is configured, it will depend on the label of the node. | ||
|
|
||
| Source: | ||
| * https://longhorn.io/kb/tip-only-use-storage-on-a-set-of-nodes/ | ||
| * https://longhorn.io/docs/1.8.1/nodes-and-volumes/nodes/default-disk-and-node-config/#customizing-default-disks-for-new-nodes | ||
|
|
||
| ### Can workloads be run on nodes where LH is not installed? | ||
|
|
||
| Workloads can run on nodes without LH as long as LH is not restricted to specific nodes via the `nodeSelector` or `systemManagedComponentsNodeSelector` settings. If LH is configured to run on specific nodes, workloads can only run on those nodes. | ||
|
|
||
| Note: There is an [ongoing bug](https://github.com/longhorn/longhorn/discussions/7312#discussioncomment-13030581) where LH will raise warnings when workloads run on nodes without LH. However, it will still function correctly. | ||
|
|
||
| Source: https://longhorn.io/kb/tip-only-use-storage-on-a-set-of-nodes/ | ||
|
|
||
| ### Adding new volumes to (PVs that rely on) LH | ||
|
|
||
| Monitor carefully whether LH is capable of handling new volumes. Test the new volume under load (when many read/write operations occur) and ensure LH does not fail due to insufficient resource capacities (e.g., network or CPU). You can also consider LH's performance section from this Readme. | ||
|
|
||
| LH's minimum recommended resource requirements: | ||
| * https://longhorn.io/docs/1.8.1/best-practices/#minimum-recommended-hardware | ||
|
|
||
| ### LH's performance / resources | ||
|
|
||
| Insights into LH's performance: | ||
| * https://longhorn.io/blog/performance-scalability-report-aug-2020/ | ||
| * https://github.com/longhorn/longhorn/wiki/Performance-Benchmark | ||
|
|
||
| Resource requirements: | ||
| * https://github.com/longhorn/longhorn/issues/1691 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # Values documentation: | ||
| # https://github.com/longhorn/longhorn/tree/v1.8.1/chart#values | ||
|
|
||
| global: | ||
| # Warning: updating node selectors (after installation) will cause downtime | ||
| # https://longhorn.io/docs/archives/1.2.2/advanced-resources/deploy/node-selector/#setting-up-node-selector-after-longhorn-has-been-installed | ||
| # | ||
| # Warning: using node selectors will restrict our workloads to the same nodes | ||
| # https://longhorn.io/kb/tip-only-use-storage-on-a-set-of-nodes/#deploy-longhorn-components-only-on-a-specific-set-of-nodes | ||
| nodeSelector: {} | ||
| systemManagedComponentsNodeSelector: {} | ||
|
|
||
| defaultSettings: | ||
| replicaAutoBalance: best-effort | ||
|
|
||
| # control on which nodes LH will use disks | ||
| # use `node.longhorn.io/create-default-disk` node label for control | ||
| createDefaultDiskLabeledNodes: true | ||
| # use dedicated folder (disk) for storage | ||
| defaultDataPath: /longhorn | ||
|
|
||
| # https://longhorn.io/docs/1.8.1/best-practices/#minimal-available-storage-and-over-provisioning | ||
| storageMinimalAvailablePercentage: 10 | ||
|
|
||
| # Prevent LH deletion. Set to true if you want to delete LH | ||
| deletingConfirmationFlag: false | ||
|
|
||
| # let replicas to be scheduled on the same node | ||
| replicaSoftAntiAffinity: false | ||
|
|
||
| # we always use dedicated disks. 5% is a good value | ||
| storageReservedPercentageForDefaultDisk: 5 | ||
|
|
||
| persistence: | ||
| # use only for non-critical ops workloads | ||
| # for critical workloads (e.g. database) | ||
| # use application replication (e.g. postgres HA operator) | ||
| defaultClass: false | ||
|
|
||
| # https://longhorn.io/docs/1.8.1/best-practices/#io-performance | ||
| defaultDataLocality: best-effort | ||
| defaultClassReplicaCount: 2 | ||
|
|
||
| # minimum volume size is 300Mi | ||
| # https://github.com/longhorn/longhorn/issues/8488 | ||
| defaultFsType: xfs | ||
|
|
||
| resources: # https://longhorn.io/docs/1.8.1/best-practices/#minimum-recommended-hardware | ||
| requests: | ||
| cpu: 0.5 | ||
| memory: 128Mi | ||
| limits: | ||
| cpu: 4 | ||
| memory: 4Gi | ||
YuryHrytsuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ingress: | ||
| enabled: true | ||
| className: "" | ||
| annotations: | ||
| namespace: {{ .Release.Namespace }} | ||
| cert-manager.io/cluster-issuer: "cert-issuer" | ||
| traefik.ingress.kubernetes.io/router.entrypoints: websecure | ||
| traefik.ingress.kubernetes.io/router.middlewares: traefik-traefik-basic-auth@kubernetescrd,traefik-longhorn-strip-prefix@kubernetescrd # namespace + middleware name | ||
| tls: true | ||
| tlsSecret: monitoring-tls | ||
| host: {{ requiredEnv "K8S_MONITORING_FQDN" }} | ||
| path: /longhorn | ||
| pathType: Prefix | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| persistence: | ||
| enabled: true | ||
| size: "300Mi" # cannot be lower https://github.com/longhorn/longhorn/issues/8488 | ||
| storageClass: "{{.Values.longhornStorageClassName}}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.