Skip to content

Add quickstart subcommand to deploy a local cluster with software packs - #767

Open
marcelovilla wants to merge 22 commits into
mainfrom
quickstart-poc
Open

marcelovilla wants to merge 22 commits into
mainfrom
quickstart-poc

Conversation

@marcelovilla

@marcelovilla marcelovilla commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Closes

Closes #752

Description

This PR adds an initial version of the nic quickstart subcommand. Running it will allow users to deploy a local cluster with a predefined set of software packs (nebi and data science for now) so they can test Nebari on their own machine.

The configuration for the subcommand is intentionally kept small for this initial version. It does not need any argument but a few can be passed to override the domain and the http(s) ports. Once run, the subcommand generates a config file and deploys a cluster from it right away. Users that want to delete the cluster can simply run nic destroy passing that config file as the input.

This is a stacked PR as there are two issues blocking both nebi and data science to work properly on a local cluster using self-signed certificates:

I'll open two separate PRs to address them. In the meantime, anyone testing this can refer to the workaround in #641

How to Test

To test this, make sure Docker is running and that ports 80 and 443 are free, (otherwise you need to pass --http-port and --https-port).

  1. Build and check the config it generates without deploying:
make build
./nic quickstart --dry-run
cat config.yaml

The config should use the local provider, domain: nebari.lvh.me, certificate.type: selfsigned and a local repository. Running the same command again should succeed without changes, and running it with a different --domain should fail unless you pass --force.

  1. Deploy:
./nic quickstart

It ends with a summary of the URLs and the config file to use with nic deploy and nic destroy.

  1. Check that ArgoCD installed the packs:
kubectl get applications -n argocd
kubectl get nebariapps -A
git -C ~/.nic/gitops/nebari-quickstart log --oneline

All applications should be Synced and Healthy, including nebi-pack and data-science-pack (this takes about 10 minutes on a fresh cluster). Both NebariApps should be Ready, and the repository should have a commit adding the packs.

  1. Create a user and log in. Get the Keycloak admin credentials with ./nic outputs, open https://keycloak.nebari.lvh.me/admin/, and add a user with a password in the nebari realm. Then open https://nebari.lvh.me and log in. Nebi and JupyterHub should show up on the landing page.

  2. Delete the cluster:

./nic destroy --auto-approve

@marcelovilla
marcelovilla changed the base branch from main to local-in-cluster-dns November 11, 2026 15:04
@marcelovilla
marcelovilla added this pull request to stack #770 November 11, 2026 15:05
@marcelovilla marcelovilla added the status: blocked ⛔️ Another task is blocking this item label Nov 12, 2026
@marcelovilla
marcelovilla marked this pull request as ready for review November 12, 2026 14:23
@marcelovilla
marcelovilla force-pushed the quickstart-poc branch 2 times, most recently from 9fba00e to 7b69515 Compare November 13, 2026 10:42
@marcelovilla
marcelovilla removed this pull request from stack #770 November 13, 2026 10:46
@marcelovilla
marcelovilla changed the base branch from local-in-cluster-dns to self-signed-root-ca November 13, 2026 10:46
@marcelovilla
marcelovilla added this pull request to stack #777 November 13, 2026 10:46
@marcelovilla
marcelovilla force-pushed the quickstart-poc branch 2 times, most recently from a1dc073 to 313c4c2 Compare November 16, 2026 10:59
@marcelovilla
marcelovilla removed this pull request from stack #777 November 16, 2026 12:05
@marcelovilla
marcelovilla added this pull request to stack #780 November 16, 2026 12:06
@khuyentran1401

Copy link
Copy Markdown
Contributor

Testing nic quickstart (nic PR #767)

I tested this PR on macOS with Docker Desktop (8 CPUs, 7.6 GB memory). I approached it as a data scientist trying Nebari for the first time, to see whether the command is easy to follow.

TL;DR: Overall, the quickstart command makes it much easier for first-time users to try out Nebari locally without knowing the stack behind it. The suggestions below focus on the command's output and a few screens that could be less confusing for new users.

1. Deploy Nebari

nic quickstart

⚠️ Logs look stuck and are hard to read

The logs pause here for about 25 seconds while the cluster is created:

{"time":"2026-11-19T14:28:32.736279-06:00","level":"INFO","msg":"Wrote config file","path":"config.yaml"}
{"time":"2026-11-19T14:28:32.736815-06:00","level":"INFO","msg":"Starting deployment"}
{"time":"2026-11-19T14:28:32.738065-06:00","level":"INFO","msg":"Configuration parsed successfully","resource":"config","action":"validated","project_name":"nebari-quickstart","provider":"local"}
{"time":"2026-11-19T14:28:32.738181-06:00","level":"INFO","msg":"Provider selected","provider":"local"}
{"time":"2026-11-19T14:28:32.768154-06:00","level":"INFO","msg":"Creating kind cluster nebari-quickstart","resource":"provider","action":"deploy","cluster_name":"nebari-quickstart","gitops_path":"/Users/khuyentran/.nic/gitops/nebari-quickstart"}

Nothing says whether it's still working or when it will finish. After that, about 50 more JSON lines like these print before the final summary.

What to do instead: say up front how long it takes, and show readable progress steps:

Deploying Nebari locally. This takes about 2 minutes.

[1/4] Creating the local cluster...      done (25s)
[2/4] Installing Argo CD...              done
[3/4] Adding Nebi and Data Science...    done
[4/4] Waiting for the gateway...         done

⚠️ Extra boxes with steps users don't need

After the logs, two more boxes suggest port-forwarding and "DNS configuration", which quickstart users don't need:

═══════════════════════════════════════════════════════════════════════════════
  ARGO CD INSTALLED
═══════════════════════════════════════════════════════════════════════════════
  To access Argo CD:
    UI: https://argocd.nebari.lvh.me (after DNS configuration)
  Or use port-forwarding:
    kubectl port-forward svc/argocd-server -n argocd 8080:443
...
═══════════════════════════════════════════════════════════════════════════════
  KEYCLOAK INSTALLED
═══════════════════════════════════════════════════════════════════════════════
  It may take several minutes for Keycloak to be fully deployed and ready.
  Check deployment status:
    kubectl get pods -n keycloak
...

What to do instead: skip these boxes in nic quickstart.

⚠️ Asks for an /etc/hosts edit that isn't needed

It tells you to add nebari.lvh.me to /etc/hosts. Most quickstart users keep this default domain, which already points to your machine, so the edit isn't needed.

═══════════════════════════════════════════════════════════════════════════════
  HOSTS FILE CONFIGURATION REQUIRED
═══════════════════════════════════════════════════════════════════════════════

  The platform is published on host ports of 127.0.0.1.
  Point the platform hostnames at it by adding this line to /etc/hosts:

    127.0.0.1 nebari.lvh.me keycloak.nebari.lvh.me argocd.nebari.lvh.me

  Then open https://nebari.lvh.me in your browser.

What to do instead: skip this box unless the user passes a custom --domain.

✅ Helpful summary

I like that the command ends with the URLs and the next commands to run, so users know where to go next:

  ArgoCD is installing the software packs. This takes several minutes.
  Watch progress with:

    kubectl get applications -n argocd

  Once they are healthy:

    Landing page: https://nebari.lvh.me
    JupyterHub:   https://hub.nebari.lvh.me
    Nebi:         https://nebi.nebari.lvh.me

  Sign-in credentials:

    nic outputs --show-secrets

  To delete the cluster:

    nic destroy

2. Check that the apps are ready

kubectl get applications -n argocd

⚠️ The initial state is confusing

Right after deploy, this command shows almost every app as OutOfSync and Missing. It looks like the apps failed to install, and nothing says what to do next:

NAME                SYNC STATUS   HEALTH STATUS
cert-manager        OutOfSync     Missing
certificates        OutOfSync     Missing
cloudnative-pg
cluster-issuers     OutOfSync     Missing
data-science-pack   OutOfSync     Missing
envoy-gateway       OutOfSync     Missing
gateway-config      OutOfSync     Missing
httproutes          OutOfSync     Missing
nebari-root         OutOfSync     Healthy
nebi-pack           OutOfSync     Missing

This is because Argo CD hasn't created the apps yet. They turn Healthy after about 10 minutes:

Apps after about 10 minutes
NAME                      SYNC STATUS   HEALTH STATUS
cert-manager              Synced        Healthy
certificates              Synced        Healthy
cloudnative-pg            Synced        Healthy
cluster-issuers           Synced        Healthy
data-science-pack         Synced        Healthy
envoy-gateway             Synced        Healthy
gateway-config            OutOfSync     Healthy
httproutes                OutOfSync     Healthy
keycloak                  Synced        Healthy
nebari-landingpage        Synced        Healthy
nebari-operator           Synced        Healthy
nebari-root               Synced        Healthy
nebi-pack                 Synced        Healthy
opentelemetry-collector   Synced        Healthy
trust-bundle              Synced        Healthy
trust-manager             Synced        Healthy

What to do instead: warn users in the summary that this is expected:

  ArgoCD is installing the software packs. This takes about 10 minutes.
  Apps show Missing or Degraded until then. This is normal.

✅ Packs install automatically

It is nice that the packs are now installed automatically. nebi-pack and data-science-pack turn Healthy with the rest of the apps, with no extra step.

⚠️ Two base apps never sync

These stay OutOfSync even after everything else is Healthy:

⚠️ Two base apps never sync

These stay OutOfSync even after everything else is Healthy:

gateway-config            OutOfSync     Healthy
httproutes                OutOfSync     Healthy

What to do instead: the root cause is tracked in #513 (httproutes) and #484 (gateway-config). For now, the quickstart summary could mention that these two apps show OutOfSync, and that this is expected.

3. Get the sign-in password

nic outputs --show-secrets

⚠️ Log line and no usernames

A JSON log line prints before the table, and the table shows passwords but no usernames. The landing page takes admin with the realm admin password, but nothing says so:

{"time":"2026-11-19T15:08:26.531504-06:00","level":"INFO","msg":"Retrieved kubeconfig for kind cluster nebari-quickstart","resource":"provider","action":"get-kubeconfig","cluster_name":"nebari-quickstart","kube_context":"kind-nebari-quickstart"}
Domain                         nebari.lvh.me
Keycloak issuer URL            https://keycloak.nebari.lvh.me
Gateway address                127.0.0.1
Keycloak admin password        <password>
Keycloak realm admin password  <password>   <- this one, with username "admin"
Argo CD admin password         <password>

What to do instead: hide the log line, and show the landing-page sign-in first:

  Sign in to the landing page:

    Username: admin
    Password: <realm admin password>

  Admin credentials:

    Keycloak admin password        <password>
    Argo CD admin password         <password>

4. Open the landing page

https://nebari.lvh.me

⚠️ Certificate warning

The browser warns on each subdomain, and the summary doesn't mention it:

Your connection is not private
NET::ERR_CERT_AUTHORITY_INVALID

What to do instead: add a line to the summary:

  Your browser will warn that the certificate isn't trusted. This is expected
  for a local cluster. Click "Advanced", then "Proceed".

✅ Apps ready on the landing page

It is nice that JupyterHub and Nebi are launched for you, so the landing page is no longer empty after signing in:

landing-page

5. Open JupyterHub and Nebi

⚠️ Extra "Authorize access" page

Opening JupyterHub first shows a page asking whether "japps" can identify you. A data scientist won't know what "japps" is, or whether it's safe to click:

jupyterhub-authorize

What to do instead: pre-authorize the japps service, so users go straight to the JupyterHub home page.

✅ JupyterLab starts in under a minute

After clicking Start on "Small Instance (1 CPU / 2 GB RAM)", JupyterLab was ready in a few seconds, with Notebook, Terminal, Nebi, and VS Code in the Launcher:

jupyterlab

✅ Nebi works

Nebi opens to its Workspaces page, ready to create the first environment:

nebi-workspaces

@dcmcand dcmcand left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: Request changes. The quickstart experience is in good shape after the latest commits, but where the packs live and how they get there need to change before we merge.

🛑 Blocker: internal/quickstart has no tests for RenderConfig, writeQuickstartConfig or InstallPacks.
Add table-driven tests that render each port combination through config.ParseConfig, and cover the existing, identical, different and --force cases for the config write.
Nothing in CI renders config.yaml.tmpl, so a template change that breaks the generated config ships silently.

💡 Suggestion: docs/design-doc/architecture/02-system-overview.md:100 lists the CLI subcommands but not quickstart.
Add quickstart to that list.

Follow-ups from the test report

Item Status
Extra Argo CD / Keycloak boxes Fixed in 7ddcfde
/etc/hosts box on the default domain Fixed in 3d1f505
Confusing OutOfSync / Missing state Fixed in 1ba1a5d
Certificate warning Fixed in c8cd19c
Log readability Deferred to #66
nic outputs log line and missing usernames No issue opened yet
jhub-apps "Authorize access" page No data-science-pack issue opened yet

Key: 🛑 Blocker (must fix before merge) · 💡 Suggestion (improvement, not blocking) · ❓ Question (needs author input) · ❤️ Kudos

Comment thread internal/quickstart/quickstart.go Resolved
return err
}

repoDir := config.DefaultLocalRepositoryPath(cfg.ProjectName)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Blocker: The CLI rebuilds the repo path with DefaultLocalRepositoryPath and drives the git client itself, so it ignores repository.local.path and branch.
Move the pack write, commit and refresh into pkg/nic, for example through a DeployOptions field for extra GitOps files.
ADR-0015 says pkg/nic is the only bridge between the repository contract and the git client. Library callers of Deploy also can't get the packs or the refresh today.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see your point here, but I don't think DeployOption should be a vehicle to pass arbitrary stuff around Deploy.

That aside, this is making me think deeper into what NIC should and shouldn't own. Initially, when looking at this, I was tempted to tell you we should defer this until we have a nic pack add subcommand or something similar (like an AddApps function in pkg/nic), and then we could reuse that code to add the software packs in the quickstart. But after thinking more about it, I don't think NIC should really handle the addition of software packs to the GitOps repo (with the exception, of course, of the quickstart, which is meant to just work out of the box). That should be the user's responsibility. I'm still not even fully convinced NIC should commit the manifests for other things after the bootstrap but it's probably the most convenient approach.

What do you think about using the Kubernetes API directly to apply the ArgoCD Applications? I faced this same dilemma yesterday on nebari-dev/deploy-nebari-action#49 and ended up using plain kubectl to add the software packs in CI. I know this is different because it's a quickstart that the user interacts too, but it's also ephemeral I guess and I'm not sure if we expect users to interact with the local gitops repo anyways. If we do, you also raised a good point here. I'm leaning towards having the quickstart just install the packs directly for now and avoid relying on the local gitops repo for that. Curious to read your thoughts.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, apply them directly. Only the registration of the Applications becomes imperative. Argo still syncs the packs from pinned chart versions under nebari-apps, with self-heal and retry. And on a throwaway cluster, nobody needs Argo to restore a deleted Application. It also settles the rerun-overwrite question and the apps/ placement, since nothing gets written to the repo.

A few conditions to keep it bounded:

  • Keep the apply in internal/quickstart, with no Kubernetes apply path in pkg/nic, so quickstart doesn't grow a second way to install software.
  • Use server-side apply, so a rerun converges instead of failing or overwriting.
  • Keep project: nebari-apps, so the packs still go through the same project scoping as user packs.
  • Say in the summary that the packs were applied directly, and point to how to commit them to a GitOps repo. The "This file is yours: edit it" headers need to change to match.

Separately, the tests from my review still stand: RenderConfig, writeQuickstartConfig and whatever replaces InstallPacks need coverage either way.

project: nebari-apps
source:
repoURL: https://github.com/nebari-dev/nebi-pack
targetRevision: org-ca-bundle-key

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Blocker: targetRevision points at the org-ca-bundle-key branch, so a released binary deploys whatever that branch holds.
Pin a released chart version once nebari-dev/nebi-pack#61 ships.
Released nebi-pack charts hardcode the ca-bundle.crt key, and nebari-trust-bundle only has ca-certificates.crt. So this can't simply move to 0.1.4 before #61 merges.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 70a663b

source:
repoURL: https://raw.githubusercontent.com/nebari-dev/helm-repository/gh-pages/
chart: nebari-data-science-pack
targetRevision: 0.1.7

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Question: Do we want NIC to ship curated pack manifests in the binary?
These templates carry chart versions, hub volumes copied from the chart's values.yaml, and workarounds, so every chart change needs a NIC release. #752 asks for curated sets, so we need to work out whether this is the short-term step and what replaces it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good question and one that will need a discussion beyond this thread. In the short term, I think embedding these templates in the binary is the most pragmatic approach. Most of what’s hardcoded in them is workarounds to make things work out of the box. Some need fixing in the corresponding packs, such as the client ID override, which is tracked in data-science-pack#248, and I’ll file the hub trust bundle ones. Others get simpler once the pack contract lands, since a bundle that is guaranteed on every cluster lets packs mount it as required.

Longer term, I think we should rely on curated sets published as versioned artifacts in another repo and pulled at deploy time, with each NIC release pinning a specif version by default.

ctx, cleanup := nic.StartSlogHandler(ctx, slog.Default())
defer cleanup()

result, err := client.Deploy(ctx, cfg, nic.DeployOptions{})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Suggestion: If Argo CD fails to install, Deploy still returns success, and quickstart writes the packs and exits 0.
Check result.ArgoCDInstalled and return an error before InstallPacks.
pkg/nic/deploy.go only logs a warning when the Argo CD install fails.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Addressed in e7f6db9

return fmt.Errorf("open GitOps repository: %w", err)
}

for name, content := range packs {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Question: Should re-running quickstart reset the packs?
Today a rerun overwrites edits to the pack files and re-creates a deleted pack. Commit also stages everything (AddOptions{All: true}), so unrelated changes get committed as "Add quickstart software packs".

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair question. This might not make sense depending where we head on #767 (comment), but I added a check to skip writing the files if they exist already. That way we don't overwrite changes made by the user. See cc0bc95

Comment thread internal/cli/quickstart.go Outdated
fmt.Println(" WARNING: YOUR BROWSER CAN'T REACH THE PLATFORM YET")
fmt.Println("═══════════════════════════════════════════════════════════════════════════════")
fmt.Println()
if cfg.Domain == quickstart.DefaultDomain {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Suggestion: On the default domain, any lookup failure prints "although it does through public DNS", including an offline machine or the 3s timeout.
Pass the lookup error to printDNSWarning. Use the resolver wording only when the answer came back without a loopback address.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in b321e2b

Comment thread internal/cli/deploy.go Outdated
}

// printDeployResult prints the post-deploy access instructions.
func printDeployResult(cfg *config.NebariConfig, result *nic.DeployResult, dryRun bool) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Suggestion: Since 7ddcfde, runDeploy is the only caller of printDeployResult, so the extraction is now a no-op move.
Revert the deploy.go change to keep the PR to quickstart.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted in 5393666

Comment thread internal/quickstart/quickstart_test.go Resolved
Comment thread internal/quickstart/dns.go Resolved
@marcelovilla
marcelovilla force-pushed the quickstart-poc branch 2 times, most recently from a86a686 to cc0bc95 Compare November 25, 2026 14:53
@marcelovilla marcelovilla removed the status: blocked ⛔️ Another task is blocking this item label Nov 25, 2026
@marcelovilla

Copy link
Copy Markdown
Member Author

Thanks for the review @dcmcand. I answered your comments and addressed most of them. There's on in particular where I would like your input: #767 (comment)

Regarding the blocker you added in the general review:

🛑 Blocker: internal/quickstart has no tests for RenderConfig, writeQuickstartConfig or InstallPacks.

Added the tests in 80c5ecb

@marcelovilla
marcelovilla requested a review from dcmcand November 25, 2026 15:18

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a nic quickstart command that picks packs by persona

3 participants