68 lines
2.1 KiB
YAML
68 lines
2.1 KiB
YAML
apiVersion: apps/v1
|
|||
|
|
kind: Deployment
|
||
|
|
metadata:
|
||
|
|
name: agent-pod
|
||
|
|
namespace: agent-pod
|
||
|
|
spec:
|
||
|
|
replicas: 1
|
||
|
|
selector:
|
||
|
|
matchLabels:
|
||
|
|
app: agent-pod
|
||
|
|
template:
|
||
|
|
metadata:
|
||
|
|
labels:
|
||
|
|
app: agent-pod
|
||
|
|
spec:
|
||
# api.riotpiao.com has no in-cluster DNS record (only resolves from the
|
|||
|
|
# home network's own resolver) -- pin it to ingress-nginx-controller's
|
||
|
|
# ClusterIP so pi's models.json baseUrl works unchanged. TLS still
|
||
|
|
# terminates correctly since SNI/Host still say api.riotpiao.com.
|
||
|
|
hostAliases:
|
||
|
|
- ip: "10.101.128.185"
|
||
|
|
hostnames:
|
||
|
|
- "api.riotpiao.com"
|
||
containers:
|
|||
# hub.js runs in the same container as pi (not a sidecar) so it can
|
|||
|
|
# spawn `pi -p --mode json` directly via child_process -- a separate
|
||
|
|
# container can't exec into another container's filesystem/PATH.
|
||
|
|
# It IS the container's long-running process now; no more `sleep
|
||
|
|
# infinity` placeholder.
|
||
- name: pi
|
|||
image: node:22-slim
|
|||
command:
|
|||
|
|
- sh
|
||
|
|
- -c
|
||
- "npm install -g @earendil-works/[email protected] && npm install --prefix /root ws && node /root/hub.js"
|
|||
|
|
ports:
|
||
|
|
- containerPort: 9090
|
||
resources:
|
|||
|
|
requests:
|
||
|
|
cpu: "2"
|
||
|
|
memory: 4Gi
|
||
|
|
limits:
|
||
|
|
cpu: "4"
|
||
|
|
memory: 8Gi
|
||
|
|
volumeMounts:
|
||
|
|
- name: pi-config
|
||
|
|
mountPath: /root/.pi/config.json
|
||
|
|
subPath: config.json
|
||
|
|
- name: pi-config
|
||
|
|
mountPath: /root/.pi/agent/settings.json
|
||
|
|
subPath: settings.json
|
||
|
|
- name: pi-models
|
||
|
|
mountPath: /root/.pi/agent/models.json
|
||
|
|
subPath: models.json
|
||
- name: hub-src
|
|||
mountPath: /root/hub.js
|
|||
|
|
subPath: hub.js
|
||
volumes:
|
|||
|
|
- name: pi-config
|
||
|
|
configMap:
|
||
|
|
name: pi-config
|
||
|
|
- name: pi-models
|
||
|
|
secret:
|
||
|
|
secretName: pi-models
|
||
- name: hub-src
|
|||
|
|
configMap:
|
||
|
|
name: hub-src
|