Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions helm/gopie/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ dependencies:
- name: qdrant
repository: https://qdrant.github.io/qdrant-helm
version: 1.12.5
digest: sha256:8734b9e4d640b3b6e7876ce5fd50fa427a2b1b50d38ec46c2db867b7af200f4d
generated: "2025-11-21T17:03:39.309977+05:30"
# - name: zitadel
# repository: https://charts.zitadel.com
# version: 8.6.2
# digest: sha256:800337654c501f38ca60acfb645b2bca91383e69829ad787af340293010dec7a
# generated: "2026-01-09T11:51:20.510797+05:30"
5 changes: 5 additions & 0 deletions helm/gopie/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@ dependencies:
repository: https://qdrant.github.io/qdrant-helm
condition: qdrant.enabled

# - name: zitadel
# version: 8.6.2
# repository: https://charts.zitadel.com
# condition: zitadel.enabled

Binary file added helm/gopie/charts/zitadel-8.6.2.tgz
Binary file not shown.
25 changes: 24 additions & 1 deletion helm/gopie/templates/_pod-chat-server.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,28 @@ tolerations:
{{- toYaml . | nindent 2 }}
{{- end }}
volumes:
{{- toYaml .Values.chatserver.volumes | nindent 6 }}
{{- range .Values.chatserver.extraVolumes }}
- name: {{ .name }}
{{- if .existingClaim }}
persistentVolumeClaim:
claimName: {{ .existingClaim }}
{{- else if .hostPath }}
hostPath:
{{- toYaml .hostPath | nindent 6 }}
{{- else if .csi }}
csi:
{{- toYaml .csi | nindent 6 }}
{{- else if .configMap }}
configMap:
{{- toYaml .configMap | nindent 6 }}
{{- else if .secret }}
secret:
{{- toYaml .secret | nindent 6 }}
{{- else if .emptyDir }}
emptyDir:
{{- toYaml .emptyDir | nindent 6 }}
{{- else }}
emptyDir: {}
{{- end }}
{{- end }}
{{- end }}
97 changes: 61 additions & 36 deletions helm/gopie/templates/_pod-server.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,26 @@ containers:
{{- toYaml .Values.deployment.readinessProbe | nindent 6 }}
{{- end }}
{{- if .Values.deployment.env }}
{{- with .Values.deployment.env }}
env:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- toYaml .Values.deployment.env | nindent 6 }}
{{- else }}
env:
- name: GOPIE_POSTGRES_HOST
value: {{ printf "%s-postgresql" $root.Release.Name | quote }}
- name: GOPIE_POSTGRES_DB
value: {{ $root.Values.postgresql.auth.database }}
- name: GOPIE_POSTGRES_USER
value: postgres
- name: GOPIE_POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ printf "%s-postgresql" $root.Release.Name }}
key: postgres-password
- name: GOPIE_POSTGRES_PORT
value: "5432"
- name: GOPIE_AIAGENT_URL
value: {{ printf "http://%s-chatserver:%v" $root.Release.Name ($root.Values.chatserver.service.portNumber | default 8000) }}
{{- end }}
# - name: GOPIE_POSTGRES_HOST
# value: {{ printf "%s-postgresql" $root.Release.Name | quote }}
# - name: GOPIE_POSTGRES_DB
# value: {{ $root.Values.postgresql.auth.database }}
# - name: GOPIE_POSTGRES_USER
# value: postgres
# - name: GOPIE_POSTGRES_PASSWORD
# valueFrom:
# secretKeyRef:
# name: {{ printf "%s-postgresql" $root.Release.Name }}
# key: postgres-password
# - name: GOPIE_POSTGRES_PORT
# value: "5432"
# - name: GOPIE_AIAGENT_URL
# value: {{ printf "http://%s-chatserver:%v" $root.Release.Name ($root.Values.chatserver.service.portNumber | default 8000) }}
resources:
{{- toYaml .Values.deployment.resources | nindent 6 }}
volumeMounts:
Expand All @@ -95,8 +95,31 @@ tolerations:
{{- toYaml . | nindent 2 }}
{{- end }}
volumes:
{{- toYaml .Values.deployment.volumes | nindent 6 }}
{{- end }}
{{- range .Values.deployment.extraVolumes }}
- name: {{ .name }}
{{- if .existingClaim }}
persistentVolumeClaim:
claimName: {{ .existingClaim }}
{{- else if .hostPath }}
hostPath:
{{- toYaml .hostPath | nindent 6 }}
{{- else if .csi }}
csi:
{{- toYaml .csi | nindent 6 }}
{{- else if .configMap }}
configMap:
{{- toYaml .configMap | nindent 6 }}
{{- else if .secret }}
secret:
{{- toYaml .secret | nindent 6 }}
{{- else if .emptyDir }}
emptyDir:
{{- toYaml .emptyDir | nindent 6 }}
{{- else }}
emptyDir: {}
{{- end }}
{{- end }}
{{- end }}



Expand Down Expand Up @@ -152,27 +175,29 @@ containers:
readinessProbe:
{{- toYaml .Values.stateful.readinessProbe | nindent 6 }}
{{- end }}
env:
# - name: GOPIE_POSTGRES_HOST
# value: {{ printf "%s-postgresql" $root.Release.Name | quote }}
# - name: GOPIE_POSTGRES_DB
# value: {{ $root.Values.postgresql.auth.database }}
# - name: GOPIE_POSTGRES_USER
# value: postgres
# - name: GOPIE_POSTGRES_PASSWORD
# valueFrom:
# secretKeyRef:
# name: {{ printf "%s-postgresql" $root.Release.Name }}
# key: postgres-password
# - name: GOPIE_POSTGRES_PORT
# value: "5432"
# - name: GOPIE_AIAGENT_URL
# value: {{ printf "http://%s-chatserver:%v" $root.Release.Name ($root.Values.chatserver.service.portNumber | default 8000) }}
{{- if .Values.stateful.env }}
env:
{{- range .Values.stateful.env }}
- name: {{ .name }}
value: {{ .value | quote }}
{{- end }}
{{- else }}
env:
- name: GOPIE_POSTGRES_HOST
value: {{ printf "%s-postgresql" $root.Release.Name | quote }}
- name: GOPIE_POSTGRES_DB
value: {{ $root.Values.postgresql.auth.database }}
- name: GOPIE_POSTGRES_USER
value: postgres
- name: GOPIE_POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ printf "%s-postgresql" $root.Release.Name }}
key: postgres-password
- name: GOPIE_POSTGRES_PORT
value: "5432"
- name: GOPIE_AIAGENT_URL
value: {{ printf "http://%s-chatserver:%v" $root.Release.Name ($root.Values.chatserver.service.portNumber | default 8000) }}
{{- end }}
resources: {{- toYaml .Values.stateful.resources | nindent 6 }}
volumeMounts:
Expand Down
25 changes: 24 additions & 1 deletion helm/gopie/templates/_pod-web.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,28 @@ tolerations:
{{- toYaml . | nindent 2 }}
{{- end }}
volumes:
{{- toYaml .Values.web.volumes | nindent 6 }}
{{- range .Values.web.extraVolumes }}
- name: {{ .name }}
{{- if .existingClaim }}
persistentVolumeClaim:
claimName: {{ .existingClaim }}
{{- else if .hostPath }}
hostPath:
{{- toYaml .hostPath | nindent 6 }}
{{- else if .csi }}
csi:
{{- toYaml .csi | nindent 6 }}
{{- else if .configMap }}
configMap:
{{- toYaml .configMap | nindent 6 }}
{{- else if .secret }}
secret:
{{- toYaml .secret | nindent 6 }}
{{- else if .emptyDir }}
emptyDir:
{{- toYaml .emptyDir | nindent 6 }}
{{- else }}
emptyDir: {}
{{- end }}
{{- end }}
{{- end }}
18 changes: 18 additions & 0 deletions helm/gopie/templates/chat-server/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if .Values.chatserver.podDisruptionBudget.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "chatserver.name" . }}-pdb
namespace: {{ include "chatserver.namespace" . }}
labels:
{{ include "chatserver.labels" . | nindent 4 }}
spec:
{{- if .Values.chatserver.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.chatserver.podDisruptionBudget.minAvailable }}
{{- else if .Values.chatserver.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.chatserver.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels:
{{ include "chatserver.selectorLabels" . | nindent 6 }}
{{- end }}
Comment on lines +1 to +18
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

PDB template structure is correct; static analysis hint is a false positive.

The YAMLlint error is expected since this is a Helm template file, not raw YAML—the {{- if ...}} directive is valid Go templating.

However, if podDisruptionBudget.enabled is true but neither minAvailable nor maxUnavailable is configured, the rendered PDB will have an empty spec (missing both fields), which Kubernetes will reject. Consider adding a default or validation.

Suggested fix: Add a default minAvailable
 spec:
   {{- if .Values.chatserver.podDisruptionBudget.minAvailable }}
   minAvailable: {{ .Values.chatserver.podDisruptionBudget.minAvailable }}
   {{- else if .Values.chatserver.podDisruptionBudget.maxUnavailable }}
   maxUnavailable: {{ .Values.chatserver.podDisruptionBudget.maxUnavailable }}
+  {{- else }}
+  minAvailable: 1
   {{- end }}
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

🤖 Prompt for AI Agents
In @helm/gopie/templates/chat-server/pdb.yaml around lines 1 - 18, If
.Values.chatserver.podDisruptionBudget.enabled is true but neither minAvailable
nor maxUnavailable is set the rendered PodDisruptionBudget spec can be empty and
invalid; update the template around the minAvailable/maxUnavailable logic in the
pdb.yaml Helm template to supply a safe default (e.g. minAvailable: 1) when
minAvailable is unset and maxUnavailable is unset, using Helm's default function
or an additional conditional so that spec always contains either minAvailable or
maxUnavailable (refer to .Values.chatserver.podDisruptionBudget.minAvailable,
.Values.chatserver.podDisruptionBudget.maxUnavailable and
.Values.chatserver.podDisruptionBudget.enabled).

18 changes: 18 additions & 0 deletions helm/gopie/templates/server/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if .Values.deployment.podDisruptionBudget.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "server.name" . }}-pdb
namespace: {{ include "gopie.namespace" . }}
labels:
{{ include "server.labels" . | nindent 4 }}
spec:
{{- if .Values.deployment.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.deployment.podDisruptionBudget.minAvailable }}
{{- else if .Values.deployment.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.deployment.podDisruptionBudget.maxUnavailable }}
{{- end }}
Comment on lines +10 to +14
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Same issue as web PDB: spec may be empty if neither value is configured.

Consider adding a default fallback to ensure a valid PDB spec when enabled. This mirrors the pattern needed in web/pdb.yaml.

Suggested fix
   {{- if .Values.deployment.podDisruptionBudget.minAvailable }}
   minAvailable: {{ .Values.deployment.podDisruptionBudget.minAvailable }}
   {{- else if .Values.deployment.podDisruptionBudget.maxUnavailable }}
   maxUnavailable: {{ .Values.deployment.podDisruptionBudget.maxUnavailable }}
+  {{- else }}
+  maxUnavailable: 1
   {{- end }}
🤖 Prompt for AI Agents
In @helm/gopie/templates/server/pdb.yaml around lines 10 - 14, The PDB template
for server may render an empty spec when
.Values.deployment.podDisruptionBudget.minAvailable and
.Values.deployment.podDisruptionBudget.maxUnavailable are both unset; update the
template (server/pdb.yaml) to provide a safe default fallback (e.g., default
minAvailable: 1 or default maxUnavailable: 1 depending on your desired behavior)
so the spec block is never empty when the PDB is enabled, mirroring the same
fallback logic used in web/pdb.yaml and using the same
.Values.deployment.podDisruptionBudget.* symbols.

selector:
matchLabels:
{{ include "server.selectorLabels" . | nindent 6 }}
{{- end }}
17 changes: 17 additions & 0 deletions helm/gopie/templates/server/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "server.name" . }}
namespace: {{ include "gopie.namespace" . }}
labels:
{{- include "server.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "server.selectorLabels" . | nindent 6 }}
endpoints:
- port: metrics
path: /metrics
interval: 30s
scrapeTimeout: 10s
honorLabels: true
Comment on lines +1 to +17
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

ServiceMonitor should be conditional to avoid failures when Prometheus Operator is not installed.

Unlike the PDB templates which check .Values.*.podDisruptionBudget.enabled, this ServiceMonitor is unconditionally rendered. If the Prometheus Operator CRDs (monitoring.coreos.com/v1) are not installed in the cluster, the Helm deployment will fail.

Consider wrapping this in a conditional and making the scrape settings configurable.

Suggested fix
+{{- if .Values.server.serviceMonitor.enabled }}
 apiVersion: monitoring.coreos.com/v1
 kind: ServiceMonitor
 metadata:
   name: {{ include "server.name" . }}
   namespace: {{ include "gopie.namespace" . }}
   labels:
     {{- include "server.labels" . | nindent 4 }}
 spec:
   selector:
     matchLabels:
       {{- include "server.selectorLabels" . | nindent 6 }}
   endpoints:
   - port: metrics
     path: /metrics
-    interval: 30s
-    scrapeTimeout: 10s
+    interval: {{ .Values.server.serviceMonitor.interval | default "30s" }}
+    scrapeTimeout: {{ .Values.server.serviceMonitor.scrapeTimeout | default "10s" }}
     honorLabels: true
+{{- end }}

Also add the corresponding values in values.yaml:

server:
  serviceMonitor:
    enabled: false
    interval: 30s
    scrapeTimeout: 10s
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 7-7: syntax error: expected the node content, but found '-'

(syntax)

🤖 Prompt for AI Agents
In @helm/gopie/templates/server/servicemonitor.yaml around lines 1 - 17, The
ServiceMonitor template is rendered unconditionally and will break installs
without the Prometheus Operator; wrap the ServiceMonitor manifest in a Helm
conditional checking .Values.server.serviceMonitor.enabled (e.g., if
.Values.server.serviceMonitor.enabled) so it only renders when enabled, and
replace the hard-coded scrape settings (interval, scrapeTimeout, honorLabels and
path/port if desired) with values from .Values.server.serviceMonitor (e.g.,
.Values.server.serviceMonitor.interval, .scrapeTimeout, .honorLabels) so they
are configurable; also add the corresponding defaults to values.yaml
(server.serviceMonitor.enabled: false and the interval/scrapeTimeout/honorLabels
keys).

18 changes: 18 additions & 0 deletions helm/gopie/templates/web/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if .Values.web.podDisruptionBudget.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "web.name" . }}-pdb
namespace: {{ include "gopie.namespace" . }}
labels:
{{ include "web.labels" . | nindent 4 }}
spec:
{{- if .Values.web.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.web.podDisruptionBudget.minAvailable }}
{{- else if .Values.web.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.web.podDisruptionBudget.maxUnavailable }}
{{- end }}
Comment on lines +10 to +14
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

PDB spec may be empty if neither minAvailable nor maxUnavailable is configured.

When podDisruptionBudget.enabled is true but both minAvailable and maxUnavailable are unset, the rendered PDB will have no disruption constraint, which is invalid. Add a default or require at least one value.

Suggested fix with default
   {{- if .Values.web.podDisruptionBudget.minAvailable }}
   minAvailable: {{ .Values.web.podDisruptionBudget.minAvailable }}
   {{- else if .Values.web.podDisruptionBudget.maxUnavailable }}
   maxUnavailable: {{ .Values.web.podDisruptionBudget.maxUnavailable }}
+  {{- else }}
+  maxUnavailable: 1
   {{- end }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{{- if .Values.web.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.web.podDisruptionBudget.minAvailable }}
{{- else if .Values.web.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.web.podDisruptionBudget.maxUnavailable }}
{{- end }}
{{- if .Values.web.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.web.podDisruptionBudget.minAvailable }}
{{- else if .Values.web.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.web.podDisruptionBudget.maxUnavailable }}
{{- else }}
maxUnavailable: 1
{{- end }}
🤖 Prompt for AI Agents
In @helm/gopie/templates/web/pdb.yaml around lines 10 - 14, The PDB template can
render an empty spec when .Values.web.podDisruptionBudget.minAvailable and
.Values.web.podDisruptionBudget.maxUnavailable are both unset; update the logic
in the template that generates the minAvailable/maxUnavailable block
(referencing .Values.web.podDisruptionBudget.minAvailable,
.Values.web.podDisruptionBudget.maxUnavailable and podDisruptionBudget.enabled)
so that either (a) a safe default is provided (for example set minAvailable to 1
when neither value is provided) or (b) the whole PDB resource is not rendered
unless at least one of minAvailable or maxUnavailable is explicitly set;
implement the chosen approach by adding the additional conditional or default
fallback to ensure the PDB spec is never empty.

selector:
matchLabels:
{{ include "web.selectorLabels" . | nindent 6 }}
{{- end }}
Loading