From 83d36a8c1e3ba6e628cbb72574e91cbec13577f8 Mon Sep 17 00:00:00 2001 From: Junwei Zhao Date: Mon, 2 Feb 2026 22:07:05 +1100 Subject: [PATCH] Use 1.10 ubuntu for ai-bot --- home-apps/ai-bot.yaml | 229 ++++++------------------------------------ 1 file changed, 29 insertions(+), 200 deletions(-) diff --git a/home-apps/ai-bot.yaml b/home-apps/ai-bot.yaml index d24f74c..7a04f2c 100644 --- a/home-apps/ai-bot.yaml +++ b/home-apps/ai-bot.yaml @@ -1,211 +1,40 @@ apiVersion: v1 -kind: PersistentVolume -metadata: - name: moltbot-config-local-pv - labels: - type: local - name: moltbot-config -spec: - capacity: - storage: 5Gi - volumeMode: Filesystem - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Delete - storageClassName: local-storage - local: - path: /mnt/k8s/moltbot/config - nodeAffinity: - required: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/hostname - operator: In - values: - - server-3 ---- - -apiVersion: v1 -kind: PersistentVolumeClaim +kind: Service metadata: + name: moltbot-gateway # e.g., home-assistant, grafana-external namespace: home-apps - name: moltbot-config-local-pvc spec: - volumeName: moltbot-config-local-pv - storageClassName: "local-storage" - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 5Gi + ports: + - name: gateway + port: 18789 # Port exposed within cluster + targetPort: 18789 # e.g., 3031, 8080, 9090 + protocol: TCP + - name: bridge + port: 18790 + targetPort: 18790 + protocol: TCP --- - -apiVersion: v1 -kind: PersistentVolume +# Manual EndpointSlice pointing to external IP +apiVersion: discovery.k8s.io/v1 +kind: EndpointSlice metadata: - name: moltbot-workspace-local-pv - labels: - type: local - name: moltbot-workspace -spec: - capacity: - storage: 10Gi - volumeMode: Filesystem - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Delete - storageClassName: local-storage - local: - path: /mnt/k8s/moltbot/workspace - nodeAffinity: - required: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/hostname - operator: In - values: - - server-3 ---- - -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - namespace: home-apps - name: moltbot-workspace-local-pvc -spec: - volumeName: moltbot-workspace-local-pv - storageClassName: "local-storage" - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 10Gi ---- - -apiVersion: v1 -kind: Secret -metadata: - name: moltbot-credentials - namespace: home-apps -type: Opaque -stringData: - gateway-token: "96101b63fec7789ef14e4691d30745c2a329170aa165f8dbe3174407ca61aefa" # Generate with: openssl rand -hex 32 - # Optional: Claude AI credentials (NOT REQUIRED - can configure any provider later) - # Supported providers: OpenRouter, Google Gemini, OpenAI, Anthropic, Venice AI, Ollama, etc. - # Configure via: kubectl exec -it deployment/openclaw-gateway -n home-apps -- node dist/index.js onboard - # Or edit config at: /home/node/.openclaw/openclaw.json with model like: - # { "agents": { "defaults": { "model": { "primary": "openrouter/google/gemini-2.0-flash-exp" } } } } - claude-ai-session-key: "" - claude-web-session-key: "" - claude-web-cookie: "" ---- - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: moltbot-gateway + name: moltbot-gateway # MUST match Service name exactly namespace: home-apps labels: - app: moltbot-gateway -spec: - replicas: 1 - revisionHistoryLimit: 2 - selector: - matchLabels: - app: moltbot-gateway - template: - metadata: - labels: - app: moltbot-gateway - name: moltbot-gateway - spec: - imagePullSecrets: - - name: github-image-pull-secret - containers: - - name: moltbot-gateway - image: ghcr.io/wahyd4/home-docker/openclaw:master-875d633 - imagePullPolicy: IfNotPresent - workingDir: /home/node - ports: - - containerPort: 18789 - name: gateway - protocol: TCP - - containerPort: 18790 - name: bridge - protocol: TCP - env: - - name: HOME - value: "/home/node" - - name: TERM - value: "xterm-256color" - - name: PATH - value: "/usr/local/bin:/usr/bin:/bin" - - name: OPENCLAW_GATEWAY_BIND - value: "0.0.0.0" - - name: OPENCLAW_GATEWAY_TOKEN - valueFrom: - secretKeyRef: - name: moltbot-credentials - key: gateway-token - - name: CLAUDE_AI_SESSION_KEY - valueFrom: - secretKeyRef: - name: moltbot-credentials - key: claude-ai-session-key - optional: true - - name: CLAUDE_WEB_SESSION_KEY - valueFrom: - secretKeyRef: - name: moltbot-credentials - key: claude-web-session-key - optional: true - - name: CLAUDE_WEB_COOKIE - valueFrom: - secretKeyRef: - name: moltbot-credentials - key: claude-web-cookie - optional: true - volumeMounts: - - name: config - mountPath: "/home/node/.openclaw" - - name: workspace - mountPath: "/home/node/clawd" - resources: - requests: - cpu: 500m - memory: 512Mi - limits: - cpu: 2000m - memory: 2Gi - # Use exec probes that run INSIDE the container to reach localhost - livenessProbe: - exec: - command: - - /bin/sh - - -c - - "curl -sf http://127.0.0.1:18789/ || exit 1" - initialDelaySeconds: 30 - periodSeconds: 30 - timeoutSeconds: 10 - failureThreshold: 3 - readinessProbe: - exec: - command: - - /bin/sh - - -c - - "curl -sf http://127.0.0.1:18789/ || exit 1" - initialDelaySeconds: 15 - periodSeconds: 15 - timeoutSeconds: 10 - failureThreshold: 6 - volumes: - - name: config - persistentVolumeClaim: - claimName: moltbot-config-local-pvc - - name: workspace - persistentVolumeClaim: - claimName: moltbot-workspace-local-pvc - + kubernetes.io/service-name: moltbot-gateway # Required: links EndpointSlice to Service +addressType: IPv4 +endpoints: + - addresses: + - 192.168.1.10 # e.g., 192.168.1.4 +ports: + - name: gateway + targetPort: gateway + port: 18789 + protocol: TCP + - name: bridge + targetPort: bridge + port: 18790 + protocol: TCP --- apiVersion: v1