Skip to content

[SPIKE] Research on Packs-of-Packs for Spins exploration #551

Description

@viniciusdc

Spike partner to #566 (spins tooling ergonomics). That one exercises the spin tooling; this one looks at the composition unit underneath it: a pack of packs - a parent software pack that declares other packs as Helm chart dependencies and owns the wiring between them.

Summary

The question I want answered: can a parent pack compose child packs and wire their values together using only native k8s primitives (Secrets, ConfigMaps, install ordering), without a bespoke value-passing layer?

Background/motivation

We want to ship pre-integrated pack combinations while keeping the base composable. The motivating pair is Nebi + the data science pack, which genuinely have to be configured together. The most obvious direction is a new pack that keeps the others as dependencies - so this spike is to find out where that breaks before we commit to it.

The approach I want to test is that packs don't communicate directly. On a shared cluster, they coordinate through a common medium - an ordered pack creates a named Secret/ConfigMap, and a later pack references it by name. No NIC-side value bus. That's convention-based wiring (#175) applied at the pack-of-packs level.

flowchart TD
  subgraph PoP["Pack of packs"]
    
   subgraph Packs["Packs"]
      A["Child pack A<br/>(e.g. Nebi)"]
      B["Child pack B<br/>(e.g. Data Science)"]
    end
   
   subgraph Comm["Communal space"]
      RA[("pack-a outputs")]
      RB[("pack-b outputs")]
    end

    A -->|publishes| RA
    RA -->|consumed by| B
    
     B -->|"publishes (optional)"| RB
    RB -->|consumed by| A
  end
Loading

Spins would reference a pack of packs and layer infra/hardware config on top - related but separate, and out of scope here.

Scope

A throwaway parent pack that installs two child packs pre-wired and deploys cleanly end-to-end:

Questions I want answered

  • Namespaces. One namespace for the whole pack of packs, or child packs in separate namespaces with cross-namespace resource grants? The resource-grant path should work (scoped to the consuming pod), and IMO that's the better option for organizations - I want to confirm it holds here.
  • Ordering. How do we express the dependency? Is ArgoCD sync-wave ordering enough, or do we need something in the parent chart / the NebariApp CRD?
  • Does the NebariApp CRD need to expose more for child packs to discover each other's outputs, or is naming-by-convention enough?
  • Scalability. How badly does the customization surface grow as packs are added? Is per-combination specificity acceptable, or a dead end?

Activity

  1. self-assigned this
    on Aug 5, 2026
  2. updated Start date 2026-08-05 and Size L on Aug 5, 2026
  3. added
    enhancement
    on Aug 5, 2026
  4. cleared
    Priority
    on Aug 5, 2026
  5. viniciusdc commented on Aug 6, 2026

    @viniciusdc
    CollaboratorAuthor

    How DSP wires Nebi today is the consumer-hardcodes-the-companion shape. There's a nebi: values block in DSP that looks like this right now:

    nebi:
      image:
        repository: quay.io/nebari/nebi
        tag: "sha-be3187c"        # pinned per chart release by CI
      remoteURL: ""               # browser-side OIDC redirect; else derived from keycloak.hostname
      internalURL: ""             # hub->nebi token exchange; else http://nebi-pack-nebari-nebi-pack.<ns>.svc
      namespace: "nebi"
      releaseName: "nebi-pack"    # drives the derived OIDC client id: nebi-<release>-nebari-nebi-pack
      port: 8460

    Everything derives from a single anchor (keycloak.hostname) plus that naming convention, the values get bridged into c.JupyterHub.custom, and a python config file (03-nebi-envs.py) reads them and injects into the singleuser env at spawn. Plus two additive NetworkPolicies (hub->nebi egress, singleuser->gateway egress). It works, but DSP is the one carrying knowledge of its sibling.

    Another third case might be dask-gateway-pack + DSP (data-science-pack), layered on the Nebi+DSP pair.

    In the dask-gateway case, It's the pack that gives JupyterHub users on-demand Dask clusters: a notebook calls Gateway() and gets a multi-tenant scheduler/worker cluster back. For that to work, the singleuser pod has to know the gateway's address and how to authenticate to it, so it's a genuine second consumer of the same hub, wired the same way Nebi is. That makes it the natural test of whether this composition holds past two packs (the "grows per pack" question), and it carries one twist Nebi doesn't (auth model, below).

    Adding dask-gateway the same way means a second hardcoded block, daskGateway:, deriving traefik-<release>.<ns>.svc and injecting DASK_GATEWAY__* the same way. It would be a near-mirror of the nebi: block above:

    daskGateway:
      namespace: "dask-gateway"
      releaseName: "dask-gateway-pack"  # -> traefik-<release>.<ns>.svc is the in-cluster proxy
      proxyPort: 8786
      auth:
        type: jupyterhub                # jupyterhub (reuses JUPYTERHUB_API_TOKEN) | basic (dev)
      address: ""                       # else derived: http://traefik-<release>.<ns>.svc.cluster.local
      proxyAddress: ""                  # else derived: tls://traefik-<release>.<ns>.svc.cluster.local:<proxyPort>
      publicAddress: ""                 # else derived: https://dask-gateway.<base-domain>

    Third pack, third block. That's the customization surface growing linearly with siblings, and it all lands in DSP.

    The communal-space version of this exact case is cleaner. dask-gateway-pack publishes a ConfigMap, say dask-gateway-connection, with {address, proxyAddress, publicAddress, authMode}. DSP runs one generic injector that reads any connection ConfigMap by a well-known name + schema and injects the env. The only thing both sides agree on is the ConfigMap name and its schema, not every field of every sibling. DSP stops growing a block per pack and grows one consumer once.

    On the spike's questions, from this case:

    • Ordering is looser than I expected, because the read is at spawn time, not a mount. The injector runs per-user-server-start, so the ConfigMap can show up after DSP installs and it still works on the next spawn. Sync-wave ordering matters for mount-time deps (a Secret volume the hub needs at boot), much less for runtime reads. So the hard ordering constraint only bites when a pack consumes at install/boot, not at spawn.
    • Namespaces held up. dask-gateway in its own ns, DSP in its own, with a scoped cross-ns read grant for the ConfigMap plus the singleuser egress policy to the gateway ns. That's the per-org-friendly path, and nothing here needed a shared namespace.
    • Discovery vs convention: naming-by-convention on the ConfigMap was enough for the address wiring. I didn't hit anything that needed the NebariApp CRD to grow a field for this. The open part is whether "publish a connection ConfigMap" should be a documented contract, or something the CRD blesses so it's discoverable rather than folklore.

    One reciprocity wrinkle worth calling out, because it's not just address-passing. Classic dask-gateway used JupyterHub-token auth, which couples the gateway back to the hub API with a shared token, so it's a two-way dependency, not a one-way publish. Nebi sidesteps that by authenticating against Keycloak/OIDC with no hub dependency at all. If dask-gateway did the same it becomes a hub-independent peer and the wiring stays one-way (publish address, done). Should gateway-style packs be nudged toward OIDC instead of hub-token auth so the coupling stays unidirectional?

    Verified the DSP<->nebi mechanism against the live 0.1.1 chart and a running cluster, and confirmed the dask-gateway service names/ports/auth on a live deploy, so the shapes above are real, not from the docs.

  6. marcelovilla commented on Aug 20, 2026

    @marcelovilla
    Member

    I've been looking into this for the past few days and have gathered some thought here.

    I think the composition layer shouldn't be a parent Helm chart (like this issue originally suggests), nor it should be install-time codegen either (like #549 suggest). It should be a composition object evaluated by an existing engine, such as Crossplane or kro. I'll outline the reasons behind this:

    • As far as I can tell, nothing in the k8s ecosystem provides an option to specify dependencies between Argo CD applications. While other engines like Flux do provide this, it seems like Argo CD is limited to using sync waves, eventual consistency, or, still in beta, progressive syncs, which seems like a promising option. Kro, on the other hand, builds automatically a dependency graph between the specified resources. Crossplane does not have such functionality natively, but it allows to define the order of the resources explicitly via https://github.com/crossplane-contrib/function-sequencer and it also allow to run kro via https://github.com/crossplane-contrib/function-kro. While it seems eventual consistency via reconciliation is a fairly idiomatic pattern in Kubernetes and would work in some cases, other cases where where the consumer has no retry loop (e.g., a pod stuck Pending on a PVC that doesn't exist yet or a one-time Job that fails) won't recover on their own.
    • We already know about use cases where a spin would not only have software packs, but also resources they share. For a specific use case, see [SPIKE] Shared volume storage across software packs #597, where the example is the data science pack and the rayserve pack needing shared storage. Crossplane has CompositeResourceDefinition (XRD) and Composition, which would allow spin authors to easily compose software packs and arbitrary resources. Kro has a ResourceGraphDefinition (RGD), a similar concept that allows authors to compose multiple resources. In contrast, neither an Umbrella chart nor using an App of Apps pattern (I think the issue conflates the two of them) are really helpful for composition. An umbrella chart can template the shared resources, but everything lands in one release. Subcharts share the parent's namespace unless every chart templates its own, and upgrading or removing one pack becomes an operation on the parent chart. An App of Apps pattern or an ApplicationSet would fix that by having different applications and separate namespaces, but they only allow specifying Application resources. Shared resources have to go somewhere else, such as a git directory of static manifests with one more Application pointing at it. Things like a PVC's size, namespaces, and claim names would need to be hardcoded in files, repeated in each pack's values, and kept in sync by hand.
    • For wiring values, kro provides External References, which give access to resources that already exist in the cluster. This means a software pack that depends on another can read values from a ConfigMap or Secret after it has been created. Crossplane offers similar functionality with required resources, allowing compositions to access values in a ConfigMap (or any resource, for that matter) from within a function. It seems either approach satisfies the "communal space" approach that @viniciusdc proposes.

    Regarding the one software pack per namespace convention that we seem to want to follow, I found one caveat in the Crossplane docs:

    Most XRDs should use Namespaced scope. This provides better security isolation and follows standard Kubernetes patterns. Use Cluster scope only for platform level resources like RBAC or cluster configuration.

    Regardless of the mechanism we choose for the composition layer, I still think software packs need to have stable values paths a composer can set. Whatever creates the shared resources can only reach a pack through its Helm values. If a spin creates a PVC and needs the data science pack to mount it, that only works if the chart has something like sharedStorage.existingClaim wired through to the pod spec. This is work that needs to happen at the software pack level.

    As part of the research spike, I want to build a PoC using either Crossplane or kro (or maybe both) and see how it would work, the authoring ergonomics, and think about the publishing process. We're planning to have a set of curated spins but we also want to allow the community to create and share their own spins.

  7. self-assigned this
    on Aug 24, 2026
  8. removed their assignment
    on Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementtype: exploration 🔮

Fields

Priority

None yet

Start date

Aug 5, 2026

Target date

None yet

Size

L

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions