# kubernetes.yml

Source: https://zshot-cli.com/reference/docker/files/kubernetes/
Markdown: https://zshot-cli.com/reference/docker/files/kubernetes/index.md
Section: [Reference](https://zshot-cli.com/reference/) › [Docker](https://zshot-cli.com/reference/docker/) › [Files](https://zshot-cli.com/reference/docker/files/)

The [Kubernetes](/reference/docker/kubernetes) Deployment and Service for `scaleassembly/zshot-server`. Create its `zshot-license` Secret before applying it.

Download: https://zshot-cli.com/deploy/kubernetes.yml

```yaml
# zshot server on Kubernetes with Chromium's sandbox on.
#
#   1. kubectl create secret generic zshot-license --from-literal=ZSHOT_LICENSE=YOUR-KEY
#      Add --from-literal=ZSHOT_SERVER_TOKEN_AUTH=YOUR-TOKEN to require a bearer token.
#   2. kubectl apply -f kubernetes.yml
#
# The pod runs with no seccomp filter, so the sandbox starts; RuntimeDefault
# blocks it. A namespace enforcing the restricted Pod Security Standard needs
# zshot-seccomp.json on each node as a Localhost profile instead.
apiVersion: apps/v1
kind: Deployment
metadata:
  name: zshot
  labels:
    app: zshot
spec:
  replicas: 1
  selector:
    matchLabels:
      app: zshot
  template:
    metadata:
      labels:
        app: zshot
    spec:
      securityContext:
        runAsNonRoot: true
        runAsUser: 1000
        runAsGroup: 1000
      containers:
        - name: zshot
          image: scaleassembly/zshot-server:0.49.1
          ports:
            - name: http
              containerPort: 3000
          envFrom:
            - secretRef:
                name: zshot-license
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop: [ALL]
            readOnlyRootFilesystem: true
          volumeMounts:
            - name: tmp
              mountPath: /tmp
          # Memory and concurrency are in tension: every concurrent render is a
          # browser instance, and video renders need the most. Your workload sets
          # the requirement. See https://zshot-cli.com/reference/flags/server/server-max-concurrency/
          # for sizing per slot.
          resources:
            requests:
              cpu: 500m
              memory: 1Gi
            limits:
              memory: 2Gi
          readinessProbe:
            httpGet:
              path: /status
              port: http
            periodSeconds: 5
          livenessProbe:
            httpGet:
              path: /status
              port: http
            initialDelaySeconds: 30
            periodSeconds: 30
      volumes:
        - name: tmp
          emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
  name: zshot
spec:
  selector:
    app: zshot
  ports:
    - port: 3000
      targetPort: http
```

## Related

Topics:

- [Kubernetes](https://zshot-cli.com/reference/docker/kubernetes/) — Deploying it
- [Raw file](https://zshot-cli.com/deploy/kubernetes.yml)

## Navigation

- [Examples](https://zshot-cli.com/examples/)
- [Download](https://zshot-cli.com/download/)
- [Purchase](https://zshot-cli.com/purchase/)
- [Reference](https://zshot-cli.com/reference/)
  - [Formats](https://zshot-cli.com/reference/formats/)
  - [Flags](https://zshot-cli.com/reference/flags/)
  - [Agents](https://zshot-cli.com/reference/agents/)
  - [Configuration](https://zshot-cli.com/reference/configuration/)
  - [Crawling](https://zshot-cli.com/reference/crawling/)
  - [Docker](https://zshot-cli.com/reference/docker/)
    - [Environment](https://zshot-cli.com/reference/docker/environment/)
    - [Hardening](https://zshot-cli.com/reference/docker/hardening/)
    - [Kubernetes](https://zshot-cli.com/reference/docker/kubernetes/)
    - [Railway](https://zshot-cli.com/reference/docker/railway/)
    - [Files](https://zshot-cli.com/reference/docker/files/)
      - [docker-compose.yml](https://zshot-cli.com/reference/docker/files/docker-compose/)
      - [zshot-seccomp.json](https://zshot-cli.com/reference/docker/files/zshot-seccomp/)
      - **kubernetes.yml**
  - [Exit Codes](https://zshot-cli.com/reference/exit_codes/)
  - [Linux](https://zshot-cli.com/reference/linux/)
  - [LLM Connections](https://zshot-cli.com/reference/llm_connections/)
  - [LLM Formatting](https://zshot-cli.com/reference/llm_formatting/)
  - [Local Inputs](https://zshot-cli.com/reference/inputs/)
  - [Navigator](https://zshot-cli.com/reference/navigator/)
  - [Security](https://zshot-cli.com/reference/security/)
  - [Server](https://zshot-cli.com/reference/server/)
  - [Shell completions](https://zshot-cli.com/reference/shell_completions/)
  - [Storage](https://zshot-cli.com/reference/storage/)
  - [Timeouts](https://zshot-cli.com/reference/timeouts/)
  - [Web Bot Auth](https://zshot-cli.com/reference/web_bot_auth/)
- [Support](https://zshot-cli.com/support/)
- [Changelog](https://zshot-cli.com/changelog/)

Site index: https://zshot-cli.com/llms.txt

