a73x

deploy/server/site-deployment.yaml

Ref:   Size: 1.2 KiB   History

# The static site: nginx over the built webroot, with the release artifacts
# baked in under /dl (scripts/site-image.sh stages dist/<version> into the image
# — there is no volume and nothing to upload afterwards).
#
# The site rolls BEFORE the server on every run. A server started ahead of its
# site fetches the boot manifest, finds the previous release, and pins that
# answer for 24 hours.
apiVersion: apps/v1
kind: Deployment
metadata:
  name: web
  namespace: ${NAMESPACE}
spec:
  replicas: 1
  selector:
    matchLabels: {app: web}
  template:
    metadata:
      labels: {app: web}
    spec:
      # The image is single-arch, so say which arch rather than discovering it
      # as a scheduling failure on a mixed cluster.
      nodeSelector:
        kubernetes.io/arch: ${IMAGE_ARCH}
      imagePullSecrets:
        - name: regcred
      containers:
        - name: web
          # By tag, like the server: see the note in deployment.yaml.
          image: ${SITE_IMAGE}:${TAG}
          imagePullPolicy: Always
          ports:
            - {name: http, containerPort: 8080}
          readinessProbe:
            httpGet: {path: /, port: 8080}
            periodSeconds: 10