Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,16 @@ prerequisite (Longhorn); the rest are convenience + robustness.
the prereqs. **Makes F1 (Longhorn) usable.**

### F. Storage
- [ ] **F1 — Longhorn Platform component.** Add `longhorn` to the opt-in
Platform set (replicated block storage, the tier NFS/local-path don't
cover). Depends on E1 (open-iscsi on nodes); document the
iscsi-installer DaemonSet as the interim fallback.
- [x] **F1 — Longhorn Platform component.** `longhorn` added to the opt-in
Platform set (chart `longhorn` from `charts.longhorn.io`, ns
`longhorn-system`) — replicated block storage (RWO volumes with
node-to-node replication + snapshots), the tier NFS/local-path don't
cover. `#Platform.longhorn?` schema entry + unit test (chart/ns defaults,
values thread-through). Every node needs `open-iscsi`: install it via a
k3s worker pool's `nodePrep.packages` (**E2**, now shipped) — documented in
both the component comment and schema — or Longhorn's own iscsi-installer
DaemonSet as the interim fallback. Enabling is `platform.longhorn.enabled:
true`.

### G. Public exposure
- [ ] **G1 — expose-app convenience.** A composite (or documented pattern)
Expand Down
6 changes: 6 additions & 0 deletions plugins/k8s/internal/provider/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ var platformComponents = []component{
// persistent volumes on request. Set nfsProvisioner.values.nfs.{server,path}
// to the NAS export.
{"nfsProvisioner", "https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner", "nfs-subdir-external-provisioner", "nfs-provisioner"},
// longhorn is replicated block storage — the tier NFS/local-path don't
// cover (RWO volumes with node-to-node replication + snapshots). Every node
// needs `open-iscsi` installed; provision it via a k3s worker pool's
// nodePrep (E2) — e.g. nodePrep.packages: ["open-iscsi"] — or Longhorn's
// own iscsi-installer DaemonSet as an interim fallback.
{"longhorn", "https://charts.longhorn.io", "longhorn", "longhorn-system"},
}

// releaseCoord locates an installed component release for Get/Delete/prune.
Expand Down
27 changes: 27 additions & 0 deletions plugins/k8s/internal/provider/platform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,33 @@ func TestEnabledComponents_NfsProvisioner(t *testing.T) {
}
}

func TestEnabledComponents_Longhorn(t *testing.T) {
comps := enabledComponents(map[string]any{
"longhorn": map[string]any{
"enabled": true,
"values": map[string]any{"defaultSettings": map[string]any{"defaultReplicaCount": 2}},
},
})
if len(comps) != 1 {
t.Fatalf("enabled = %d, want 1 (longhorn)", len(comps))
}
c := comps[0]
if c.comp.name != "longhorn" {
t.Errorf("component = %q", c.comp.name)
}
if c.chart.Repo != "https://charts.longhorn.io" || c.chart.Name != "longhorn" {
t.Errorf("chart defaults wrong: %+v", c.chart)
}
if c.opts.namespace != "longhorn-system" {
t.Errorf("default namespace = %q, want longhorn-system", c.opts.namespace)
}
// User values (e.g. replica count) thread through to the chart.
ds, _ := c.values["defaultSettings"].(map[string]any)
if ds["defaultReplicaCount"] != 2 {
t.Errorf("longhorn values not threaded: %+v", c.values)
}
}

func TestEnabledComponents_NvidiaDevicePlugin(t *testing.T) {
comps := enabledComponents(map[string]any{
"nvidiaDevicePlugin": map[string]any{"enabled": true},
Expand Down
5 changes: 5 additions & 0 deletions plugins/k8s/internal/provider/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ const platformSchema = `
// nfsProvisioner gives a dynamic NFS-backed StorageClass for persistent
// volumes (e.g. a Synology share). Set values.nfs.server + values.nfs.path.
nfsProvisioner?: {...}
// longhorn is replicated block storage (RWO volumes with node-to-node
// replication + snapshots). Every node needs open-iscsi — install it via
// a k3s worker pool's nodePrep.packages, or Longhorn's iscsi-installer
// DaemonSet as a fallback.
longhorn?: {...}
}
...
}
Expand Down
Loading