Create Static Site

Deploy a static website from a Git repository.

Prerequisites

  • kup6s-pages operator running in cluster

  • Git repository with static files (HTML, CSS, JS)

  • Domain configured to point to cluster ingress

Basic Site (Public Repository)

Create a StaticSite resource in any namespace:

apiVersion: pages.kup6s.com/v1alpha1
kind: StaticSite
metadata:
  name: my-website
  namespace: my-namespace
spec:
  repo: https://github.com/user/my-website.git
  domain: www.example.com

Apply the manifest:

kubectl apply -f staticsite.yaml

Site with Build Output Subpath

For sites with build tools (Vite, Hugo, Sphinx) where output is in a subdirectory:

apiVersion: pages.kup6s.com/v1alpha1
kind: StaticSite
metadata:
  name: docs
  namespace: my-namespace
spec:
  repo: https://github.com/user/docs.git
  branch: main
  path: /dist          # Serve only the /dist directory
  domain: docs.example.com

The syncer clones to /sites/.repos/docs/ and creates a symlink /sites/docs//sites/.repos/docs/dist/.

Verify Deployment

Check the StaticSite status:

kubectl get staticsite my-website -n my-namespace -o yaml

Expected status when ready:

status:
  phase: Ready
  message: Site synced successfully
  lastSync: "2025-01-31T12:00:00Z"
  lastCommit: "abc1234"
  url: https://www.example.com

Troubleshooting

If the site is stuck in “Pending”:

# Check syncer logs
kubectl logs -n kup6s-pages -l app.kubernetes.io/component=syncer

# Check if IngressRoute was created
kubectl get ingressroute my-website -n my-namespace

See Troubleshoot for more common issues.