Welcome, Kubernetes & NRP Architecture

Teaching: 40 min · Exercises: 0 min · Total: 40 min

Launch the workspace in JupyterHub

▶ Launch the workspace in JupyterHub — signs you in at jh-training.nrp-nautilus.io, pulls the tutorial workspace, and opens JupyterLab on the training GPU nodes.

Intro slides

PEARC26 Intro Slides
1/17
PEARC26 Intro Slides page 1

Session 1 · 40 min

Welcome to Kubernetes for AI-Enabled Scientific Research Computing, and Education at PEARC26. This full-day tutorial takes you from the concept of batch-oriented HPC to the practical use of service-oriented, Kubernetes-managed resources on the National Research Platform (NRP) — interactive AI notebooks, LLM services, GPU workloads, and course-scale JupyterHub deployments.

Run all commands from a JupyterHub terminal unless noted otherwise. Command blocks are formatted for copy/paste into that terminal.

Schedule — full day at a glance

6 hours of material, plus a morning coffee break, a lunch, and an afternoon coffee break at fixed times. For the hands-on you work in the shared nrp-training-k8s namespace, plus your own nrp-training-NNN namespace (claimed below) for the JupyterHub capstone. The last hour helps you set up your own NRP access to keep going after PEARC.

Session lengths below are approximate — the three breaks are the only fixed clock times in the day.

DurationSession
40 minWelcome, claim your namespace, Kubernetes & NRP architecture (this episode)
70 minBasic Docker & Kubernetes hands-on
30 min (10:30 – 11:00 a.m.)Coffee break
50 minAI & computational science applications
30 minPersistent storage & I/O for AI/scientific workloads
60 min (12:30 – 1:30 p.m.)Lunch
40 minJupyterHub on NRP
70 minAdvanced: custom JupyterHub & building images in NRP GitLab
30 min (3:00 – 3:30 p.m.)Coffee break
60 minGet your own NRP access + wrap-up / Q&A

Claim your namespace for the day

You'll do most exercises in the shared nrp-training-k8s namespace, but the final JupyterHub capstone needs a namespace of your own. One curl — to a small claim service running inside the cluster — reserves one of the pre-created nrp-training-NNN namespaces and remembers it's yours. Ask by your hub login and you get the same slot back every time:

Bash
curl -s "http://nrp-claim.nrp-training.svc.cluster.local/claim?user=${JUPYTERHUB_USER:-$NRP_USER}"
Expected output
text
nrp-training-042

Jot down the number — Episode 6 claims it again automatically (the curl is idempotent), so there's nothing to remember, but it's yours for the day.

The National Research Platform

The National Research Platform (NRP) is a partnership of 50+ institutions providing an open, nationally distributed cyberinfrastructure built on a Kubernetes cluster named Nautilus — 500+ nodes, 1500+ GPUs (NVIDIA A10/A100/H100, Qualcomm Cloud AI 100 Ultra), 50+ FPGAs, in continuous operation for over six years. Researchers and educators access it via Kubernetes namespaces, with persistent storage on Ceph and shared services for JupyterHub, GitLab, Coder, and S3.

The core mental model:

  1. CILogon authenticates users through institutional identity providers.
  2. JupyterHub gives each participant a browser-based JupyterLab workspace and terminal.
  3. Kubernetes namespaces isolate class or project workloads.
  4. YAML manifests describe the compute resources a workload needs.
  5. Device plugins expose accelerators such as NVIDIA GPUs (nvidia.com/gpu) and Qualcomm Cloud AI 100 SoCs (qualcomm.com/qaic) to Kubernetes.
NRP dashboard Nautilus Kubernetes cluster map

Capabilities and scale

Useful links for the live session:

How users interact with NRP

Top uses of NRP

The majority of NRP users interact with the cluster in three ways:

Today you will use JupyterHub as the front door and drive Kubernetes from its terminal.

Kubernetes basics (quick intro)

Kubernetes is a system for running applications on a cluster by managing workloads (things you want to run) and keeping them in the desired state.

Most interactions with Kubernetes involve creating and updating resources (objects) described in YAML.

Typical workflow:

  1. Write or edit a YAML manifest.
  2. Apply it to the cluster (kubectl apply -f ...).
  3. Check status and troubleshoot (pods, logs, events).

Kubernetes workloads

Rule of thumb:

Hardware acceleration

Kubernetes requires specialized extensions to manage and assign non-CPU hardware.

Keep in mind

Docker and containers

Docker is a tool for building and running containers. A container image packages your application code, its libraries and dependencies, and enough operating-system files to run consistently — the same image runs on your laptop, a VM, or a Kubernetes cluster.

Why Docker matters for Kubernetes: Kubernetes runs container images; it does not build them. You build an image (with Docker or CI/CD), a registry stores it, and Kubernetes pulls and runs it.

Container registries store and distribute images. Docker Hub is the public example; NRP GitLab provides a registry for your own images (public or private), and you can build images directly in GitLab CI/CD — the afternoon session does exactly that.

How to follow along — three ways

Every hands-on block in this tutorial can be driven three ways; pick what you like and switch anytime:

  1. Runnable notebooks (recommended). The workspace ships a notebooks/ folder with one notebook per episode — every command is a cell; Shift+Enter runs it. Cells execute in a persistent bash shell (the Bash kernel), so exports, cd, and variables carry from cell to cell. A ⚙️ setup cell at the top renders every manifest with your username filled in — no hand-editing <username>.
  2. Copy from this site. Hover any code block for a copy button, then paste into a JupyterLab terminal (File → New → Terminal).
  3. Console-on-markdown. In JupyterLab, right-click any lesson .md file → Create Console for Editor → pick the Bash kernel. Shift+Enter inside a code block runs it without leaving the file.

A few helpers as you go:

Commands marked 🖥️ Terminal step in the notebooks (kubectl exec -it, port-forward, -w watches) are interactive or long-running — run those in a terminal, not a cell.

Blocks shown as python are printed that way for readability, but the Bash-kernel notebook wraps them so they run as an ordinary cell — just Shift+Enter. To run one in a plain terminal instead, save it to a file and python3 file.py.

Getting a terminal with kubectl

Zero install — use the training JupyterHub

The tutorial hub at jh-training.nrp-nautilus.io is pre-configured: every spawned JupyterLab pod has kubectl and helm installed with a kubeconfig wired to the tutorial namespace. Open File → New → Terminal in JupyterLab and start running kubectl immediately.

Verify your access:

Bash
kubectl auth whoami
Bash
kubectl get pods -n nrp-training-k8s
Expected output
text
Username:   system:serviceaccount:nrp-training:jupyterhub-sa

The pod listing may be empty or show other participants' pods — both are fine.

Gatekeeper: why every example sets requests and limits

Nautilus runs a cluster-wide Gatekeeper policy that rejects pods that omit CPU or memory requests/limits, and rejects pods where the limit/request ratio exceeds 1.2×. Every YAML in this tutorial sets requests == limits so you never trip it. If you copy-paste a manifest from upstream Kubernetes docs and it gets rejected, this is almost always why.

Being a good citizen

NRP is a shared resource. Aim for pod utilization of GPU > 40%, CPU 20–200%, RAM 20–150% of the requested amount, and delete what you're not using. Live dashboards are on Grafana; the acceptable-use policy is at nrp.ai/documentation/userdocs/start/policies.

🧠 Quick check — before you move on
A pod you submitted is rejected with a Gatekeeper policy error. What is the most likely cause?
You need to fine-tune a model for about two hours and then stop. Which workload fits best?
Where does data survive after a pod terminates?
Who builds the container images that Kubernetes runs?
The same image runs identically on your laptop and on a cluster node. What makes that true?

Next up: hands-on Kubernetes — pods, storage, deployments, jobs, services, and your first GPU pod.