feat(infra): add all Kubernetes manifests
- namespace, temporal server, workspaces PVC - API server deployment, service, serviceaccount, RBAC - Dev overlay Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,59 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: shannon-api
|
||||||
|
namespace: shannon
|
||||||
|
labels:
|
||||||
|
app: shannon-api
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: shannon-api
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: shannon-api
|
||||||
|
spec:
|
||||||
|
serviceAccountName: shannon-api
|
||||||
|
containers:
|
||||||
|
- name: api
|
||||||
|
image: keygraph/shannon-api:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 3000
|
||||||
|
name: http
|
||||||
|
env:
|
||||||
|
- name: TEMPORAL_ADDRESS
|
||||||
|
value: shannon-temporal:7233
|
||||||
|
- name: WORKER_IMAGE
|
||||||
|
value: keygraph/shannon:latest
|
||||||
|
- name: K8S_NAMESPACE
|
||||||
|
value: shannon
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: shannon-credentials
|
||||||
|
volumeMounts:
|
||||||
|
- name: workspaces
|
||||||
|
mountPath: /app/workspaces
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /healthz
|
||||||
|
port: 3000
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 10
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /readyz
|
||||||
|
port: 3000
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 10
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
memory: 128Mi
|
||||||
|
cpu: 100m
|
||||||
|
limits:
|
||||||
|
memory: 256Mi
|
||||||
|
volumes:
|
||||||
|
- name: workspaces
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: shannon-workspaces
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- deployment.yaml
|
||||||
|
- service.yaml
|
||||||
|
- serviceaccount.yaml
|
||||||
|
- rbac.yaml
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
name: shannon-api
|
||||||
|
namespace: shannon
|
||||||
|
rules:
|
||||||
|
- apiGroups: ["batch"]
|
||||||
|
resources: ["jobs"]
|
||||||
|
verbs: ["create", "get", "list", "delete", "watch"]
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["pods"]
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["pods/log"]
|
||||||
|
verbs: ["get"]
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
name: shannon-api
|
||||||
|
namespace: shannon
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: shannon-api
|
||||||
|
namespace: shannon
|
||||||
|
roleRef:
|
||||||
|
kind: Role
|
||||||
|
name: shannon-api
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: shannon-api
|
||||||
|
namespace: shannon
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: shannon-api
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 3000
|
||||||
|
targetPort: 3000
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: shannon-api
|
||||||
|
namespace: shannon
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- ../../base
|
||||||
|
patches:
|
||||||
|
- patch: |-
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: shannon-api
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: api
|
||||||
|
imagePullPolicy: Never
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: shannon
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/part-of: shannon
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: shannon-router
|
||||||
|
namespace: shannon
|
||||||
|
labels:
|
||||||
|
app: shannon-router
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: shannon-router
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: shannon-router
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: router
|
||||||
|
image: node:20-slim
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
apt-get update && apt-get install -y gettext-base &&
|
||||||
|
npm install -g @musistudio/claude-code-router &&
|
||||||
|
mkdir -p /root/.claude-code-router &&
|
||||||
|
envsubst < /config/router-config.json > /root/.claude-code-router/config.json &&
|
||||||
|
ccr start
|
||||||
|
ports:
|
||||||
|
- containerPort: 3456
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: shannon-credentials
|
||||||
|
env:
|
||||||
|
- name: HOST
|
||||||
|
value: "0.0.0.0"
|
||||||
|
volumeMounts:
|
||||||
|
- name: config
|
||||||
|
mountPath: /config
|
||||||
|
readOnly: true
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health
|
||||||
|
port: 3456
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 5
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
memory: 128Mi
|
||||||
|
cpu: 100m
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
configMap:
|
||||||
|
name: shannon-router-config
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: shannon-router
|
||||||
|
namespace: shannon
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: shannon-router
|
||||||
|
ports:
|
||||||
|
- port: 3456
|
||||||
|
targetPort: 3456
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: temporal-data
|
||||||
|
namespace: shannon
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: shannon-temporal
|
||||||
|
namespace: shannon
|
||||||
|
labels:
|
||||||
|
app: shannon-temporal
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: shannon-temporal
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: shannon-temporal
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: temporal
|
||||||
|
image: temporalio/temporal:latest
|
||||||
|
command:
|
||||||
|
- server
|
||||||
|
- start-dev
|
||||||
|
- --db-filename
|
||||||
|
- /home/temporal/temporal.db
|
||||||
|
- --ip
|
||||||
|
- "0.0.0.0"
|
||||||
|
ports:
|
||||||
|
- containerPort: 7233
|
||||||
|
name: grpc
|
||||||
|
- containerPort: 8233
|
||||||
|
name: web-ui
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /home/temporal
|
||||||
|
readinessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- temporal
|
||||||
|
- operator
|
||||||
|
- cluster
|
||||||
|
- health
|
||||||
|
- --address
|
||||||
|
- localhost:7233
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 10
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
memory: 256Mi
|
||||||
|
cpu: 250m
|
||||||
|
limits:
|
||||||
|
memory: 512Mi
|
||||||
|
volumes:
|
||||||
|
- name: data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: temporal-data
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: shannon-temporal
|
||||||
|
namespace: shannon
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: shannon-temporal
|
||||||
|
ports:
|
||||||
|
- name: grpc
|
||||||
|
port: 7233
|
||||||
|
targetPort: 7233
|
||||||
|
- name: web-ui
|
||||||
|
port: 8233
|
||||||
|
targetPort: 8233
|
||||||
Reference in New Issue
Block a user