Kubernetes Deployment

Advanced ⏱ 60 minutes 📅 Updated Feb 2026

Enterprise-grade Kubernetes deployment with auto-scaling, load balancing, and high availability.

📋 Prerequisites

1

Create Namespace

yaml
# namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
  name: openclaw
  labels:
    app: openclaw
bash
kubectl apply -f namespace.yaml
2

Create Secrets

bash
kubectl create secret generic openclaw-secrets \
  --namespace openclaw \
  --from-literal=openai-api-key='your-openai-api-key'
3

Create Deployment

yaml
# deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: openclaw
  namespace: openclaw
  labels:
    app: openclaw
spec:
  replicas: 2
  selector:
    matchLabels:
      app: openclaw
  template:
    metadata:
      labels:
        app: openclaw
    spec:
      containers:
      - name: openclaw
        image: openclaw/openclaw:latest
        ports:
        - containerPort: 8080
        env:
        - name: OPENAI_API_KEY
          valueFrom:
            secretKeyRef:
              name: openclaw-secrets
              key: openai-api-key
        resources:
          requests:
            memory: "512Mi"
            cpu: "250m"
          limits:
            memory: "1Gi"
            cpu: "500m"
        livenessProbe:
          httpGet:
            path: /health
            port: 8080
          initialDelaySeconds: 30
          periodSeconds: 10
        readinessProbe:
          httpGet:
            path: /health
            port: 8080
          initialDelaySeconds: 5
          periodSeconds: 5
        volumeMounts:
        - name: data
          mountPath: /root/.openclaw
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: openclaw-pvc
4

Create Service

yaml
# service.yaml
apiVersion: v1
kind: Service
metadata:
  name: openclaw
  namespace: openclaw
spec:
  selector:
    app: openclaw
  ports:
  - port: 80
    targetPort: 8080
  type: ClusterIP
5

Create Ingress (with SSL)

yaml
# ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: openclaw
  namespace: openclaw
  annotations:
    kubernetes.io/ingress.class: nginx
    cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
  tls:
  - hosts:
    - openclaw.yourdomain.com
    secretName: openclaw-tls
  rules:
  - host: openclaw.yourdomain.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: openclaw
            port:
              number: 80

Apply All Resources

bash
kubectl apply -f namespace.yaml
kubectl apply -f deployment.yaml
kubectl apply -f service.yaml
kubectl apply -f ingress.yaml

# Check status
kubectl get pods -n openclaw
kubectl get svc -n openclaw
Kubernetes

Enterprise Ready!

openclaw.ai is now running on Kubernetes with auto-scaling and high availability.