gcloud-lab/apps/base/customer1/openclaw/deployment.yaml

119 lines
3.1 KiB
YAML
Raw Normal View History

2026-04-18 02:56:18 +00:00
apiVersion: apps/v1
kind: Deployment
metadata:
2026-04-24 00:33:26 +00:00
namespace: customer1
2026-04-18 02:56:18 +00:00
name: openclaw
labels:
app: openclaw
spec:
replicas: 1
selector:
matchLabels:
app: openclaw
strategy:
type: Recreate
template:
metadata:
labels:
app: openclaw
spec:
automountServiceAccountToken: false
securityContext:
2026-04-24 00:33:26 +00:00
fsGroup: 1000 # This helps chown files created by rootfs
2026-04-18 02:56:18 +00:00
seccompProfile:
type: RuntimeDefault
2026-04-24 00:33:26 +00:00
2026-04-18 02:56:18 +00:00
initContainers:
2026-04-24 00:33:26 +00:00
- name: init-home
2026-04-18 02:56:18 +00:00
image: busybox:1.37
imagePullPolicy: IfNotPresent
command:
- sh
- -c
- |
2026-04-24 00:20:57 +00:00
mkdir -p /home/node/.npm /home/node/.openclaw/workspace
2026-04-24 00:33:26 +00:00
# No chown needed — fsGroup + our UID will handle it
echo "✅ Home directories created"
2026-04-18 02:56:18 +00:00
securityContext:
2026-04-24 00:33:26 +00:00
runAsUser: 1000 # Non-root
runAsGroup: 1000
2026-04-18 02:56:18 +00:00
volumeMounts:
2026-04-24 00:33:26 +00:00
- name: openclaw-home-new
mountPath: /home/node
2026-04-24 00:29:06 +00:00
- name: init-config
image: busybox:1.37
imagePullPolicy: IfNotPresent
command:
- sh
- -c
- |
cp /config/openclaw.json /home/node/.openclaw/openclaw.json
cp /config/AGENTS.md /home/node/.openclaw/workspace/AGENTS.md || true
echo "✅ Config copied"
securityContext:
2026-04-24 00:33:26 +00:00
runAsUser: 1000
runAsGroup: 1000
2026-04-24 00:29:06 +00:00
volumeMounts:
- name: openclaw-home-new
2026-04-24 00:33:26 +00:00
mountPath: /home/node
2026-04-24 00:29:06 +00:00
- name: config
mountPath: /config
2026-04-24 00:33:26 +00:00
2026-04-18 02:56:18 +00:00
containers:
- name: gateway
2026-04-20 01:52:50 +00:00
image: ghcr.io/openclaw/openclaw:slim
2026-04-18 02:56:18 +00:00
imagePullPolicy: IfNotPresent
command:
- node
- /app/dist/index.js
- gateway
- run
env:
- name: HOME
value: /home/node
- name: OPENCLAW_CONFIG_DIR
value: /home/node/.openclaw
- name: NODE_ENV
value: production
2026-04-24 00:33:26 +00:00
# your secrets ...
# Force npm cache to a writable location
- name: NPM_CONFIG_CACHE
value: /tmp/.npm
2026-04-18 02:56:18 +00:00
resources:
requests:
2026-04-18 04:18:31 +00:00
memory: 2Gi
2026-04-19 22:18:59 +00:00
cpu: "1"
2026-04-18 02:56:18 +00:00
limits:
2026-04-18 04:18:31 +00:00
memory: 6Gi
2026-04-19 22:18:59 +00:00
cpu: "4"
2026-04-24 00:33:26 +00:00
2026-04-18 02:56:18 +00:00
securityContext:
runAsNonRoot: true
2026-04-24 00:33:26 +00:00
runAsUser: 1000
runAsGroup: 1000
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
2026-04-18 02:56:18 +00:00
capabilities:
drop:
- ALL
2026-04-24 00:33:26 +00:00
volumeMounts:
- name: openclaw-home-new
mountPath: /home/node
- name: tmp-volume
mountPath: /tmp
2026-04-18 02:56:18 +00:00
volumes:
2026-04-23 23:49:36 +00:00
- name: openclaw-home-new
2026-04-18 02:56:18 +00:00
persistentVolumeClaim:
2026-04-23 23:49:36 +00:00
claimName: openclaw-home-new-pvc
2026-04-18 02:56:18 +00:00
- name: config
configMap:
name: openclaw-config
- name: tmp-volume
2026-04-24 00:33:26 +00:00
emptyDir:
medium: Memory