Skip to content

Commit c0c311f

Browse files
danc094codetogetherwgalanciaknmorenorCodeTogetherKeycloak
authored
Main (#173)
* fix: separate SSL certificates (#101) * fix: Set environment variables via .env file. (#99) * Set environment variables via .env file. * Missing change * Change how hostnames and secret are set. * changes for env template * add env variable resolver on sso redirect value * fix: add env_file to codetogether-intel (#105) * fix: missing CT_HQ_BASE_URL env var (#107) * feat: nginx auto config (#109) * fix: add step for sso provider (#110) * fix: add client_max_body_size to intel (#112) * fix: tweak name of dhparam.pem env var (#113) * tweak name of dhparam.pem env var * fix env var name in nginx template * fix pam to pem * fix: missing env file on collab (#114) * fix: handle nil ai.openai.api_key to prevent template er… (#116) * fix(intel-chart): handle nil ai.openai.api_key to prevent template errors Adjusted the Helm chart template for ai-secrets to avoid referencing ai.openai.api_key and ai.external.api_key when undefined. This fixes a fatal error during `helm template` when AI mode is set to `bundled` and no OpenAI config is present. Ensures compatibility with bundled-only deployments. * Changes to fix workflow issues * fix: cleanup for sso tenants (#117) * feat(intel): add option to disable AI integration entirely (#120) Previously, the Helm chart required either 'bundled' or 'external' AI mode to be configured, making it mandatory to include AI integration. This commit introduces a new flag `ai.enabled` to allow disabling AI features entirely, enabling Intel to be deployed without any AI-related containers or resources. * Change gen ai image name on values file (#122) * fix: bump up version number (#123) * docs: remove outdated metrics section from README (#130) - Removed the section referring to metrics(prometeus), etc from the README Co-authored-by: engineering <engineering@codetogether.com> * fix: add note to env-template file (#127) * fix: update LLM image URL to hub.edge (#132) * docs: add deprecation notice to old Live chart (#131) * 126 automatically configure ollama integration when llm is enabled (#128) * Make sidecar AI container resource block optional in deployment - Updated deployment.yaml to include the `resources` block for the `codetogether-llm` sidecar only if values are defined in values.yaml. - Ensures the bundled AI container can run without specifying resource limits/requests by default. - Improved overall Helm template flexibility for embedded AI mode. - Validated that runs with AI Container embeeded. * Enable support for external AI provider - Updated deployment.yaml to support both bundled and external AI modes, allowing selection via .Values.ai.mode. - Added manifests for external AI integration: - ai-config ConfigMap: defines external provider and URL. - ai-external-secret Secret: stores the external API key. - Verified that external AI mode works by routing requests through the configured external service. * feat: automate creation of external AI ConfigMap and Secret from values.yaml - Added Helm templates to generate ai-config ConfigMap and ai-external-secret Secret automatically when AI external mode is enabled. - ConfigMap values (ai_provider, ai_url) and Secret value (api-key) are now configurable via values.yaml. - Ensured resources are only created when ai.enabled=true and ai.mode=external. * feat: allow use of existing or Helm-managed ai-external-secret in deployment - Updated deployment.yaml to support referencing a user-provided Secret for AI external API key, with fallback to Helm-managed creation. - Added ai-external-secret.yaml template to optionally create the secret from values if not provided. * Fixing helm template validations * Adding values configuration --------- Co-authored-by: engineering <engineering@codetogether.com> * Gen AI Changes (#124) * Change resources of ai * Include gen ai on docker compose. * undo changes * Fix collab helm chart to allow usage of locator. (#134) * fix: invalid values in AI values section (#137) * fix: support automatic configuration of the LLM integration if AI is enabled (#138) * Fixes after Testing (#139) * Fixes after Testing - Refactored deployment.yaml to reference ai.externalSecret.name when create: false - Corrected CT_HQ_OLLAMA_AI_API_KEY key to apiKey to match Secret’s stringData - Updated ai-external-secret.yaml to generate a Secret only when create: true * Bump intel chart version to 1.2.5 * Fix to user http://codetogether-llm:8000/ always --------- Co-authored-by: engineering <engineering@codetogether.com> * Changes to use localhost always to avoid dns issues (#142) Co-authored-by: engineering <engineering@codetogether.com> * feat: support for optional keycloak deployment (#145) * initial config * Docker compose example to run keycloak --------- Co-authored-by: Ignacio Moreno <nmorenor@gmail.com> * 144 keycloak (#146) * initial config * Docker compose example to run keycloak * Undo properties file change * fixes on properties file --------- Co-authored-by: Wojciech Galanciak <wojtek@codetogether.com> * 144 keycloak (#147) * initial config * Docker compose example to run keycloak * Undo properties file change * fixes on properties file --------- Co-authored-by: Wojciech Galanciak <wojtek@codetogether.com> * 144 keycloak (#149) * fixes on properties file * Prepare examples for deployment with keycloak. * move files * feat(charts, compose): add CT_TRUST_ALL_CERTS support (#158) * feat(charts, compose): add CT_TRUST_ALL_CERTS support Fixes: #157 - values.yaml: introduce `java.trustAllCerts` (default false) to toggle CT_TRUST_ALL_CERTS - deployment.yaml: inject `CT_TRUST_ALL_CERTS=true` into container env when `trustAllCerts` is enabled - .env-template: add `CT_TRUST_ALL_CERTS` entry for Docker Compose - compose.yml: reference `${CT_TRUST_ALL_CERTS}` in codetogether‑intel service * refactor(charts): move trustAllCerts under codetogether section - values.yaml: remove java.trustAllCerts; add codetogether.trustAllCerts (default false) - deployment.yaml: guard CT_TRUST_ALL_CERTS injection on .Values.codetogether.trustAllCerts * fix(compose): remove redundant CT_TRUST_ALL_CERTS env entry - Drop explicit `CT_TRUST_ALL_CERTS` from the `environment` section in the `codetogether-intel` service - Rely on `env_file: .env` to inject the variable --------- Co-authored-by: engineering <engineering@codetogether.com> * feat(chart): guard `ai-secrets` template behind `ai.enabled` (#161) Fixes: #160 Wrap the `ai-secrets` Secret manifest with a `.Values.ai.enabled` conditional so it is not rendered when AI is disabled. This prevents clashes with pre-existing `ai-secrets` owned by other releases and keeps templates clean. * fix: improve keycloak compose health check (#162) * fix(helm/intel): scope AI resources per-release to avoid cross-release Secret conflicts (#164) Fixes: #163 Problem - Deploying multiple `codetogether-intel` releases in the same namespace caused a collision on statically named resources (e.g., `ai-secrets` / `ai-config`), producing Helm ownership errors. What changed - templates/ai-config.yaml - Create ConfigMap only when `ai.enabled=true` and `ai.mode=external`. - Name is now release-scoped: `{{ .Release.Name }}-ai-config`. - templates/ai-external-secret.yaml - Respect `ai.externalSecret.create` and `ai.externalSecret.name`. - Default Secret name is release-scoped: `{{ include "codetogether.fullname" . }}-ai-external-secret`. - Store API key under `stringData.apiKey`. - templates/deployment.yaml - Read `AI_PROVIDER` / `AI_EXTERNAL_URL` from `{{ .Release.Name }}-ai-config`. - Read `AI_EXTERNAL_API_KEY` from the default or user-specified Secret: `{{ default (printf "%s-ai-external-secret" (include "codetogether.fullname" .)) .Values.ai.externalSecret.name }}`. - Bundled mode unchanged; external resources are not created in bundled mode. Why - Ensures two or more releases (e.g., `qa-intel` and `demo-staging-intel`) can coexist in the same namespace without Helm ownership clashes. How to test - External (chart-managed Secret): `helm template demo-staging-intel ./charts/intel -n default \ --set ai.enabled=true --set ai.mode=external \ --set ai.provider=openai --set ai.url=https://api.openai.com \ --set ai.externalSecret.create=true --set ai.externalSecret.apiKey=TESTKEY` → renders `demo-staging-intel-ai-config` and `demo-staging-intel-ai-external-secret`. - External (existing Secret): `kubectl create secret generic my-custom-ai-secret -n default \ --from-literal=apiKey=TESTKEY` `helm template qa-intel ./charts/intel -n default \ --set ai.enabled=true --set ai.mode=external \ --set ai.provider=openai --set ai.url=https://api.openai.com \ --set ai.externalSecret.create=false --set ai.externalSecret.name=my-custom-ai-secret` → renders only the release-scoped ConfigMap; Deployment references the existing Secret. - Bundled: `helm template demo ./charts/intel -n default --set ai.enabled=true --set ai.mode=bundled` → no AI ConfigMap/Secret rendered; sidecar included. * chore(keycloak): switch to KC_BOOTSTRAP_* admin vars and update compose/templates (#166) Fixes: #165 - Replace deprecated KEYCLOAK_ADMIN / KEYCLOAK_ADMIN_PASSWORD with KC_BOOTSTRAP_ADMIN_USERNAME / KC_BOOTSTRAP_ADMIN_PASSWORD. - Update compose files to pass new env vars to the Keycloak container. - Refresh .env templates to reflect the new names. - Remove references to deprecated vars. Touched: - compose/.env-with-keycloak-template - compose/keycloak/.env-template - compose/keycloak/compose-keycloak.yaml - compose/keycloak/compose-keycloak-no-nginx.yaml Why: eliminates KC-SERVICES0110 warnings and ensures deterministic, persistent admin on first bootstrap. BREAKING CHANGE: set KC_BOOTSTRAP_ADMIN_USERNAME and KC_BOOTSTRAP_ADMIN_PASSWORD instead of KEYCLOAK_ADMIN*. * feat(helm): add RO rootfs support for Intel and Collab (#169) * feat(helm): add RO rootfs support for Intel and Collab Fixes: #168 - tmpfs emptyDir for /run and /tmp - RW runtime at /run/volatile, reuse for /var/log/nginx and /var/cache/nginx - Intel: initContainer to create subpaths - enable via securityContext (readOnlyRootFileSystem, runAsUser=0) * Typo fixes * Typo fixes * Fixing typo * Changes to defauts * Fixes * feat(helm-collab): Support optional existing secret for Intel connection (#171) Fixes: #170 - add values: intelsecret.enabled/ref - conditionally render templates/secret-intel.yaml - deployment envs read from external secret when enabled(fail if ref missing) - default unchanged (chart still creates "release"-intel) --------- Co-authored-by: Wojciech Galanciak <wojtek@codetogether.com> Co-authored-by: Ignacio Moreno <ignacio@codetogether.com> Co-authored-by: engineering <engineering@codetogether.com> Co-authored-by: Ignacio Moreno <nmorenor@gmail.com>
1 parent 0f4189f commit c0c311f

File tree

12 files changed

+119
-31
lines changed

12 files changed

+119
-31
lines changed

charts/collab/templates/deployment.yaml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ spec:
1313
annotations:
1414
checksum/coturn: {{ include (print $.Template.BasePath "/secret-coturn.yaml") . | sha256sum }}
1515
checksum/dashboard: {{ include (print $.Template.BasePath "/secret-dashboard.yaml") . | sha256sum }}
16-
checksum/intel: {{ include (print $.Template.BasePath "/secret-intel.yaml") . | sha256sum }}
16+
checksum/intel: {{- if not .Values.intelsecret.enabled }} {{ include (print $.Template.BasePath "/secret-intel.yaml") . | sha256sum }} {{- else }} "external" {{- end }}
1717
checksum/ssl: {{ include (print $.Template.BasePath "/secret-ssl.yaml") . | sha256sum }}
1818
{{- with .Values.podAnnotations }}
1919
{{- toYaml . | nindent 8 }}
@@ -139,15 +139,27 @@ spec:
139139
value: {{ .Values.codetogether.timeZone.region | quote }}
140140
{{- end }}
141141

142+
{{- if and .Values.intelsecret.enabled (not .Values.intelsecret.ref) }}
143+
{{- fail "intelsecret.enabled=true requires intelsecret.ref (existing Secret name)" -}}
144+
{{- end }}
145+
142146
- name: CT_INTEL_URL
143147
valueFrom:
144148
secretKeyRef:
145-
name: {{ include "codetogether.fullname" . }}-intel
149+
name: {{ if .Values.intelsecret.enabled -}}
150+
{{ .Values.intelsecret.ref | quote }}
151+
{{- else }}
152+
{{ printf "%s-intel" (include "codetogether.fullname" .) | quote }}
153+
{{- end }}
146154
key: url
147155
- name: CT_INTEL_SECRET
148156
valueFrom:
149157
secretKeyRef:
150-
name: {{ include "codetogether.fullname" . }}-intel
158+
name: {{ if .Values.intelsecret.enabled -}}
159+
{{ .Values.intelsecret.ref | quote }}
160+
{{- else }}
161+
{{ printf "%s-intel" (include "codetogether.fullname" .) | quote }}
162+
{{- end }}
151163
key: secret
152164
{{- if .Values.dashboard.enabled }}
153165
- name: CT_DASHBOARD_USER
@@ -182,6 +194,10 @@ spec:
182194
name: codetogether-runtime
183195
- mountPath: /tmp
184196
name: codetogether-tmp
197+
- mountPath: /var/log/nginx
198+
name: codetogether-runtime
199+
- mountPath: /var/cache/nginx
200+
name: codetogether-runtime
185201
{{- if .Values.favicon.enabled }}
186202
- mountPath: /opt/volatile-template/nginx/favicon.ico
187203
name: favicon-volume

charts/collab/templates/secret-intel.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if not .Values.intelsecret.enabled }}
12
apiVersion: v1
23
kind: Secret
34
metadata:
@@ -8,3 +9,4 @@ type: Opaque
89
data:
910
url: {{ .Values.intel.url | b64enc | quote }}
1011
secret: {{ .Values.intel.secret | b64enc | quote }}
12+
{{- end }}

charts/collab/values.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ imageCredentials:
3737
openshift:
3838
enabled: false
3939

40+
# Optional: use an existing secret for Intel connection
41+
intelsecret:
42+
enabled: false # default OFF - chart-managed secret
43+
ref: "" # name of existing Secret (must have keys: url, secret)
44+
4045
#
4146
# Values required for establishing connection with the Intel server.
4247
#
@@ -206,13 +211,13 @@ serviceAccount:
206211

207212
podAnnotations: {}
208213

209-
securityContext: {}
214+
securityContext: {} #defaults to
210215
# capabilities:
211216
# drop:
212217
# - ALL
213-
# readOnlyRootFilesystem: true
214218
# runAsNonRoot: true
215-
# runAsUser: 1000
219+
# readOnlyRootFilesystem: true # enable for read-only setup
220+
# runAsUser: 0 # Use '0' for root user for read-only setup
216221

217222
readinessProbe:
218223
initialDelaySeconds: 60

charts/intel/templates/ai-config.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
apiVersion: v1
33
kind: ConfigMap
44
metadata:
5-
name: ai-config
5+
name: {{ printf "%s-ai-config" (include "codetogether.fullname" .) }}
66
namespace: {{ .Release.Namespace }}
7+
labels:
8+
{{- include "codetogether.labels" . | nindent 4 }}
79
data:
810
ai_provider: {{ .Values.ai.provider | quote }}
911
ai_url: {{ .Values.ai.url | quote }}
10-
{{- end }}
11-
12+
{{- end }}

charts/intel/templates/deployment.yaml

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ spec:
2626
imagePullSecrets:
2727
- name: {{ include "codetogether.fullname" . }}-pull-secret
2828
{{- end }}
29+
{{- if .Values.readOnlyMode.enabled }}
30+
initContainers:
31+
- name: prepare-ro
32+
image: busybox:latest
33+
securityContext:
34+
runAsUser: 0
35+
command: ["sh", "-lc", "mkdir -p /mnt/volatile/var-log-nginx /mnt/volatile/var-cache-nginx /mnt/var/log-codetogether || true"]
36+
volumeMounts:
37+
- name: volatile
38+
mountPath: /mnt/volatile
39+
{{- end }}
2940
serviceAccountName: {{ include "codetogether.serviceAccountName" . }}
3041
containers:
3142
- name: {{ .Chart.Name }}
@@ -44,12 +55,12 @@ spec:
4455
- name: AI_PROVIDER
4556
valueFrom:
4657
configMapKeyRef:
47-
name: ai-config
58+
name: {{ printf "%s-ai-config" (include "codetogether.fullname" .) }}
4859
key: ai_provider
4960
- name: AI_EXTERNAL_URL
5061
valueFrom:
5162
configMapKeyRef:
52-
name: ai-config
63+
name: {{ printf "%s-ai-config" (include "codetogether.fullname" .) }}
5364
key: ai_url
5465
- name: AI_EXTERNAL_API_KEY
5566
valueFrom:
@@ -76,6 +87,10 @@ spec:
7687
key: {{ .Values.java.customCacerts.trustStorePasswordKey }}
7788
optional: true
7889
{{- end }}
90+
{{- if .Values.codetogether.trustAllCerts }}
91+
- name: CT_TRUST_ALL_CERTS
92+
value: "true"
93+
{{- end }}
7994
{{- if .Values.ai.enabled }}
8095
- name: CT_HQ_OLLAMA_AI_URL
8196
value: {{ if eq .Values.ai.mode "bundled" }}
@@ -104,6 +119,20 @@ spec:
104119
mountPath: /etc/ssl/certs/java/cacerts
105120
subPath: cacerts
106121
{{- end }}
122+
{{- if .Values.readOnlyMode.enabled }}
123+
- name: volatile
124+
mountPath: /run/volatile
125+
- name: run
126+
mountPath: /run
127+
- name: tmp
128+
mountPath: /tmp
129+
- name: volatile
130+
mountPath: /var/log/nginx
131+
subPath: var-log-nginx
132+
- name: volatile
133+
mountPath: /var/cache/nginx
134+
subPath: var-cache-nginx
135+
{{- end }}
107136
ports:
108137
- name: http
109138
containerPort: 1080
@@ -152,6 +181,16 @@ spec:
152181
secret:
153182
secretName: {{ .Values.java.customCacerts.cacertsSecretName }}
154183
{{- end }}
184+
{{- if .Values.readOnlyMode.enabled }}
185+
- name: volatile
186+
emptyDir: {}
187+
- name: run
188+
emptyDir:
189+
medium: Memory
190+
- name: tmp
191+
emptyDir:
192+
medium: Memory
193+
{{- end }}
155194
{{- with .Values.nodeSelector }}
156195
nodeSelector:
157196
{{- toYaml . | nindent 8 }}

charts/intel/templates/secrets.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.ai.enabled }}
12
apiVersion: v1
23
kind: Secret
34
metadata:
@@ -14,3 +15,4 @@ data:
1415
external-ai-key: {{ .Values.ai.external.api_key | b64enc }}
1516
{{- end }}
1617
{{- end }}
18+
{{- end }}

charts/intel/values.yaml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@ imageCredentials:
3232
email: unused
3333

3434
#
35-
# Set CodeTogether runing mode and server's FQDN (HTTPS is mandatory for CodeTogether)
35+
# Set CodeTogether running mode and server's FQDN (HTTPS is mandatory for CodeTogether)
3636
# Use 'direct' for simple evaluations and small deployments. CodeTogether can provide
3737
# guidance on the best deployment option based on your needs.
3838
#
3939
codetogether:
4040
url: https://<server-fqdn>
41+
trustAllCerts: false # Set to 'true' to trust all certificates
42+
4143

4244
hqproperties:
4345
hq.sso.client.id: CLIENTID.apps.googleusercontent.com
@@ -130,20 +132,26 @@ serviceAccount:
130132

131133
podAnnotations: {}
132134

133-
securityContext: {}
135+
securityContext: {} #defaults to
136+
134137
# capabilities:
135138
# drop:
136139
# - ALL
137-
# readOnlyRootFilesystem: true
140+
#readOnlyRootFilesystem: true # enable for read-only setup
141+
#runAsUser: 0 # Use '0' for root user for read-only setup
138142
# runAsNonRoot: true
139143
# runAsUser: 1000
140144

141145
ai:
142146
enabled: false
143147
mode: "bundled" # Options: bundled | external
144-
image:
145-
repository: hub.edge.codetogether.com/releases/codetogether-llm
146-
tag: latest
148+
provider: ""
149+
url: ""
150+
modelName: "gemma3:1b"
151+
externalSecret:
152+
create: false
153+
name: ""
154+
apiKey: ""
147155
# resources: # Recommended resources configuration
148156
# requests:
149157
# cpu: "2"
@@ -173,3 +181,6 @@ tolerations: []
173181
affinity: {}
174182

175183
replicaCount: 1
184+
185+
readOnlyMode:
186+
enabled: false # Set to 'true' to enable read-only mode

compose/.env-template

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,7 @@ DHPARAM_PEM=dhparam.pem
5151
# Uncomment the following lines to enable AI integration with Ollama
5252
#CT_HQ_OLLAMA_AI_URL=http://codetogether-llm:8000
5353
#CT_HQ_OLLAMA_AI_MODEL_NAME=gemma3:1b
54+
55+
# Enable “to trust all certificates”
56+
CT_TRUST_ALL_CERTS=false
57+

compose/.env-with-keycloak-template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ SSL_KEYCLOAK_KEY=ssl-keycloak.key
5555
KEYCLOAK_DB_USERNAME=keycloak
5656
KEYCLOAK_DB_PASSWORD=keycloak
5757

58-
KEYCLOAK_ADMIN_PASSWORD=keycloak
59-
KEYCLOAK_ADMIN=admin
58+
KC_BOOTSTRAP_ADMIN_PASSWORD=keycloak
59+
KC_BOOTSTRAP_ADMIN_USERNAME=admin
6060

6161
# Uncomment the following lines to enable AI integration with Ollama
6262
#CT_HQ_OLLAMA_AI_URL=http://codetogether-llm:8000

compose/keycloak/.env-template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ SSL_KEYCLOAK_KEY=ssl-keycloak.key
55
KEYCLOAK_DB_USERNAME=keycloak
66
KEYCLOAK_DB_PASSWORD=keycloak
77

8-
KEYCLOAK_ADMIN_PASSWORD=keycloak
9-
KEYCLOAK_ADMIN=admin
8+
KC_BOOTSTRAP_ADMIN_PASSWORD=keycloak
9+
KC_BOOTSTRAP_ADMIN_USERNAME=admin

0 commit comments

Comments
 (0)