Deploying Your First App
This walkthrough deploys a simple web application to the cluster and makes it publicly accessible at a *.nstsdc.org URL.
Prerequisites
- SSH access to nst-n1
- Basic familiarity with
kubectl
What we will deploy
containous/whoami — a tiny HTTP server that responds with information about itself (hostname, IP, headers). It is the standard test image for verifying ingress routing.
Step 1: Create a namespace
Namespaces isolate workloads. Create one for your app:
kubectl create namespace appsIf the apps namespace already exists, this is fine — it will just tell you it already exists.
Step 2: Create a Deployment
A Deployment manages your application pods — how many replicas to run, which image to use, and how to update them.
kubectl -n apps create deployment whoami --image=containous/whoamiVerify the pod is running:
kubectl -n apps get podsYou should see something like:
NAME READY STATUS RESTARTS AGE
whoami-6b9f5d5897-abc12 1/1 Running 0 10sStep 3: Create a Service
A Service gives your deployment a stable internal address. Other things in the cluster (like Traefik) use the Service to reach your pods.
kubectl -n apps expose deployment whoami --port=80Verify:
kubectl -n apps get svc whoamiStep 4: Create an Ingress
The Ingress tells Traefik to route traffic for a specific hostname to your Service.
Create a file called whoami-ingress.yaml:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: whoami-ing
namespace: apps
spec:
ingressClassName: traefik
rules:
- host: whoami.nstsdc.org
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: whoami
port:
number: 80Apply it:
kubectl apply -f whoami-ingress.yamlStep 5: Test locally
Before testing from the internet, verify routing works on the node itself:
curl -i -H "Host: whoami.nstsdc.org" http://127.0.0.1You should see a 200 response with details about the whoami container.
Step 6: Test from the internet
Open your browser and visit:
http://whoami.nstsdc.orgThe request travels: your browser → Cloudflare → tunnel → nst-n1 → Traefik → whoami Service → whoami Pod.
What just happened
You created three Kubernetes resources:
- Deployment — runs one or more copies of your container image
- Service — provides a stable ClusterIP and DNS name for the deployment
- Ingress — maps an external hostname to the Service
This is the fundamental pattern for every HTTP app on the cluster. The hostname, image, and port change; the pattern stays the same.
Cleanup
To remove everything:
kubectl -n apps delete ingress whoami-ing
kubectl -n apps delete svc whoami
kubectl -n apps delete deployment whoami