Commit b798497
committed
feat(longhorn): generalize install for non-AWS providers
Lift the Longhorn install logic out of the AWS provider into a shared
package so the existing-cluster and hetzner providers can opt in. On
clusters without managed RWX (Hetzner hcloud-volumes is RWO-only,
on-prem k3s, kind/k3d), charts that need RWX previously had to fall
back to the in-cluster NFS-on-RWO workaround, which is fragile on
overlayfs hosts. Closes #269.
Shared package pkg/storage/longhorn:
- Install(ctx, kubeconfigBytes, *Config) — idempotent helm install or
upgrade. iSCSI prerequisite DaemonSet runs on first install only;
upgrade path skips it (saves the 3-minute readiness wait).
- Config + IsEnabled / Replicas helpers. nil *Config = do not install.
aws provider:
- Longhorn field type is now *longhorn.Config; aws.LonghornConfig is a
type alias so existing yaml under cluster.aws.longhorn keeps working.
- LonghornEnabled() retains AWS's nil-block-as-enabled default.
- Provider.Deploy calls longhorn.Install directly.
existing provider:
- New opt-in longhorn block (nil = no install).
- Deploy installs Longhorn when enabled.
- GetStorageClass / InfraSettings.StorageClass returns 'longhorn' when
Longhorn is enabled and storage_class is unset; explicit
storage_class always wins.
hetzner provider:
- Same opt-in. Deploy reads the kubeconfig hetzner-k3s wrote and
installs Longhorn after cluster create.
- InfraSettings.StorageClass flips from hcloud-volumes to longhorn
when enabled.1 parent b2c4a2f commit b798497
13 files changed
Lines changed: 1039 additions & 854 deletions
File tree
- pkg
- provider
- aws
- existing
- hetzner
- storage/longhorn
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
3 | 20 | | |
4 | 21 | | |
5 | 22 | | |
| |||
19 | 36 | | |
20 | 37 | | |
21 | 38 | | |
22 | | - | |
| 39 | + | |
23 | 40 | | |
24 | 41 | | |
25 | 42 | | |
| |||
41 | 58 | | |
42 | 59 | | |
43 | 60 | | |
44 | | - | |
45 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
46 | 65 | | |
47 | 66 | | |
48 | 67 | | |
49 | 68 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 69 | + | |
54 | 70 | | |
55 | 71 | | |
56 | 72 | | |
57 | | - | |
58 | 73 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 74 | + | |
63 | 75 | | |
64 | 76 | | |
65 | 77 | | |
| |||
83 | 95 | | |
84 | 96 | | |
85 | 97 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| |||
0 commit comments