apiVersion: apps/v1 kind: Deployment metadata: name: openclaw namespace: openclaw labels: app.kubernetes.io/name: openclaw spec: replicas: 1 selector: matchLabels: app.kubernetes.io/name: openclaw template: metadata: labels: app.kubernetes.io/name: openclaw spec: serviceAccountName: openclaw # First-run bootstrap: # `openclaw` with no args just prints help and exits. # We run a one-time, non-interactive initializer to create the state dir + config on the PVC. initContainers: - name: openclaw-setup image: default-route-openshift-image-registry.apps.lab.apilab.us/openclaw/openclaw:latest imagePullPolicy: Always env: - name: HOME value: /home/node - name: NPM_CONFIG_CACHE value: /tmp/npm-cache - name: XDG_CACHE_HOME value: /tmp command: ["/bin/sh","-lc"] args: - | set -eu mkdir -p /home/node if [ ! -f /home/node/.openclaw/openclaw.json ]; then echo "No openclaw config found; running 'openclaw setup'..." openclaw setup else echo "openclaw config already present; skipping setup." fi volumeMounts: - name: home mountPath: /home/node - name: tmp mountPath: /tmp containers: - name: openclaw image: default-route-openshift-image-registry.apps.lab.apilab.us/openclaw/openclaw:latest imagePullPolicy: Always # Run the Gateway daemon in-cluster. command: ["openclaw"] args: ["gateway","--port","18789","--bind","0.0.0.0"] ports: - name: http containerPort: 18789 env: - name: HOME value: /home/node - name: NPM_CONFIG_CACHE value: /tmp/npm-cache - name: XDG_CACHE_HOME value: /tmp volumeMounts: - name: home mountPath: /home/node - name: tmp mountPath: /tmp volumes: - name: home persistentVolumeClaim: claimName: openclaw-home - name: tmp emptyDir: {}