diff --git a/charts/collab/templates/deployment.yaml b/charts/collab/templates/deployment.yaml index 89e46fe..17e1b9b 100644 --- a/charts/collab/templates/deployment.yaml +++ b/charts/collab/templates/deployment.yaml @@ -29,6 +29,12 @@ spec: - name: {{ include "codetogether.fullname" . }}-pull-secret {{- end }} serviceAccountName: {{ include "codetogether.serviceAccountName" . }} + + {{- with .Values.initContainers }} + initContainers: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: - name: {{ .Chart.Name }} securityContext: diff --git a/charts/collab/values.yaml b/charts/collab/values.yaml index 6ab5418..6b514a0 100644 --- a/charts/collab/values.yaml +++ b/charts/collab/values.yaml @@ -212,6 +212,18 @@ serviceAccount: podAnnotations: {} +# Optional: add initContainers (startup containers) to the pod spec. +# Useful to wait for dependencies (e.g., Intel URL reachability, locator DB readiness, etc.) +# before CodeTogether Collab starts. +initContainers: [] +# Example (replace the `[]` above with the list below): +# - name: wait-for-intel +# image: busybox:1.36 +# command: ["sh", "-c"] +# args: +# - > +# until nc -z your-intel-host 443; do echo "Waiting for Intel..."; sleep 2; done + securityContext: {} #defaults # capabilities: # drop: diff --git a/charts/intel/Chart.yaml b/charts/intel/Chart.yaml index 842b88b..2fa000d 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.3.3 +version: 1.3.4 appVersion: "2026.1.2" icon: https://www.codetogether.com/wp-content/uploads/2020/02/codetogether-circle-128.png diff --git a/charts/intel/templates/deployment.yaml b/charts/intel/templates/deployment.yaml index fe23ec7..110b1fd 100644 --- a/charts/intel/templates/deployment.yaml +++ b/charts/intel/templates/deployment.yaml @@ -27,6 +27,12 @@ spec: - name: {{ include "codetogether.fullname" . }}-pull-secret {{- end }} serviceAccountName: {{ include "codetogether.serviceAccountName" . }} + + {{- with .Values.initContainers }} + initContainers: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: - name: {{ .Chart.Name }} securityContext: @@ -169,6 +175,9 @@ spec: {{- toYaml .Values.ai.resources | nindent 12 }} {{- end }} {{- end }} + {{- with .Values.extraContainers }} + {{- toYaml . | nindent 8 }} + {{- end }} volumes: - name: properties-volume secret: diff --git a/charts/intel/values.yaml b/charts/intel/values.yaml index cb6a940..c6f6863 100644 --- a/charts/intel/values.yaml +++ b/charts/intel/values.yaml @@ -133,6 +133,18 @@ serviceAccount: podAnnotations: {} +# Optional: add initContainers (startup containers) to the pod spec. +# Useful to wait for Cassandra or run startup checks before Intel starts. +initContainers: [] +# Example (replace the `[]` above with the list below): +# - name: wait-for-cassandra +# image: busybox:1.36 +# command: ["sh", "-c"] +# args: +# - > +# until nc -z codetogether-cassandra.default.svc.cluster.local 9042; +# do echo "Waiting for Cassandra..."; sleep 2; done + securityContext: {} #defaults # capabilities: # drop: @@ -208,4 +220,6 @@ extraVolumes: [] # subPath: config.yaml extraVolumeMounts: [] +extraContainers: [] + replicaCount: 1 \ No newline at end of file diff --git a/compose/compose.dedicated-keycloak.yaml b/compose/compose.dedicated-keycloak.yaml new file mode 100644 index 0000000..fcf030f --- /dev/null +++ b/compose/compose.dedicated-keycloak.yaml @@ -0,0 +1,25 @@ +services: + # Readiness gate for dedicated/external Keycloak. + # Intel will wait until the realm OIDC metadata endpoint responds successfully. + keycloak-ready: + image: curlimages/curl:8.6.0 + command: ["sh", "-lc", "sleep infinity"] + healthcheck: + test: ["CMD-SHELL", "curl -fsS https://${KEYCLOAK_FQDN}/realms/${KEYCLOAK_REALM}/.well-known/openid-configuration > /dev/null || exit 1"] + interval: 5s + timeout: 3s + retries: 60 + start_period: 10s + networks: + - codetogethernet + + codetogether-intel: + depends_on: + cassandra: + condition: service_healthy + keycloak-ready: + condition: service_healthy + +networks: + codetogethernet: + external: true \ No newline at end of file diff --git a/compose/dedicated-keycloak.md b/compose/dedicated-keycloak.md new file mode 100644 index 0000000..c578175 --- /dev/null +++ b/compose/dedicated-keycloak.md @@ -0,0 +1,28 @@ +# Dedicated / External Keycloak: startup gate for Intel + +This overlay assumes you already have a Keycloak instance running outside of Docker Compose. + +If Keycloak is **not** started by Docker Compose (dedicated/external Keycloak), Intel may start too early. +Use the overlay `compose.dedicated-keycloak.yaml` to make Intel wait until Keycloak is reachable. + +## Required `.env` entries + +Add these to the root `.env` (same directory you pass via `--env-file`): + +```dotenv +KEYCLOAK_FQDN= +KEYCLOAK_REALM= +``` + +`KEYCLOAK_REALM` must match the realm used in your OIDC URLs: +`https:///realms//...` + +## Run + +```bash +docker compose \ + -f compose/compose.yaml \ + -f compose/compose.dedicated-keycloak.yaml \ + --env-file ./.env \ + up --pull always --wait -d +``` \ No newline at end of file