From 256a6871e8fdf447e0344859e3c76e8493e37ce3 Mon Sep 17 00:00:00 2001 From: Chris Farhood Date: Fri, 20 Feb 2026 06:14:40 -0500 Subject: [PATCH] Add Helm chart, replace flux/ variable-substitution templates Introduces chart/ with deployment, service, and PVC templates driven by Helm values instead of Kustomize variable substitution. Removes the flux/ directory which is superseded by the chart. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- chart/Chart.yaml | 6 +++ chart/templates/_helpers.tpl | 28 ++++++++++++ chart/templates/deployment.yaml | 77 +++++++++++++++++++++++++++++++++ chart/templates/pvc.yaml | 13 ++++++ chart/templates/service.yaml | 14 ++++++ chart/values.yaml | 43 ++++++++++++++++++ flux/deployment.yaml | 75 -------------------------------- flux/kustomization.yaml | 16 ------- flux/pvc.yaml | 11 ----- flux/service.yaml | 15 ------- 10 files changed, 181 insertions(+), 117 deletions(-) create mode 100644 chart/Chart.yaml create mode 100644 chart/templates/_helpers.tpl create mode 100644 chart/templates/deployment.yaml create mode 100644 chart/templates/pvc.yaml create mode 100644 chart/templates/service.yaml create mode 100644 chart/values.yaml delete mode 100644 flux/deployment.yaml delete mode 100644 flux/kustomization.yaml delete mode 100644 flux/pvc.yaml delete mode 100644 flux/service.yaml diff --git a/chart/Chart.yaml b/chart/Chart.yaml new file mode 100644 index 0000000..29c6588 --- /dev/null +++ b/chart/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: antigravity +description: Antigravity Dev Container with Happy Coder AI assistant +type: application +version: 0.1.0 +appVersion: "latest" diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl new file mode 100644 index 0000000..2bf65b1 --- /dev/null +++ b/chart/templates/_helpers.tpl @@ -0,0 +1,28 @@ +{{/* +Resource name prefix: devcontainer-{name} +*/}} +{{- define "antigravity.fullname" -}} +{{- printf "devcontainer-%s" .Values.name }} +{{- end }} + +{{/* +PVC name: userhome-{name} +*/}} +{{- define "antigravity.pvcName" -}} +{{- printf "userhome-%s" .Values.name }} +{{- end }} + +{{/* +Secret name for env vars, default to devcontainer-{name}-secrets-env +*/}} +{{- define "antigravity.envSecretName" -}} +{{- .Values.envSecretName | default (printf "devcontainer-%s-secrets-env" .Values.name) }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "antigravity.labels" -}} +app: devcontainer +instance: {{ .Values.name }} +{{- end }} diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml new file mode 100644 index 0000000..28ed630 --- /dev/null +++ b/chart/templates/deployment.yaml @@ -0,0 +1,77 @@ +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: + securityContext: + fsGroup: 1000 + fsGroupChangePolicy: "OnRootMismatch" + containers: + - name: devcontainer + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - containerPort: 5800 + name: vnc-web + protocol: TCP + env: + - 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: /home + - name: workspace + mountPath: /workspace + livenessProbe: + httpGet: + path: / + port: 5800 + initialDelaySeconds: 30 + periodSeconds: 10 + readinessProbe: + httpGet: + path: / + port: 5800 + initialDelaySeconds: 10 + periodSeconds: 5 + volumes: + - name: workspace + emptyDir: {} + - name: userhome + persistentVolumeClaim: + claimName: {{ include "antigravity.pvcName" . }} diff --git a/chart/templates/pvc.yaml b/chart/templates/pvc.yaml new file mode 100644 index 0000000..4bbacda --- /dev/null +++ b/chart/templates/pvc.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "antigravity.pvcName" . }} + labels: + {{- include "antigravity.labels" . | nindent 4 }} +spec: + accessModes: + - ReadWriteMany + storageClassName: {{ .Values.storage.className }} + resources: + requests: + storage: {{ .Values.storage.size }} diff --git a/chart/templates/service.yaml b/chart/templates/service.yaml new file mode 100644 index 0000000..5fe275b --- /dev/null +++ b/chart/templates/service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "antigravity.fullname" . }} + labels: + {{- include "antigravity.labels" . | nindent 4 }} +spec: + ports: + - port: 5800 + name: vnc-web + protocol: TCP + targetPort: vnc-web + selector: + {{- include "antigravity.labels" . | nindent 4 }} diff --git a/chart/values.yaml b/chart/values.yaml new file mode 100644 index 0000000..37627ee --- /dev/null +++ b/chart/values.yaml @@ -0,0 +1,43 @@ +# Instance name — used to generate resource names (devcontainer-{name}, userhome-{name}) +name: "" + +image: + repository: ghcr.io/cpfarhood/devcontainer + tag: latest + pullPolicy: Always + +# GitHub repository to clone into /workspace +githubRepo: "" + +# Happy Coder endpoints +happyServerUrl: "https://happy.farh.net" +happyWebappUrl: "https://happy-coder.farh.net" +happyHomeDir: "/home/user/.happy" +happyExperimental: "true" + +# VNC display +display: + width: "1920" + height: "1080" + +# Set to "0" when TLS is terminated at the gateway layer +secureConnection: "0" + +userId: "1000" +groupId: "1000" + +storage: + size: 32Gi + className: ceph-filesystem + +resources: + requests: + memory: "2Gi" + cpu: "1000m" + limits: + memory: "8Gi" + cpu: "4000m" + +# Name of existing Secret containing env vars (GITHUB_TOKEN, VNC_PASSWORD, etc.) +# Defaults to: devcontainer-{name}-secrets-env +envSecretName: "" diff --git a/flux/deployment.yaml b/flux/deployment.yaml deleted file mode 100644 index 209617e..0000000 --- a/flux/deployment.yaml +++ /dev/null @@ -1,75 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: devcontainer-${NAME} -spec: - template: - metadata: - labels: - app: devcontainer - instance: ${NAME} - spec: - securityContext: - fsGroup: 1000 - fsGroupChangePolicy: "OnRootMismatch" - containers: - - name: devcontainer - image: ghcr.io/cpfarhood/devcontainer:latest - imagePullPolicy: Always - ports: - - containerPort: 5800 - name: vnc-web - protocol: TCP - volumeMounts: - - name: userhome - mountPath: /home - - name: workspace - mountPath: /workspace - env: - # User/Group IDs for the claude user - - name: USER_ID - value: "1000" - - name: GROUP_ID - value: "1000" - # VNC display settings - - name: DISPLAY_WIDTH - value: "1920" - - name: DISPLAY_HEIGHT - value: "1080" - - name: SECURE_CONNECTION - value: "0" - - name: HAPPY_HOME_DIR - value: "/home/user/.happy" - - name: HAPPY_EXPERIMENTAL - value: "true" - envFrom: - - configMapRef: - name: ${ENV_CONFIGMAP} - - secretRef: - name: ${ENV_SECRETS} - resources: - requests: - memory: "2Gi" - cpu: "1000m" - limits: - memory: "8Gi" - cpu: "4000m" - livenessProbe: - httpGet: - path: / - port: 5800 - initialDelaySeconds: 30 - periodSeconds: 10 - readinessProbe: - httpGet: - path: / - port: 5800 - initialDelaySeconds: 10 - periodSeconds: 5 - volumes: - - name: workspace - emptyDir: {} - - name: userhome - persistentVolumeClaim: - claimName: userhome-${NAME} diff --git a/flux/kustomization.yaml b/flux/kustomization.yaml deleted file mode 100644 index 1f8591d..0000000 --- a/flux/kustomization.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - # - configmap.yaml - - deployment.yaml - - pvc.yaml - - service.yaml - -commonLabels: - app: devcontainer - environment: development - -commonAnnotations: - managed-by: kustomize - description: "Dev Container with Happy Coder" diff --git a/flux/pvc.yaml b/flux/pvc.yaml deleted file mode 100644 index d1a6229..0000000 --- a/flux/pvc.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: userhome -spec: - accessModes: - - ReadWriteMany - storageClassName: ceph-filesystem - resources: - requests: - storage: 32Gi diff --git a/flux/service.yaml b/flux/service.yaml deleted file mode 100644 index ff8edc0..0000000 --- a/flux/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: devcontainer-${NAME} - labels: - app: devcontainer - instance: ${NAME} -spec: - ports: - - port: 5800 - name: vnc-web - protocol: TCP - selector: - app: devcontainer - instance: ${NAME}