-
Couldn't load subscription status.
- Fork 0
init #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
init #21
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -96,9 +96,33 @@ spec: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: GITHUB_BOT_NAME | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| value: {{ .name }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {{- end }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: WORKSPACE_ENGINE_NAMESPACE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| valueFrom: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fieldRef: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fieldPath: metadata.namespace | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: WORKSPACE_ENGINE_STATEFUL_SET_NAME | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| value: {{ .Chart.Name }}-engine | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: WORKSPACE_ENGINE_HEADLESS_SERVICE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| value: {{ .Release.Name }}-engine | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: WORKSPACE_ENGINE_PORT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| value: "8081" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+99
to
+108
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainVerify WORKSPACE_ENGINE_STATEFUL_SET_NAME value. The Ensure this value correctly references the workspace-engine StatefulSet. If workspace-engine is deployed as a subchart under the same release, the name should be 🏁 Script executed: #!/bin/bash
# Check the StatefulSet naming pattern in workspace-engine
echo "=== workspace-engine StatefulSet name template ==="
rg -n "name:.*-engine" charts/ctrlplane/charts/workspace-engine/templates/statefulset.yaml
echo -e "\n=== event-queue WORKSPACE_ENGINE_STATEFUL_SET_NAME ==="
rg -n "WORKSPACE_ENGINE_STATEFUL_SET_NAME" charts/ctrlplane/charts/event-queue/templates/deployment.yaml -A 1Length of output: 288 Use - value: {{ .Chart.Name }}-engine
+ value: {{ .Release.Name }}-engine📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {{- include "ctrlplane.extraEnv" . | nindent 12 }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {{- include "ctrlplane.extraEnvFrom" (dict "root" $ "local" .) | nindent 12 }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: ENABLE_NEW_POLICY_ENGINE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| value: {{ .Values.global.enableNewPolicyEngine | quote }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| resources: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {{- toYaml .Values.resources | nindent 12 }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {{- toYaml .Values.resources | nindent 12 }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: pgbouncer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| image: "{{ .Values.pgbouncer.image.repository }}:{{ .Values.pgbouncer.image.tag }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| imagePullPolicy: "{{ .Values.pgbouncer.image.pullPolicy }}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ports: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: pgbouncer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| containerPort: {{ .Values.pgbouncer.internalPort }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| volumeMounts: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: config | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mountPath: /etc/pgbouncer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| readOnly: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| resources: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {{- toYaml .Values.pgbouncer.resources | nindent 12 }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+115
to
+127
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: Missing volumes section in deployment spec. The pgbouncer container mounts a volume named "config" at Add a + volumes:
+ - name: config
+ configMap:
+ name: {{ template "pgbouncer.configFile" . }}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: {{ template "pgbouncer.configFile" . }} | ||
| namespace: {{ $.Release.Namespace }} | ||
| labels: | ||
| {{- include "pgbouncer.labels" . | nindent 4 }} | ||
|
Comment on lines
+4
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: Missing helper template definitions. This ConfigMap references two helper templates that are not defined in
These missing templates will cause the chart to fail during rendering. Add these helper template definitions to {{/*
PgBouncer config file name
*/}}
{{- define "pgbouncer.configFile" -}}
{{- printf "%s-pgbouncer-config" (include "event-queue.fullname" .) }}
{{- end }}
{{/*
PgBouncer labels
*/}}
{{- define "pgbouncer.labels" -}}
{{ include "event-queue.labels" . }}
app.kubernetes.io/component: pgbouncer
{{- end }}🧰 Tools🪛 YAMLlint (1.37.1)[error] 7-7: syntax error: expected the node content, but found '-' (syntax) 🤖 Prompt for AI Agents |
||
| data: | ||
| pgbouncer.ini: |- | ||
| {{- include "pgbouncer.ini" . | indent 4}} | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,24 @@ image: | |||||
| tag: latest | ||||||
| pullPolicy: Always | ||||||
|
|
||||||
| pgbouncer: | ||||||
| image: | ||||||
| repository: ctrlplane/pgbouncer | ||||||
| tag: latest | ||||||
| pullPolicy: Always | ||||||
| resources: | ||||||
| requests: | ||||||
| cpu: 100m | ||||||
| memory: 128Mi | ||||||
| limits: | ||||||
| cpu: 500m | ||||||
| memory: 512Mi | ||||||
| internalPort: 6379 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix incorrect internalPort value. The Apply this diff: - internalPort: 6379
+ internalPort: 6432📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| config: | ||||||
| listen_addr: 0.0.0.0 | ||||||
| listen_port: 6432 | ||||||
| unix_socket_dir: "" | ||||||
|
|
||||||
| extraEnv: {} | ||||||
| extraEnvFrom: {} | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Patterns to ignore when building packages. | ||
| # This supports shell glob matching, relative path matching, and | ||
| # negation (prefixed with !). Only one pattern per line. | ||
| .DS_Store | ||
| # Common VCS dirs | ||
| .git/ | ||
| .gitignore | ||
| .bzr/ | ||
| .bzrignore | ||
| .hg/ | ||
| .hgignore | ||
| .svn/ | ||
| # Common backup files | ||
| *.swp | ||
| *.bak | ||
| *.tmp | ||
| *.orig | ||
| *~ | ||
| # Various IDEs | ||
| .project | ||
| .idea/ | ||
| *.tmproj | ||
| .vscode/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| apiVersion: v2 | ||
| name: workspace-engine | ||
| description: A Helm chart for Kubernetes | ||
| type: application | ||
| version: 0.1.0 | ||
| appVersion: "1.0.0" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| {{/* | ||
| Expand the name of the chart. | ||
| */}} | ||
| {{- define "workspace-engine.name" -}} | ||
| {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Create a default fully qualified app name. | ||
| We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
| If release name contains chart name it will be used as a full name. | ||
| */}} | ||
| {{- define "workspace-engine.fullname" -}} | ||
| {{- if .Values.fullnameOverride }} | ||
| {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
| {{- else }} | ||
| {{- $name := default .Chart.Name .Values.nameOverride }} | ||
| {{- if contains $name .Release.Name }} | ||
| {{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
| {{- else }} | ||
| {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Create chart name and version as used by the chart label. | ||
| */}} | ||
| {{- define "workspace-engine.chart" -}} | ||
| {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Common labels | ||
| */}} | ||
| {{- define "workspace-engine.labels" -}} | ||
| helm.sh/chart: {{ include "workspace-engine.chart" . }} | ||
| {{ include "workspace-engine.selectorLabels" . }} | ||
| {{- if .Chart.AppVersion }} | ||
| app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
| {{- end }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Selector labels | ||
| */}} | ||
| {{- define "workspace-engine.selectorLabels" -}} | ||
| app.kubernetes.io/name: {{ include "workspace-engine.name" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Create the name of the service account to use | ||
| */}} | ||
| {{- define "workspace-engine.serviceAccountName" -}} | ||
| {{- if .Values.serviceAccount.create }} | ||
| {{- default (include "workspace-engine.fullname" .) .Values.serviceAccount.name }} | ||
| {{- else }} | ||
| {{- default "default" .Values.serviceAccount.name }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| {{- if .Values.serviceAccount.create -}} | ||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: {{ include "workspace-engine.serviceAccountName" . }} | ||
| namespace: {{ $.Release.Namespace }} | ||
| labels: | ||
| {{- include "workspace-engine.labels" . | nindent 4 }} | ||
| {{- if .Values.serviceAccount.labels -}} | ||
| {{- toYaml .Values.serviceAccount.labels | nindent 4 }} | ||
| {{- end }} | ||
| annotations: | ||
| {{- if .Values.serviceAccount.annotations -}} | ||
| {{- toYaml .Values.serviceAccount.annotations | nindent 4 }} | ||
| {{- end }} | ||
| {{- end }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| {{- $imageCfg := dict "global" $.Values.global.image "local" $.Values.image -}} | ||
| apiVersion: apps/v1 | ||
| kind: StatefulSet | ||
| metadata: | ||
| name: {{ .Release.Name }}-engine | ||
| labels: | ||
| {{- include "workspace-engine.labels" . | nindent 4 }} | ||
| {{- if .Values.deployment.labels -}} | ||
| {{- toYaml .Values.deployment.labels | nindent 4 }} | ||
| {{- end }} | ||
| annotations: | ||
| {{- if .Values.deployment.annotations -}} | ||
| {{- toYaml .Values.deployment.annotations | nindent 4 }} | ||
| {{- end }} | ||
| spec: | ||
| serviceName: {{ .Release.Name }}-engine | ||
| replicas: {{ .Values.replica }} | ||
| selector: | ||
| matchLabels: | ||
| {{- include "ctrlplane.selectorLabels" $ | nindent 6 }} | ||
| {{- include "workspace-engine.labels" . | nindent 6 }} | ||
|
Comment on lines
+18
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainVerify mixed selector labels usage. The selector combines
Run this script to examine the label structure: 🏁 Script executed: #!/bin/bash
# Check what labels are generated by both helpers
echo "=== Checking ctrlplane helpers ==="
rg -n "define \"ctrlplane.selectorLabels\"" -A 10
echo -e "\n=== Checking workspace-engine helpers ==="
rg -n "define \"workspace-engine.labels\"" -A 10 charts/ctrlplane/charts/workspace-engine/
echo -e "\n=== Checking other uses of ctrlplane.selectorLabels in workspace-engine ==="
rg "ctrlplane.selectorLabels" charts/ctrlplane/charts/workspace-engine/Length of output: 2202 🏁 Script executed: #!/bin/bash
# Locate workspace-engine.selectorLabels definition
rg -n "define \"workspace-engine.selectorLabels\"" -A10 -B3 charts/ctrlplane/charts/workspace-engine/templates/_helpers.tplLength of output: 472 Remove duplicate selector labels. The StatefulSet’s 🤖 Prompt for AI Agents |
||
| template: | ||
| metadata: | ||
| labels: | ||
| {{- include "workspace-engine.labels" . | nindent 8 }} | ||
| annotations: | ||
| {{- if .Values.pod.annotations -}} | ||
| {{- toYaml .Values.pod.annotations | nindent 8 }} | ||
| {{- end }} | ||
| spec: | ||
| serviceAccountName: {{ include "workspace-engine.serviceAccountName" . }} | ||
| {{- if .tolerations }} | ||
| tolerations: | ||
| {{- toYaml .tolerations | nindent 8 }} | ||
| {{- end }} | ||
| {{- include "ctrlplane.nodeSelector" . | nindent 6 }} | ||
| {{- include "ctrlplane.priorityClassName" . | nindent 6 }} | ||
| {{- include "ctrlplane.podSecurityContext" .Values.pod.securityContext | nindent 6 }} | ||
| containers: | ||
| - name: workspace-engine | ||
| image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
| ports: | ||
| - name: http2 | ||
| containerPort: 8081 | ||
| protocol: TCP | ||
| env: | ||
| - name: KAFKA_BROKERS | ||
| value: {{ .Values.global.kafkaBrokers | quote }} | ||
| - name: POD_NAME | ||
| valueFrom: | ||
| fieldRef: | ||
| fieldPath: metadata.name | ||
| - name: KAFKA_PARTITION_ID | ||
| value: "$(echo $POD_NAME | sed 's/.*-//')" | ||
|
Comment on lines
+53
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: Shell substitution in env var value won't execute. The To extract the StatefulSet pod ordinal, consider these solutions: Solution 1: Use a wrapper script in command/args env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- - name: KAFKA_PARTITION_ID
- value: "$(echo $POD_NAME | sed 's/.*-//')"
+ command:
+ - /bin/sh
+ - -c
+ - |
+ export KAFKA_PARTITION_ID=$(echo $POD_NAME | sed 's/.*-//')
+ exec /your-app-binarySolution 2: Extract in application code Solution 3: Use an initContainer
🤖 Prompt for AI Agents |
||
| - name: GRPC_PORT | ||
| value: {{ .Values.grpc.port | quote }} | ||
| - name: REDIS_URL | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: {{ .Release.Name }}-connections | ||
| key: REDIS_URL | ||
| - name: POSTGRES_URL | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: {{ .Release.Name }}-connections | ||
| key: POSTGRES_URL | ||
| - name: VARIABLES_AES_256_KEY | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: {{ .Release.Name }}-encryption-key | ||
| key: AES_256_KEY | ||
| {{- with (include "ctrlplane.githubBot" . | fromYaml) }} | ||
| - name: GITHUB_BOT_APP_ID | ||
| value: {{ .appId | quote }} | ||
| - name: GITHUB_BOT_CLIENT_ID | ||
| value: {{ .clientId | quote }} | ||
| - name: GITHUB_BOT_CLIENT_SECRET | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: {{ .secretRef }} | ||
| key: GITHUB_BOT_CLIENT_SECRET | ||
| optional: true | ||
| - name: GITHUB_BOT_PRIVATE_KEY | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: {{ .secretRef }} | ||
| key: GITHUB_BOT_PRIVATE_KEY | ||
| optional: true | ||
| - name: GITHUB_BOT_NAME | ||
| value: {{ .name }} | ||
| {{- end }} | ||
| {{- include "ctrlplane.extraEnv" . | nindent 12 }} | ||
| {{- include "ctrlplane.extraEnvFrom" (dict "root" $ "local" .) | nindent 12 }} | ||
| - name: ENABLE_NEW_POLICY_ENGINE | ||
| value: {{ .Values.global.enableNewPolicyEngine | quote }} | ||
| resources: | ||
| {{- toYaml .Values.resources | nindent 12 }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| nameOverride: "" | ||
| fullnameOverride: "" | ||
|
|
||
| replica: 1 | ||
|
|
||
| image: | ||
| repository: ctrlplane/workspace-engine | ||
| tag: latest | ||
| pullPolicy: Always | ||
|
|
||
| extraEnv: {} | ||
| extraEnvFrom: {} | ||
|
|
||
| tolerations: [] | ||
| pod: {} | ||
|
|
||
| serviceAccount: | ||
| create: false | ||
| name: "" | ||
| labels: {} | ||
| annotations: {} | ||
|
|
||
| resources: | ||
| requests: | ||
| cpu: 1000m | ||
| memory: 1Gi | ||
| limits: | ||
| cpu: 4000m | ||
| memory: 4Gi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Major: Incorrect value paths in pgbouncer.ini template.
The template has several issues:
Line 77-78: The template iterates over
$.Values.pgbouncer, but according tovalues.yaml, this contains nested structures (image,resources,internalPort,config). It should iterate over$.Values.pgbouncer.configinstead.Line 70: The nested range loop for database parameters lacks proper spacing, producing malformed connection strings like
host=localhostport=5432instead ofhost=localhost port=5432.Line 91-93: The
%includedirective is placed outside the[pgbouncer]section, but it should be inside that section per PgBouncer configuration syntax.Apply this diff to fix the template:
{{ define "pgbouncer.ini" }} {{/* [databases] section */}} {{- if $.Values.databases }} {{ printf "[databases]" }} {{- range $key, $value := .Values.databases }} - {{ $key }} ={{ range $k, $v := $value }} {{ $k }}={{ $v }}{{ end }} + {{ $key }} = {{ range $k, $v := $value }}{{ $k }}={{ $v }} {{ end }} {{- end }} {{- end }} {{/* [pgbouncer] section */}} -{{- if $.Values.pgbouncer }} +{{- if $.Values.pgbouncer.config }} {{ printf "[pgbouncer]" }} - {{- range $k, $v := $.Values.pgbouncer }} + {{- range $k, $v := $.Values.pgbouncer.config }} {{ $k }} = {{ $v }} {{- end }} -{{- end }} - -{{/* [users] section */}} -{{- if $.Values.users }} - {{ printf "[users]" }} - {{- range $k, $v := $.Values.users }} - {{ $k }} = {{ $v }} - {{- end }} -{{- end }} - -{{/* include is a special configuration within [pgbouncer] section */}} -{{- if $.Values.include }} + {{/* include is a special configuration within [pgbouncer] section */}} + {{- if $.Values.include }} {{ printf "%s %s" "%include" $.Values.include }} + {{- end }} {{- end }} +{{/* [users] section */}} +{{- if $.Values.users }} + {{ printf "[users]" }} + {{- range $k, $v := $.Values.users }} + {{ $k }} = {{ $v }} + {{- end }} +{{- end }} + {{ end }}📝 Committable suggestion
🤖 Prompt for AI Agents