deploy: initContainer openclaw setup + run gateway as command
This commit is contained in:
@@ -16,27 +16,61 @@ spec:
|
||||
app.kubernetes.io/name: openclaw
|
||||
spec:
|
||||
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
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 18789
|
||||
env:
|
||||
# Keep caches out of $HOME under restricted SCC
|
||||
- name: HOME
|
||||
value: /home/node
|
||||
- name: NPM_CONFIG_CACHE
|
||||
value: /tmp/npm-cache
|
||||
- name: XDG_CACHE_HOME
|
||||
value: /tmp
|
||||
# OpenClaw docs default to /home/node in containers; persist it.
|
||||
- name: HOME
|
||||
value: /home/node
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user