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 # Make `hermes` CLI instantly available when you exec in
ln -sf /opt/hermes/.venv/bin/hermes /usr/local/bin/hermes 2>/dev/null || true 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)..." echo "Hermes Agent starting (Telegram polling + full config persistence)..."
exec hermes gateway run exec hermes gateway run
env: env:
@ -62,9 +64,10 @@ spec:
volumeMounts: volumeMounts:
- name: hermes-data - name: hermes-data
mountPath: /opt/data mountPath: /opt/data
- name: hermes-config - name: hermes-configmap
mountPath: /opt/data/config.yaml mountPath: /etc/hermes/config.yaml
subPath: config.yaml subPath: config.yaml
readOnly: true
resources: resources:
requests: requests:
memory: 2Gi memory: 2Gi
@ -73,7 +76,7 @@ spec:
memory: 4Gi memory: 4Gi
cpu: "2" cpu: "2"
volumes: volumes:
- name: hermes-config - name: hermes-configmap
configMap: configMap:
name: hermes-config name: hermes-config
- name: hermes-data - name: hermes-data

View file

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