fix: copy ConfigMap to PVC on startup so Hermes config is writable

This commit is contained in:
Hermes Agent 2026-05-06 03:07:30 +00:00
parent 4e9ed1fa2d
commit 8b6edd3c6a
2 changed files with 12 additions and 6 deletions

View file

@ -21,6 +21,8 @@ spec:
- |
# Make `hermes` CLI instantly available when you exec in
ln -sf /opt/hermes/.venv/bin/hermes /usr/local/bin/hermes 2>/dev/null || true
# Copy config from ConfigMap (read-only mount) into PVC so Hermes can modify it
cp -f /etc/hermes/config.yaml /opt/data/config.yaml || true
echo "Hermes Agent starting (Telegram polling + full config persistence)..."
exec hermes gateway run
env:
@ -62,9 +64,10 @@ spec:
volumeMounts:
- name: hermes-data
mountPath: /opt/data
- name: hermes-config
mountPath: /opt/data/config.yaml
- name: hermes-configmap
mountPath: /etc/hermes/config.yaml
subPath: config.yaml
readOnly: true
resources:
requests:
memory: 2Gi
@ -73,7 +76,7 @@ spec:
memory: 4Gi
cpu: "2"
volumes:
- name: hermes-config
- name: hermes-configmap
configMap:
name: hermes-config
- name: hermes-data

View file

@ -22,6 +22,8 @@ spec:
- |
# Make `hermes` CLI instantly available when you exec in
ln -sf /opt/hermes/.venv/bin/hermes /usr/local/bin/hermes 2>/dev/null || true
# Copy config from ConfigMap (read-only mount) into PVC so Hermes can modify it
cp -f /etc/hermes/config.yaml /opt/data/config.yaml || true
echo "Hermes Agent starting (Telegram polling + full config persistence)..."
exec hermes gateway run
env:
@ -63,9 +65,10 @@ spec:
volumeMounts:
- name: hermes-data
mountPath: /opt/data
- name: hermes-config
mountPath: /opt/data/config.yaml
- name: hermes-configmap
mountPath: /etc/hermes/config.yaml
subPath: config.yaml
readOnly: true
resources:
requests:
memory: 2Gi
@ -77,7 +80,7 @@ spec:
- name: hermes-data
persistentVolumeClaim:
claimName: rays-hermes-agent-pvc
- name: hermes-config
- name: hermes-configmap
configMap:
name: hermes-config
---