Docs / Kubernetes & Orchestration / How to Deploy an Application on K3s

How to Deploy an Application on K3s

By Admin · Mar 1, 2026 · Updated Apr 23, 2026 · 21 views · 1 min read

Overview

Once K3s is running on your Breeze, deploying an application involves creating Kubernetes manifests for your Deployment and Service, then applying them with kubectl.

Step 1: Create a Deployment Manifest

Create a file called app-deployment.yaml:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: web-app
  namespace: default
spec:
  replicas: 2
  selector:
    matchLabels:
      app: web-app
  template:
    metadata:
      labels:
        app: web-app
    spec:
      containers:
        - name: web
          image: nginx:alpine
          ports:
            - containerPort: 80
          resources:
            requests:
              memory: "64Mi"
              cpu: "100m"
            limits:
              memory: "128Mi"
              cpu: "250m"

Step 2: Create a Service

Create app-service.yaml:

apiVersion: v1
kind: Service
metadata:
  name: web-app-svc
spec:
  selector:
    app: web-app
  ports:
    - port: 80
      targetPort: 80
  type: NodePort

Step 3: Apply and Verify

kubectl apply -f app-deployment.yaml
kubectl apply -f app-service.yaml
kubectl get pods -l app=web-app
kubectl get svc web-app-svc

Step 4: Access the Application

Find the assigned NodePort:

kubectl get svc web-app-svc -o jsonpath='{.spec.ports[0].nodePort}'

Visit http://your-breeze-ip:NODE_PORT in your browser.

Updating the Application

kubectl set image deployment/web-app web=nginx:1.25-alpine
kubectl rollout status deployment/web-app

K3s handles rolling updates automatically with zero downtime.

Was this article helpful?