Skip to content
11 changes: 11 additions & 0 deletions charts/intel/templates/ai-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if and .Values.ai.enabled (eq .Values.ai.mode "external") }}
apiVersion: v1
kind: ConfigMap
metadata:
name: ai-config
namespace: {{ .Release.Namespace }}
data:
ai_provider: {{ .Values.ai.provider | quote }}
ai_url: {{ .Values.ai.url | quote }}
{{- end }}

12 changes: 12 additions & 0 deletions charts/intel/templates/ai-external-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- $extSecret := (index .Values.ai "externalSecret" | default dict) }}
{{- if and .Values.ai.enabled (eq .Values.ai.mode "external") (or (not $extSecret.name) $extSecret.create) }}
apiVersion: v1
kind: Secret
metadata:
name: {{ $extSecret.name | default (printf "%s-ai-external-secret" (include "codetogether.fullname" .)) }}
namespace: {{ .Release.Namespace }}
type: Opaque
stringData:
api-key: {{ $extSecret.apiKey | quote }}
{{- end }}

109 changes: 46 additions & 63 deletions charts/intel/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,38 +28,20 @@ spec:
{{- end }}
serviceAccountName: {{ include "codetogether.serviceAccountName" . }}
containers:
{{- if .Values.ai.enabled }}
{{- if eq .Values.ai.mode "bundled" }}
- name: codetogether-llm
image: "{{ .Values.ai.image.repository }}:{{ .Values.ai.image.tag }}"
imagePullPolicy: Always
ports:
- name: ai
containerPort: 8000
protocol: TCP
resources:
requests:
cpu: {{ .Values.ai.resources.requests.cpu | quote }}
memory: {{ .Values.ai.resources.requests.memory | quote }}
limits:
cpu: {{ .Values.ai.resources.limits.cpu | quote }}
memory: {{ .Values.ai.resources.limits.memory | quote }}
{{- end }}
{{- end }}
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: AI_MODE
value: {{ .Values.ai.mode | quote }}
{{- if eq .Values.ai.mode "bundled" }}
- name: AI_BUNDLED_URL
value: "http://codetogether-llm:8000"
{{- end }}
{{- if .Values.ai.enabled }}
{{- if eq .Values.ai.mode "external" }}
- name: AI_MODE
value: {{ .Values.ai.mode | quote }}
{{- if eq .Values.ai.mode "bundled" }}
- name: AI_BUNDLED_URL
value: "http://codetogether-llm:8000"
{{- end }}
{{- if .Values.ai.enabled }}
{{- if eq .Values.ai.mode "external" }}
- name: AI_PROVIDER
valueFrom:
configMapKeyRef:
Expand All @@ -73,35 +55,29 @@ spec:
- name: AI_EXTERNAL_API_KEY
valueFrom:
secretKeyRef:
name: ai-external-secret
name: {{ (index .Values.ai "externalSecret" | default dict).name | default (printf "%s-ai-external-secret" (include "codetogether.fullname" .)) }}
key: api-key
{{- end }}
{{- end }}
# Set CodeTogether runtime configuration
- name: CT_HQ_BASE_URL
value: {{ .Values.codetogether.url | quote }}
{{- if .Values.java.customCacerts.enabled }}
- name: CT_TRUST_STORE
value: -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts
{{- end }}
{{- if .Values.java.customJavaOptions }}
- name: CT_JAVA_OPTIONS
value: "{{ .Values.java.customJavaOptions | default "" }}"
{{- end }}
{{- if and .Values.java.customCacerts.enabled .Values.java.customCacerts.trustStorePasswordKey }}
- name: CT_TRUST_STORE_PASSWD
valueFrom:
secretKeyRef:
name: {{ .Values.java.customCacerts.cacertsSecretName }}
key: {{ .Values.java.customCacerts.trustStorePasswordKey }}
optional: true
{{- end }}
{{- end }}
#
# Set CodeTogether runtime configuration
#
- name: CT_HQ_BASE_URL
value: {{ .Values.codetogether.url | quote }}
{{- if .Values.java.customCacerts.enabled }}
- name: CT_TRUST_STORE
value: -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts
{{- end }}

# Custom Java options (excluding trust store related settings)
{{- if .Values.java.customJavaOptions }}
- name: CT_JAVA_OPTIONS
value: "{{ .Values.java.customJavaOptions | default "" }}"
{{- end }}

# Set trust store password only if trustStorePasswordKey is provided
{{- if and .Values.java.customCacerts.enabled .Values.java.customCacerts.trustStorePasswordKey }}
- name: CT_TRUST_STORE_PASSWD
valueFrom:
secretKeyRef:
name: {{ .Values.java.customCacerts.cacertsSecretName }}
key: {{ .Values.java.customCacerts.trustStorePasswordKey }}
optional: true
{{- end }}

volumeMounts:
- name: properties-volume
Expand All @@ -112,29 +88,21 @@ spec:
mountPath: /etc/ssl/certs/java/cacerts
subPath: cacerts
{{- end }}

#
# Set container configuration
#
ports:
- name: http
containerPort: 1080
protocol: TCP

livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
readinessProbe:
httpGet:
path: /
port: http

readinessProbe:
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
Expand All @@ -147,6 +115,21 @@ 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 }}"
imagePullPolicy: Always
ports:
- name: ai
containerPort: 8000
protocol: TCP
{{- if .Values.ai.resources }}
resources:
{{- toYaml .Values.ai.resources | nindent 12 }}
{{- end }}
{{- end }}

volumes:
- name: properties-volume
secret:
Expand Down
5 changes: 2 additions & 3 deletions charts/intel/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,17 @@ securityContext: {}
ai:
enabled: false
mode: "bundled" # Options: bundled | external
provider: "ollama" # No OpenAI dependency
image:
repository: hub.edge.codetogether.com/releases/codetogether-llm
tag: latest
resources:
resources: # Recommended resources configuration
requests:
cpu: "2"
memory: "4Gi"
gpu: false
limits:
cpu: "4"
memory: "8Gi"
memory: "4Gi"
gpu: false

readinessProbe:
Expand Down
Loading