183 lines
5.1 KiB
YAML
183 lines
5.1 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: hermes-agent
|
|
namespace: customer1
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: hermes-agent
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: hermes-agent
|
|
spec:
|
|
initContainers:
|
|
- name: fix-volume-permissions
|
|
image: busybox:latest
|
|
# Run a quick chown to give user 10000 and group 10000 full ownership
|
|
command: ["sh", "-c", "chown -R 10000:10000 /opt/data"]
|
|
securityContext:
|
|
runAsUser: 0 # Must run as root to change permissions
|
|
runAsNonRoot: false
|
|
volumeMounts:
|
|
- name: hermes-data
|
|
mountPath: /opt/data
|
|
containers:
|
|
- name: hermes-agent
|
|
image: nousresearch/hermes-agent:latest
|
|
securityContext:
|
|
runAsNonRoot: true
|
|
runAsUser: 10000
|
|
runAsGroup: 10000
|
|
allowPrivilegeEscalation: true
|
|
ports:
|
|
- containerPort: 8642
|
|
command: ["/bin/bash", "-c"]
|
|
|
|
args:
|
|
- |
|
|
# Make `hermes` CLI instantly available when you exec in
|
|
export PATH="/opt/hermes/.venv/bin:$PATH"
|
|
|
|
# Copy config from ConfigMap (read-only mount) into PVC so Hermes can modify it
|
|
cp -f /tmp/hermes/config.yaml /opt/data/config.yaml || true
|
|
|
|
echo "Hermes Agent starting (Telegram polling + full config persistence)..."
|
|
exec hermes gateway run
|
|
|
|
|
|
env:
|
|
- name: HERMES_HOME
|
|
value: "/opt/data"
|
|
|
|
- name: TELEGRAM_BOT_TOKEN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: hermes-secrets
|
|
key: TELEGRAM_BOT_TOKEN
|
|
|
|
- name: XAI_API_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: xai-apikey
|
|
key: XAI_API_KEY
|
|
|
|
- name: TELEGRAM_ALLOWED_USERS
|
|
value: "7528130947"
|
|
|
|
# === Local vLLM (OpenAI-compatible) ===
|
|
- name: OPENAI_BASE_URL
|
|
value: "http://openclaw-brain-service.customer1.svc.cluster.local:8000/v1" # ← adjust if your service name differs
|
|
|
|
- name: HERMES_MODEL_PROVIDER
|
|
value: xai
|
|
|
|
- name: HERMES_MODEL
|
|
value: grok-4.20-0309-reasoning
|
|
|
|
- name: OPENAI_API_KEY
|
|
value: "dummy" # vLLM ignores this
|
|
|
|
# === API Server (for external OpenAI-compatible clients) ===
|
|
- name: API_SERVER_ENABLED
|
|
value: "true"
|
|
- name: API_SERVER_HOST
|
|
value: "0.0.0.0"
|
|
- name: API_SERVER_PORT
|
|
value: "8642"
|
|
- name: API_SERVER_KEY
|
|
value: "change-me-make-me-secret" #(tailnet-only, private)
|
|
- name: API_SERVER_MODEL_NAME
|
|
value: "hermes-agent"
|
|
|
|
# === Optional ===
|
|
# - name: LOG_LEVEL
|
|
# value: "INFO"
|
|
volumeMounts:
|
|
- name: hermes-data
|
|
mountPath: /opt/data
|
|
- name: hermes-configmap
|
|
mountPath: /tmp/hermes/config.yaml
|
|
subPath: config.yaml
|
|
readOnly: true
|
|
|
|
resources:
|
|
requests:
|
|
memory: 2Gi
|
|
cpu: "1"
|
|
limits:
|
|
memory: 3Gi
|
|
cpu: "2"
|
|
|
|
- name: hermes-webui
|
|
image: ghcr.io/nesquena/hermes-webui:latest
|
|
ports:
|
|
- containerPort: 8787
|
|
|
|
env:
|
|
- name: HERMES_HOME
|
|
value: "/home/hermeswebui/.hermes"
|
|
- name: HERMES_WEBUI_AGENT_DIR
|
|
value: "/home/hermeswebui/.hermes/bin"
|
|
- name: HERMES_WEBUI_HOST
|
|
value: "0.0.0.0"
|
|
- name: HERMES_WEBUI_PORT
|
|
value: "8787"
|
|
- name: HERMES_WEBUI_STATE_DIR
|
|
value: "/home/hermeswebui/.hermes/webui"
|
|
- name: WANTED_UID
|
|
value: "10000"
|
|
- name: WANTED_GID
|
|
value: "1000"
|
|
|
|
volumeMounts:
|
|
- name: hermes-data
|
|
mountPath: /home/hermeswebui/.hermes
|
|
- name: hermes-workspace
|
|
mountPath: /home/hermeswebui/workspace
|
|
|
|
resources:
|
|
requests:
|
|
memory: 500Mi
|
|
cpu: "100m"
|
|
limits:
|
|
memory: 1Gi
|
|
cpu: "500m"
|
|
|
|
securityContext:
|
|
|
|
runAsUser: 10000
|
|
runAsGroup: 1000
|
|
runAsNonRoot: false
|
|
allowPrivilegeEscalation: true
|
|
readOnlyRootFilesystem: false
|
|
seccompProfile:
|
|
type: RuntimeDefault
|
|
|
|
volumes:
|
|
- name: hermes-configmap
|
|
configMap:
|
|
name: hermes-config
|
|
|
|
- name: hermes-data
|
|
persistentVolumeClaim:
|
|
claimName: hermes-agent-pvc
|
|
|
|
- name: hermes-workspace
|
|
emptyDir: {}
|
|
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: hermes-agent-pvc
|
|
namespace: customer1
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 25Gi
|