From 14edd185e88f5f5fd724777f83441d506a285014 Mon Sep 17 00:00:00 2001 From: engineering Date: Mon, 30 Jun 2025 15:59:54 -0600 Subject: [PATCH 1/3] =?UTF-8?q?Fixes=20after=20Testing=20-=20Refactored=20?= =?UTF-8?q?deployment.yaml=20to=20reference=20ai.externalSecret.name=20whe?= =?UTF-8?q?n=20create:=20false=20-=20Corrected=20CT=5FHQ=5FOLLAMA=5FAI=5FA?= =?UTF-8?q?PI=5FKEY=20key=20to=20apiKey=20to=20match=20Secret=E2=80=99s=20?= =?UTF-8?q?stringData=20-=20Updated=20ai-external-secret.yaml=20to=20gener?= =?UTF-8?q?ate=20a=20Secret=20only=20when=20create:=20true?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../intel/templates/ai-external-secret.yaml | 2 +- charts/intel/templates/deployment.yaml | 29 +++++++++---------- charts/intel/values.yaml | 16 +++++----- 3 files changed, 21 insertions(+), 26 deletions(-) diff --git a/charts/intel/templates/ai-external-secret.yaml b/charts/intel/templates/ai-external-secret.yaml index ebd6468..b01e8ad 100644 --- a/charts/intel/templates/ai-external-secret.yaml +++ b/charts/intel/templates/ai-external-secret.yaml @@ -7,6 +7,6 @@ metadata: namespace: {{ .Release.Namespace }} type: Opaque stringData: - api-key: {{ $extSecret.apiKey | quote }} + apiKey: {{ $extSecret.apiKey | quote }} {{- end }} diff --git a/charts/intel/templates/deployment.yaml b/charts/intel/templates/deployment.yaml index 656a21c..a9eb15c 100644 --- a/charts/intel/templates/deployment.yaml +++ b/charts/intel/templates/deployment.yaml @@ -40,8 +40,7 @@ spec: - name: AI_BUNDLED_URL value: "http://codetogether-llm:8000" {{- end }} - {{- if .Values.ai.enabled }} - {{- if eq .Values.ai.mode "external" }} + {{- if and .Values.ai.enabled (eq .Values.ai.mode "external") }} - name: AI_PROVIDER valueFrom: configMapKeyRef: @@ -55,9 +54,8 @@ spec: - name: AI_EXTERNAL_API_KEY valueFrom: secretKeyRef: - name: {{ (index .Values.ai "externalSecret" | default dict).name | default (printf "%s-ai-external-secret" (include "codetogether.fullname" .)) }} - key: api-key - {{- end }} + name: {{ default (printf "%s-ai-external-secret" (include "codetogether.fullname" .)) .Values.ai.externalSecret.name | quote }} + key: apiKey {{- end }} # Set CodeTogether runtime configuration - name: CT_HQ_BASE_URL @@ -80,21 +78,23 @@ spec: {{- end }} {{- if .Values.ai.enabled }} - name: CT_HQ_OLLAMA_AI_URL - value: {{ if eq .Values.ai.mode "bundled" }}"http://localhost:8000"{{ else }}"{{ .Values.ai.url | quote }}"{{ end }} + value: {{ if eq .Values.ai.mode "bundled" }} + "http://localhost:8000" + {{ else }} + {{ .Values.ai.url | quote }} + {{ end }} - name: CT_HQ_OLLAMA_AI_MODEL_NAME value: {{ .Values.ai.modelName | default "gemma3:1b" | quote }} - name: CT_HQ_OLLAMA_AI_API_KEY + {{- if eq .Values.ai.mode "bundled" }} + value: "apiKey" + {{- else }} valueFrom: secretKeyRef: - name: {{- if and (eq .Values.ai.mode "external") (not .Values.ai.externalSecret.create) }} - {{ .Values.ai.externalSecret.name }} - {{- else }} - {{ .Values.ai.externalSecret.name | default (printf "%s-ollama-api" .Release.Name) }} - {{- end }} + name: {{ default (printf "%s-ai-external-secret" (include "codetogether.fullname" .)) .Values.ai.externalSecret.name | quote }} key: apiKey + {{- end }} {{- end }} - - volumeMounts: - name: properties-volume mountPath: /opt/codetogether/runtime/cthq.properties @@ -108,7 +108,6 @@ spec: - name: http containerPort: 1080 protocol: TCP - livenessProbe: initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.livenessProbe.periodSeconds }} @@ -131,7 +130,6 @@ spec: resources: {{- toYaml .Values.resources | nindent 12 }} - {{- if and .Values.ai.enabled (eq .Values.ai.mode "bundled") }} - name: codetogether-llm image: "{{ .Values.ai.image.repository }}:{{ .Values.ai.image.tag }}" @@ -145,7 +143,6 @@ spec: {{- toYaml .Values.ai.resources | nindent 12 }} {{- end }} {{- end }} - volumes: - name: properties-volume secret: diff --git a/charts/intel/values.yaml b/charts/intel/values.yaml index 1053ca9..5587d5f 100644 --- a/charts/intel/values.yaml +++ b/charts/intel/values.yaml @@ -144,15 +144,13 @@ ai: image: repository: hub.edge.codetogether.com/releases/codetogether-llm tag: latest - resources: # Recommended resources configuration - requests: - cpu: "2" - memory: "4Gi" - # gpu: "1" # Uncomment and set only if GPU is needed - limits: - cpu: "4" - memory: "4Gi" - # gpu: "1" # Uncomment and set only if GPU is needed +# resources: # Recommended resources configuration + # requests: + # cpu: "2" + # memory: "4Gi" + #limits: + # cpu: "4" + #memory: "4Gi" readinessProbe: initialDelaySeconds: 60 From 67bde69dd7391c5cad3480542716ba8bffaf44cf Mon Sep 17 00:00:00 2001 From: engineering Date: Mon, 30 Jun 2025 16:17:28 -0600 Subject: [PATCH 2/3] Bump intel chart version to 1.2.5 --- charts/intel/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/intel/Chart.yaml b/charts/intel/Chart.yaml index f3e928a..23c312a 100644 --- a/charts/intel/Chart.yaml +++ b/charts/intel/Chart.yaml @@ -3,7 +3,7 @@ name: codetogether-intel description: CodeTogether Intel provides advanced project insights for developers type: application -version: 1.2.4 +version: 1.2.5 appVersion: "2025.3.0" icon: https://www.codetogether.com/wp-content/uploads/2020/02/codetogether-circle-128.png From ece87b20a9ffcade1191d94a281edcdea7a9e228 Mon Sep 17 00:00:00 2001 From: engineering Date: Mon, 30 Jun 2025 16:39:18 -0600 Subject: [PATCH 3/3] Fix to user http://codetogether-llm:8000/ always --- charts/intel/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/intel/templates/deployment.yaml b/charts/intel/templates/deployment.yaml index a9eb15c..6d1c9a3 100644 --- a/charts/intel/templates/deployment.yaml +++ b/charts/intel/templates/deployment.yaml @@ -79,7 +79,7 @@ spec: {{- if .Values.ai.enabled }} - name: CT_HQ_OLLAMA_AI_URL value: {{ if eq .Values.ai.mode "bundled" }} - "http://localhost:8000" + "http://codetogether-llm:8000" {{ else }} {{ .Values.ai.url | quote }} {{ end }}