df3413f54e
Run MCP servers as sidecar containers so they inherit the pod's ServiceAccount permissions instead of requiring separate deployments with their own RBAC. Kubernetes MCP on :8080, Flux MCP on :8081. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
160 lines
5.4 KiB
YAML
160 lines
5.4 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "antigravity.fullname" . }}
|
|
labels:
|
|
{{- include "antigravity.labels" . | nindent 4 }}
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
{{- include "antigravity.labels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
{{- include "antigravity.labels" . | nindent 8 }}
|
|
spec:
|
|
{{- if ne (.Values.clusterAccess | default "none") "none" }}
|
|
serviceAccountName: {{ include "antigravity.fullname" . }}
|
|
{{- end }}
|
|
securityContext:
|
|
fsGroup: 1000
|
|
fsGroupChangePolicy: "OnRootMismatch"
|
|
containers:
|
|
- name: devcontainer
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
ports:
|
|
{{- if ne (.Values.ide | default "vscode") "none" }}
|
|
- containerPort: 5800
|
|
name: vnc-web
|
|
protocol: TCP
|
|
{{- end }}
|
|
{{- if .Values.ssh }}
|
|
- containerPort: 22
|
|
name: ssh
|
|
protocol: TCP
|
|
{{- end }}
|
|
env:
|
|
- name: IDE
|
|
value: {{ .Values.ide | default "vscode" | quote }}
|
|
- name: SSH
|
|
value: {{ .Values.ssh | toString | quote }}
|
|
- name: USER_ID
|
|
value: {{ .Values.userId | quote }}
|
|
- name: GROUP_ID
|
|
value: {{ .Values.groupId | quote }}
|
|
- name: DISPLAY_WIDTH
|
|
value: {{ .Values.display.width | quote }}
|
|
- name: DISPLAY_HEIGHT
|
|
value: {{ .Values.display.height | quote }}
|
|
- name: SECURE_CONNECTION
|
|
value: {{ .Values.secureConnection | quote }}
|
|
- name: HAPPY_HOME_DIR
|
|
value: {{ .Values.happyHomeDir | quote }}
|
|
- name: HAPPY_EXPERIMENTAL
|
|
value: {{ .Values.happyExperimental | quote }}
|
|
- name: HAPPY_SERVER_URL
|
|
value: {{ .Values.happyServerUrl | quote }}
|
|
- name: HAPPY_WEBAPP_URL
|
|
value: {{ .Values.happyWebappUrl | quote }}
|
|
- name: GITHUB_REPO
|
|
value: {{ .Values.githubRepo | quote }}
|
|
envFrom:
|
|
- secretRef:
|
|
name: {{ include "antigravity.envSecretName" . }}
|
|
optional: true
|
|
resources:
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
volumeMounts:
|
|
- name: userhome
|
|
mountPath: /config
|
|
- name: workspace
|
|
mountPath: /workspace
|
|
- name: shm
|
|
mountPath: /dev/shm
|
|
{{- if ne (.Values.ide | default "vscode") "none" }}
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 5800
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 5800
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 5
|
|
{{- else if .Values.ssh }}
|
|
livenessProbe:
|
|
tcpSocket:
|
|
port: 22
|
|
initialDelaySeconds: 15
|
|
periodSeconds: 10
|
|
readinessProbe:
|
|
tcpSocket:
|
|
port: 22
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 5
|
|
{{- end }}
|
|
{{- if .Values.mcpSidecars.kubernetes.enabled }}
|
|
- name: kubernetes-mcp
|
|
image: "{{ .Values.mcpSidecars.kubernetes.image.repository }}:{{ .Values.mcpSidecars.kubernetes.image.tag }}"
|
|
args:
|
|
- --port
|
|
- {{ .Values.mcpSidecars.kubernetes.port | quote }}
|
|
ports:
|
|
- containerPort: {{ .Values.mcpSidecars.kubernetes.port }}
|
|
name: k8s-mcp
|
|
protocol: TCP
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /healthz
|
|
port: {{ .Values.mcpSidecars.kubernetes.port }}
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 10
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /healthz
|
|
port: {{ .Values.mcpSidecars.kubernetes.port }}
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 5
|
|
resources:
|
|
{{- toYaml .Values.mcpSidecars.kubernetes.resources | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.mcpSidecars.flux.enabled }}
|
|
- name: flux-mcp
|
|
image: "{{ .Values.mcpSidecars.flux.image.repository }}:{{ .Values.mcpSidecars.flux.image.tag }}"
|
|
args:
|
|
- serve
|
|
- --transport=sse
|
|
- --port={{ .Values.mcpSidecars.flux.port }}
|
|
ports:
|
|
- containerPort: {{ .Values.mcpSidecars.flux.port }}
|
|
name: flux-mcp
|
|
protocol: TCP
|
|
livenessProbe:
|
|
tcpSocket:
|
|
port: {{ .Values.mcpSidecars.flux.port }}
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 10
|
|
readinessProbe:
|
|
tcpSocket:
|
|
port: {{ .Values.mcpSidecars.flux.port }}
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 5
|
|
resources:
|
|
{{- toYaml .Values.mcpSidecars.flux.resources | nindent 12 }}
|
|
{{- end }}
|
|
volumes:
|
|
- name: workspace
|
|
emptyDir: {}
|
|
- name: shm
|
|
emptyDir:
|
|
medium: Memory
|
|
sizeLimit: {{ .Values.shm.sizeLimit }}
|
|
- name: userhome
|
|
persistentVolumeClaim:
|
|
claimName: {{ include "antigravity.pvcName" . }}
|