deploy: initContainer openclaw setup + run gateway as command

This commit is contained in:
Clawdbot
2026-01-30 11:22:32 +00:00
parent 6cdaa1a0b9
commit a66bad33e2

View File

@@ -16,27 +16,61 @@ spec:
app.kubernetes.io/name: openclaw app.kubernetes.io/name: openclaw
spec: spec:
serviceAccountName: openclaw serviceAccountName: openclaw
containers:
- name: 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 image: default-route-openshift-image-registry.apps.lab.apilab.us/openclaw/openclaw:latest
imagePullPolicy: Always imagePullPolicy: Always
ports:
- name: http
containerPort: 18789
env: env:
# Keep caches out of $HOME under restricted SCC - name: HOME
value: /home/node
- name: NPM_CONFIG_CACHE - name: NPM_CONFIG_CACHE
value: /tmp/npm-cache value: /tmp/npm-cache
- name: XDG_CACHE_HOME - name: XDG_CACHE_HOME
value: /tmp value: /tmp
# OpenClaw docs default to /home/node in containers; persist it. command: ["/bin/sh","-lc"]
- name: HOME args:
value: /home/node - |
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: volumeMounts:
- name: home - name: home
mountPath: /home/node mountPath: /home/node
- name: tmp - name: tmp
mountPath: /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: volumes:
- name: home - name: home
persistentVolumeClaim: persistentVolumeClaim: