diff --git a/.github/workflows/helm-template-check.yml b/.github/workflows/helm-template-check.yml index f1e6b86..cba910c 100644 --- a/.github/workflows/helm-template-check.yml +++ b/.github/workflows/helm-template-check.yml @@ -23,6 +23,34 @@ jobs: - name: Validate Collab Chart run: | helm template collab ./charts/collab --values ./charts/collab/values.yaml + # Gateway API: HTTPRoute on an existing Gateway listener + helm template collab ./charts/collab --values ./charts/collab/values.yaml \ + --set ingress.enabled=false \ + --set gateway.enabled=true \ + --set 'gateway.parentRefs[0].name=shared-gateway' \ + --set 'gateway.parentRefs[0].namespace=gateway-system' \ + --api-versions gateway.networking.k8s.io/v1/HTTPRoute + # ListenerSet on a shared Gateway; the HTTPRoute attaches to it + helm template collab ./charts/collab --values ./charts/collab/values.yaml \ + --set ingress.enabled=false \ + --set gateway.enabled=true \ + --set gateway.listenerSet.enabled=true \ + --set gateway.listenerSet.parentRef.name=shared-gateway \ + --set gateway.listenerSet.parentRef.namespace=gateway-system \ + --api-versions gateway.networking.k8s.io/v1/HTTPRoute \ + --api-versions gateway.networking.k8s.io/v1/ListenerSet \ + > /tmp/collab-listenerset.yaml + grep -q '^kind: ListenerSet$' /tmp/collab-listenerset.yaml + grep -q 'kind: ListenerSet$' <(sed -n '/^kind: HTTPRoute$/,/^---/p' /tmp/collab-listenerset.yaml) + # listenerSet without gateway.enabled must fail instead of rendering nothing + if helm template collab ./charts/collab --values ./charts/collab/values.yaml \ + --set gateway.listenerSet.enabled=true \ + --set gateway.listenerSet.parentRef.name=shared-gateway > /tmp/collab-ls-no-gw.out 2>&1; then + echo "listenerSet without gateway.enabled rendered" >&2; exit 1 + fi + grep -q 'requires gateway.enabled=true' /tmp/collab-ls-no-gw.out + # helm upgrade --reuse-values from a chart without `gateway` drops the key + helm template collab ./charts/collab --values ./charts/collab/values.yaml --set gateway=null - name: Validate HQ Chart run: | @@ -85,6 +113,82 @@ jobs: --set imageCredentials.username=test \ --set imageCredentials.password=test \ --set gateway=null + # Read-only root filesystem: an emptyDir on each writable directory by + # default; the previous layout for ro=false, an image older than the first + # one that supports it, and --reuse-values from a chart before 0.2.5. + ai_ro() { + helm template test ./charts/ai \ + --set-file ctaiPropertiesFile=./charts/ai/ctai-configuration.properties.template \ + --set service.fqdn=https://example.codetogether.io \ + --set imageCredentials.username=test \ + --set imageCredentials.password=test \ + --show-only templates/deployment.yaml "$@" + } + ro_min="$(sed -n '/define "ctai.readOnlyRootFilesystemMinImage"/{n;p}' ./charts/ai/templates/_helpers.tpl)" + if ! [[ "$ro_min" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Set ctai.readOnlyRootFilesystemMinImage to the first release that runs read-only (got $ro_min)" >&2; exit 1 + fi + app_version="$(sed -n 's/^appVersion: "\(.*\)"$/\1/p' ./charts/ai/Chart.yaml)" + if [ "$(printf '%s\n%s\n' "$ro_min" "$app_version" | sort -V | head -1)" != "$ro_min" ]; then + echo "appVersion $app_version is older than ctai.readOnlyRootFilesystemMinImage $ro_min" >&2; exit 1 + fi + out="$(ai_ro)" + grep -q 'readOnlyRootFilesystem: true' <<<"$out" + [ "$(grep -c 'name: writable-' <<<"$out")" = 10 ] + for args in "--set securityContext.readOnlyRootFilesystem=false" \ + "--set image.tag=1.0.0" \ + "--set image.tag=1.0.0-hotfix" \ + "--set securityContext.readOnlyRootFilesystem=null --set writableDirectories=null"; do + # shellcheck disable=SC2086 + out="$(ai_ro $args)" + grep -q 'readOnlyRootFilesystem: false' <<<"$out" + if grep -q 'name: writable-' <<<"$out"; then echo "writable volumes with $args" >&2; exit 1; fi + done + # A customer volume instead of one writable directory, and the refusals. + out="$(ai_ro --set writableDirectories.logs.enabled=false \ + --set 'extraVolumes[0].name=logs' --set 'extraVolumes[0].persistentVolumeClaim.claimName=logs' \ + --set 'extraVolumeMounts[0].name=logs' --set 'extraVolumeMounts[0].mountPath=/opt/ctai/logs/')" + grep -q 'claimName: logs' <<<"$out" + if grep -q 'name: writable-logs' <<<"$out"; then echo "writable-logs mounted while disabled" >&2; exit 1; fi + [ "$(grep -c 'name: writable-' <<<"$out")" = 8 ] + ai_ro_fails() { + local pattern="$1"; shift + if ai_ro "$@" > /tmp/ro.out 2>&1; then echo "rendered: $*" >&2; exit 1; fi + grep -q "$pattern" /tmp/ro.out || { cat /tmp/ro.out >&2; exit 1; } + } + ai_ro_fails 'which writableDirectories.logs already mounts' \ + --set 'extraVolumes[0].name=logs' --set 'extraVolumes[0].emptyDir.medium=Memory' \ + --set 'extraVolumeMounts[0].name=logs' --set 'extraVolumeMounts[0].mountPath=/opt/ctai/logs/' + ai_ro_fails 'extraVolumes has a volume named writable-logs' \ + --set 'extraVolumes[0].name=writable-logs' --set 'extraVolumes[0].emptyDir.medium=Memory' \ + --set 'extraVolumeMounts[0].name=writable-logs' --set 'extraVolumeMounts[0].mountPath=/data' + ai_ro_fails 'writableDirectories.systemTmp is disabled but nothing is mounted on /tmp' \ + --set writableDirectories.systemTmp.enabled=false + ai_ro_fails 'both mount /opt/ctai/www' --set writableDirectories.runtime.mountPath=/opt/ctai/www + ai_ro_fails 'must be an absolute path' --set writableDirectories.www.mountPath=opt/ctai/www + ai_ro_fails 'must be true or false' --set-string securityContext.readOnlyRootFilesystem=false + ai_ro_fails 'writableDirectories.logs must be a map' --set writableDirectories.logs=false + # Rollout strategy: the default, what --reuse-values from a chart + # before 0.2.4 leaves (no deploymentStrategy), and a Recreate override. + ai_strategy() { + helm template test ./charts/ai \ + --set-file ctaiPropertiesFile=./charts/ai/ctai-configuration.properties.template \ + --set service.fqdn=https://example.codetogether.io \ + --set imageCredentials.username=test \ + --set imageCredentials.password=test \ + --show-only templates/deployment.yaml "$@" \ + | sed -n '/^ strategy:$/,/^ selector:$/p' + } + default_strategy="$(ai_strategy)" + grep -q 'type: RollingUpdate' <<<"$default_strategy" + grep -q 'maxSurge: 0' <<<"$default_strategy" + grep -q 'maxUnavailable: 1' <<<"$default_strategy" + [ "$(ai_strategy --set deploymentStrategy=null)" = "$default_strategy" ] + recreate_strategy="$(ai_strategy --set deploymentStrategy.type=Recreate --set deploymentStrategy.rollingUpdate=null)" + grep -q 'type: Recreate' <<<"$recreate_strategy" + if grep -q 'rollingUpdate' <<<"$recreate_strategy"; then + echo "Recreate rendered rollingUpdate" >&2; exit 1 + fi - name: Validate Live Chart run: | diff --git a/charts/ai/Chart.yaml b/charts/ai/Chart.yaml index aa3b426..ca9144e 100644 --- a/charts/ai/Chart.yaml +++ b/charts/ai/Chart.yaml @@ -3,8 +3,8 @@ name: codetogether-ai description: CodeTogether AI on-premises Kubernetes deployment type: application -version: 0.2.3 -appVersion: "1.2.8616" +version: 0.2.5 +appVersion: "1.2.8821" icon: https://www.codetogether.com/wp-content/uploads/2020/02/codetogether-circle-128.png home: https://www.codetogether.com diff --git a/charts/ai/README.md b/charts/ai/README.md index 92685be..2494e47 100644 --- a/charts/ai/README.md +++ b/charts/ai/README.md @@ -311,6 +311,9 @@ The following table lists the primary configurable parameters and defaults. | `readinessProbe.path` | Readiness endpoint on port 1080 | `/healthz` | | `livenessProbe.path` | Liveness endpoint on port 8080 | `/actuator/health` | | `startupProbe.enabled` | Enable startup probe | `true` | +| `securityContext.readOnlyRootFilesystem` | Run with a read-only root filesystem; the container writes only to `writableDirectories`. See [Read-only root filesystem](#read-only-root-filesystem) | `true` | +| `writableDirectories..enabled` | Mount an `emptyDir` on that directory (`runtime`, `www`, `logs`, `tmp`, `systemTmp`); `false` to mount your own volume there | `true` | +| `writableDirectories..sizeLimit` | Optional `emptyDir` size limit (for example `2Gi`); the pod is evicted when it is exceeded | `""` | `image.tag` controls which container image the Deployment pulls at install or upgrade time. `appVersion` in `Chart.yaml` is chart metadata only; it does not @@ -374,6 +377,121 @@ If login fails after returning from Google or another identity provider with and that the registered OAuth redirect URI exactly matches `{service_fqdn}/api/v1/auth/sso/provider/callback`. +### What the container image contains + +The image is built on [Wolfi](https://github.com/wolfi-dev), a minimal Linux +distribution, and runs as the non-root user `ctai` (uid and gid `2200`). + +- Shell and tools: `bash`, BusyBox `sh` (`/bin/sh`), `curl`, `ps`, `top`, + `ping`, `netstat`, `vi`, `less`, and the GNU core utilities. `ss`, `ip`, + `openssl` and `dig` are not included. +- Java: OpenJDK 25 with its tools (`jcmd`, `jstack`, `jmap`, `jfr`, + `keytool`). `JAVA_HOME` is `/usr/lib/jvm/default-jvm`, and the JDK's trust + store is `/etc/ssl/certs/java/cacerts`. +- Packages: the package manager is `apk`. It needs root, so it cannot install + anything in the running container. An image built `FROM` this one installs + packages with `apk add` as root before switching back to `USER 2200`. + +### Inspect a running pod + +`kubectl exec` is enough for the tools above: + +```bash +kubectl exec -it -n codetogether-ai deploy/codetogether-ai -c codetogether-ai -- bash +``` + +For a tool the image does not have, attach an ephemeral debug container. It +shares the application's process namespace and network, so it sees the Java +process, its files under `/proc//root` and `localhost`, and nothing +restarts. Use kubectl 1.32 or later, and any image your cluster can pull: + +```bash +POD=$(kubectl get pod -n codetogether-ai -l app.kubernetes.io/name=codetogether-ai -o name | head -1) +kubectl debug -it -n codetogether-ai "$POD" \ + --image= \ + --target=codetogether-ai --profile=general -c debug -- sh +``` + +If the namespace enforces the Pod Security `restricted` profile, which does not +allow a root debug container, use the CodeTogether AI image itself as the debug +image and run it as the application's user. The image names its user (`ctai`), +so the numeric uid has to be given: + +```bash +echo '{"securityContext":{"runAsUser":2200,"runAsGroup":2200}}' > uid2200.json +IMAGE=$(kubectl get "$POD" -n codetogether-ai -o jsonpath='{.spec.containers[0].image}') +kubectl debug -it -n codetogether-ai "$POD" --image="$IMAGE" \ + --target=codetogether-ai --profile=restricted --custom=uid2200.json \ + -c debug-app -- bash +``` + +An ephemeral container stays in the pod's spec until the pod is replaced, and +each one needs a new name (`-c`). The process environment and the mounted +properties file contain secrets: do not paste them into tickets or chat. + +### Read-only root filesystem + +From chart 0.2.5 the container runs with `readOnlyRootFilesystem: true`: the +image's binaries, scripts and configuration cannot be changed from inside the +pod. It writes only to these directories, each an `emptyDir` that lives as long +as the pod (`writableDirectories`): + +| Name | Path | What | +|---|---|---| +| `runtime` | `/opt/ctai/runtime` | Artifacts unpacked at start with the server URL injected into the IDE plugins (about 200 MB), and the YAML generated from the properties file (`config/ctai-configuration.yml`) | +| `www` | `/opt/ctai/www` | nginx's document root: the portal and metric lineage | +| `logs` | `/opt/ctai/logs` | `server.log`, the nginx logs, heap dumps (the newest is kept) | +| `tmp` | `/opt/ctai/tmp` | nginx's pid file and temp files | +| `systemTmp` | `/tmp` | JVM and Tomcat temp files | + +A container restart keeps them, and reuses the unpacked artifacts; a new pod +starts empty. To keep logs on a volume of your own, turn that directory over to +it: + +```yaml +writableDirectories: + logs: + enabled: false +extraVolumes: + - name: ctai-logs + persistentVolumeClaim: + claimName: ctai-logs +extraVolumeMounts: + - name: ctai-logs + mountPath: /opt/ctai/logs +``` + +The chart refuses: +- a volume in `extraVolumeMounts` on a path a writable directory already mounts; +- a disabled writable directory with no volume of yours on its path, which would be read-only; +- two writable directories on one path; +- a volume in `extraVolumes` named like the volume of an enabled writable + directory (`writable-logs`, `writable-system-tmp`, …): rename yours; +- `readOnlyRootFilesystem` as a string (`"true"` or `"false"`): it must be a boolean. + +Paths are compared after cleaning, so `/opt/ctai/logs/` is `/opt/ctai/logs`. + +**When the previous layout is used.** With the previous layout there are no +`writableDirectories`, and the container writes to its own layer. The chart +uses it: +- when `securityContext.readOnlyRootFilesystem` is `false`. Set that if a + pre-start hook (`/opt/ctai/hooks/pre-start.d`) writes outside these + directories. +- when `image.tag` (or `appVersion`, when the tag is empty) names an image + older than 1.2.8793, the first one that supports a read-only root filesystem. Older + images crash-loop under it. `helm install` prints a warning when this + happens. A tag that is not a version, such as `latest`, or an `image.digest`, + is taken as supporting it. +- after `helm upgrade --reuse-values` from a chart before 0.2.5, whose values + have no `readOnlyRootFilesystem`. Add + `--set securityContext.readOnlyRootFilesystem=true` to turn it on. + +**Upgrading from 0.2.4 with a volume of your own on one of these paths** (for +example a PVC on `/opt/ctai/logs` in `extraVolumeMounts`): `helm upgrade` stops +with "extraVolumeMounts mounts /opt/ctai/logs, which writableDirectories.logs +already mounts". Add `--set writableDirectories.logs.enabled=false` (or the +same in your values file) and run it again; your volume keeps that path. + ## Upgrade ```bash @@ -399,6 +517,51 @@ helm upgrade codetogether-ai codetogether/codetogether-ai \ The Deployment rolls when the chart-managed properties Secret changes. +### Rollout strategy + +From chart 0.2.4 the Deployment stops the old pod before it starts the new one +(`deploymentStrategy`: `RollingUpdate` with `maxSurge: 0`, `maxUnavailable: 1`). +On a single replica an upgrade therefore has a short outage while the new pod +starts. Earlier charts used the Kubernetes default, which starts the new pod +first. + +The pods of one release share an embedded Hazelcast cluster, and a pod only +joins a cluster that runs its own Hazelcast minor version. When a release +changes that version (the release notes say so), any old pod still running +makes the new pod fail to join: its container exits and restarts in a loop, and +the rollout never completes while the old pods keep serving. `helm upgrade` +without `--wait` still prints `deployed`; `kubectl rollout status` shows the +stall. + +- **One replica:** the default strategy handles it, as long as the release was + upgraded to chart 0.2.4 or later. Upgrade the chart and the image in the same + `helm upgrade`, as above. +- **More than one replica:** upgrade across a Hazelcast version with + `Recreate`, which stops every old pod first (a short outage): + + ```bash + helm upgrade codetogether-ai codetogether/codetogether-ai \ + --namespace codetogether-ai \ + --reset-then-reuse-values \ + --set deploymentStrategy.type=Recreate \ + --set deploymentStrategy.rollingUpdate=null + ``` + + `rollingUpdate=null` is required: Helm merges overrides into the existing + values, and Kubernetes rejects `Recreate` while `rollingUpdate` is set. The + same command completes a rollout that has already stalled. + `--reset-then-reuse-values` keeps `Recreate` for later upgrades; to return to + the default on a later upgrade, add (Helm 3.10 or later) + `--set-json 'deploymentStrategy={"type":"RollingUpdate","rollingUpdate":{"maxSurge":0,"maxUnavailable":1}}'`. + +If a rollout has already stalled on a chart older than 0.2.4, switch the +Deployment to `Recreate` directly: + +```bash +kubectl -n codetogether-ai patch deployment codetogether-ai \ + -p '{"spec":{"strategy":{"type":"Recreate","rollingUpdate":null}}}' +``` + ## Uninstall ```bash diff --git a/charts/ai/templates/NOTES.txt b/charts/ai/templates/NOTES.txt index 92bc7b7..9c7336f 100644 --- a/charts/ai/templates/NOTES.txt +++ b/charts/ai/templates/NOTES.txt @@ -67,3 +67,12 @@ Gateway API: serve this host. Set ingress.enabled=false once the Gateway path works. {{- end }} {{- end }} +{{- if and (eq (include "ctai.readOnlyRootFilesystemRequested" .) "true") (eq (include "ctai.imageTooOldForReadOnlyRoot" .) "true") }} + +WARNING: image {{ .Values.image.tag | default .Chart.AppVersion }} is older than {{ include "ctai.readOnlyRootFilesystemMinImage" . }}, the first image that +runs with a read-only root filesystem, so this release runs with the previous +layout (a writable root filesystem). Use a newer image to get it. +{{- else if not (eq (include "ctai.readOnlyRootFilesystem" .) "true") }} + +Read-only root filesystem: off (securityContext.readOnlyRootFilesystem is not true). +{{- end }} diff --git a/charts/ai/templates/_helpers.tpl b/charts/ai/templates/_helpers.tpl index bdac465..d1f3b69 100644 --- a/charts/ai/templates/_helpers.tpl +++ b/charts/ai/templates/_helpers.tpl @@ -216,6 +216,206 @@ Fail helm template when properties contain unfilled values or URL {{- end -}} {{- end -}} {{- $_ := include "ctai.serviceFqdn" . -}} +{{- $_ = include "ctai.validateWritableDirectories" . -}} +{{- end }} + +{{/* +The first image version whose start-ctai runs on a read-only root filesystem. +Older images remove /opt/ctai/www (a mount point here) and write next to the +properties file, so they crash-loop under it. +*/}} +{{- define "ctai.readOnlyRootFilesystemMinImage" -}} +1.2.8793 +{{- end }} + +{{/* +"true" when the container runs with a read-only root filesystem: +securityContext.readOnlyRootFilesystem is true and the image is not older than +ctai.readOnlyRootFilesystemMinImage. The image's version is image.tag, or the +chart's appVersion when the tag is empty; a tag that is not a version (latest) or +a digest is taken as supporting it. --reuse-values from a chart before 0.2.5 has +no readOnlyRootFilesystem, so it keeps the previous layout. +*/}} +{{- define "ctai.readOnlyRootFilesystem" -}} +{{- if and (eq (include "ctai.readOnlyRootFilesystemRequested" .) "true") (eq (include "ctai.imageTooOldForReadOnlyRoot" .) "false") -}} +true +{{- else -}} +false +{{- end -}} +{{- end }} + +{{/* +"true" when securityContext.readOnlyRootFilesystem is true (validateWritableDirectories +refuses anything but a boolean). +*/}} +{{- define "ctai.readOnlyRootFilesystemRequested" -}} +{{- if eq ((.Values.securityContext | default dict).readOnlyRootFilesystem) true -}} +true +{{- else -}} +false +{{- end -}} +{{- end }} + +{{/* +"true" when the image is a version older than ctai.readOnlyRootFilesystemMinImage. +The version is the tag's leading x.y.z, so 1.2.8000-hotfix counts as 1.2.8000. +*/}} +{{- define "ctai.imageTooOldForReadOnlyRoot" -}} +{{- $image := .Values.image | default dict -}} +{{- $tag := toString ($image.tag | default .Chart.AppVersion) -}} +{{- $version := regexFind "^[0-9]+\\.[0-9]+\\.[0-9]+" (trimPrefix "v" $tag) -}} +{{- /* Nested ifs, not and: Helm before 3.10 evaluates every argument of and, + and semverCompare fails on an empty version. */ -}} +{{- $tooOld := false -}} +{{- if and (not $image.digest) $version -}} +{{- if semverCompare (printf "< %s" (include "ctai.readOnlyRootFilesystemMinImage" .)) $version -}} +{{- $tooOld = true -}} +{{- end -}} +{{- end -}} +{{- $tooOld -}} +{{- end }} + +{{/* +writableDirectories with the chart defaults underneath, as YAML: --reuse-values +from a chart before 0.2.5 has none. +*/}} +{{- define "ctai.writableDirectories" -}} +{{- $defaults := dict + "runtime" (dict "enabled" true "mountPath" "/opt/ctai/runtime" "sizeLimit" "") + "www" (dict "enabled" true "mountPath" "/opt/ctai/www" "sizeLimit" "") + "logs" (dict "enabled" true "mountPath" "/opt/ctai/logs" "sizeLimit" "") + "tmp" (dict "enabled" true "mountPath" "/opt/ctai/tmp" "sizeLimit" "") + "systemTmp" (dict "enabled" true "mountPath" "/tmp" "sizeLimit" "") -}} +{{- toYaml (mergeOverwrite $defaults (deepCopy (.Values.writableDirectories | default dict))) -}} +{{- end }} + +{{/* +writableDirectories: every enabled entry needs an absolute mountPath and a +volume name (writable-) that no extraVolumes entry uses, no two +volumes may be mounted on the same path (Kubernetes rejects the pod, or compares +the paths as strings and lets one volume hide the other, and neither error names +the chart value nor the fix), and a disabled entry needs a volume of the +customer's in extraVolumeMounts, since the path is read-only otherwise. Paths are +compared after path.Clean, so /opt/ctai/logs/ is /opt/ctai/logs. +*/}} +{{- define "ctai.validateWritableDirectories" -}} +{{- $ro := (.Values.securityContext | default dict).readOnlyRootFilesystem -}} +{{- if and (not (kindIs "invalid" $ro)) (not (kindIs "bool" $ro)) -}} +{{- fail (printf "securityContext.readOnlyRootFilesystem must be true or false, got %q (a string): set it without quotes, or with --set rather than --set-string" (toString $ro)) -}} +{{- end -}} +{{- if eq (include "ctai.readOnlyRootFilesystem" .) "true" -}} +{{- $seen := dict -}} +{{- $extra := dict -}} +{{- range .Values.extraVolumeMounts -}} +{{- $_ := set $extra (clean (toString .mountPath)) true -}} +{{- end -}} +{{- $volumeNames := dict -}} +{{- $extraVolumeNames := dict -}} +{{- range .Values.extraVolumes -}} +{{- $_ := set $extraVolumeNames (toString .name) true -}} +{{- end -}} +{{- range $name, $dir := (include "ctai.writableDirectories" . | fromYaml) -}} +{{- if not (kindIs "map" $dir) -}} +{{- fail (printf "writableDirectories.%s must be a map (enabled, mountPath, sizeLimit), got %v: to mount your own volume there, set writableDirectories.%s.enabled=false" $name $dir $name) -}} +{{- end -}} +{{- $volumeName := printf "writable-%s" ($name | kebabcase) -}} +{{- if hasKey $volumeNames $volumeName -}} +{{- fail (printf "writableDirectories.%s and writableDirectories.%s both make the volume name %s: rename one" (get $volumeNames $volumeName) $name $volumeName) -}} +{{- end -}} +{{- $_ := set $volumeNames $volumeName $name -}} +{{- $path := toString $dir.mountPath -}} +{{- if not (hasPrefix "/" $path) -}} +{{- fail (printf "writableDirectories.%s.mountPath must be an absolute path, got %q" $name $path) -}} +{{- end -}} +{{- $path = clean $path -}} +{{- if include "ctai.writableDirectoryEnabled" $dir -}} +{{- if hasKey $extraVolumeNames $volumeName -}} +{{- fail (printf "extraVolumes has a volume named %s, the name of the volume writableDirectories.%s makes: rename yours (and its extraVolumeMounts entry)" $volumeName $name) -}} +{{- end -}} +{{- if hasKey $seen $path -}} +{{- fail (printf "writableDirectories.%s and writableDirectories.%s both mount %s" (get $seen $path) $name $path) -}} +{{- end -}} +{{- $_ := set $seen $path $name -}} +{{- else if not (hasKey $extra $path) -}} +{{- fail (printf "writableDirectories.%s is disabled but nothing is mounted on %s, which is read-only then: mount your own volume there with extraVolumes and extraVolumeMounts, or set securityContext.readOnlyRootFilesystem=false" $name $path) -}} +{{- end -}} +{{- end -}} +{{- range .Values.extraVolumeMounts -}} +{{- $path := clean (toString .mountPath) -}} +{{- if hasKey $seen $path -}} +{{- fail (printf "extraVolumeMounts mounts %s, which writableDirectories.%s already mounts: set writableDirectories.%s.enabled=false to use your own volume there" .mountPath (get $seen $path) (get $seen $path)) -}} +{{- end -}} +{{- end -}} +{{- end -}} +{{- end }} + +{{/* +"true" (or empty) for a writableDirectories entry: enabled, or no enabled key. +*/}} +{{- define "ctai.writableDirectoryEnabled" -}} +{{- if or (not (hasKey . "enabled")) (eq .enabled true) -}} +true +{{- end -}} +{{- end }} + +{{/* +The container's securityContext, with readOnlyRootFilesystem as +ctai.readOnlyRootFilesystem resolves it. +*/}} +{{- define "ctai.containerSecurityContext" -}} +{{- $ctx := deepCopy (.Values.securityContext | default dict) -}} +{{- $_ := set $ctx "readOnlyRootFilesystem" (eq (include "ctai.readOnlyRootFilesystem" .) "true") -}} +{{- toYaml $ctx -}} +{{- end }} + +{{/* +The container's volumeMounts: the properties file, the writableDirectories (only +with a read-only root filesystem), then extraVolumeMounts. Empty when there are none. +*/}} +{{- define "ctai.volumeMounts" -}} +{{- if eq (include "ctai.propertiesEnabled" .) "true" }} +- name: ctai-properties + mountPath: {{ include "ctai.propertiesFilePath" . }} + subPath: {{ .Values.properties.fileName }} + readOnly: true +{{- end }} +{{- if eq (include "ctai.readOnlyRootFilesystem" .) "true" }} +{{- range $name, $dir := (include "ctai.writableDirectories" . | fromYaml) }} +{{- if include "ctai.writableDirectoryEnabled" $dir }} +- name: writable-{{ $name | kebabcase }} + mountPath: {{ $dir.mountPath }} +{{- end }} +{{- end }} +{{- end }} +{{- with .Values.extraVolumeMounts }} +{{ toYaml . }} +{{- end }} +{{- end }} + +{{/* +The pod's volumes, matching ctai.volumeMounts. Empty when there are none. +*/}} +{{- define "ctai.volumes" -}} +{{- if eq (include "ctai.propertiesEnabled" .) "true" }} +- name: ctai-properties + secret: + secretName: {{ include "ctai.propertiesSecretName" . }} +{{- end }} +{{- if eq (include "ctai.readOnlyRootFilesystem" .) "true" }} +{{- range $name, $dir := (include "ctai.writableDirectories" . | fromYaml) }} +{{- if include "ctai.writableDirectoryEnabled" $dir }} +- name: writable-{{ $name | kebabcase }} + emptyDir: + {{- if $dir.sizeLimit }} + sizeLimit: {{ $dir.sizeLimit }} + {{- else }} {} + {{- end }} +{{- end }} +{{- end }} +{{- end }} +{{- with .Values.extraVolumes }} +{{ toYaml . }} +{{- end }} {{- end }} {{/* diff --git a/charts/ai/templates/deployment.yaml b/charts/ai/templates/deployment.yaml index dd87f27..c340b22 100644 --- a/charts/ai/templates/deployment.yaml +++ b/charts/ai/templates/deployment.yaml @@ -7,6 +7,10 @@ metadata: {{- include "ctai.labels" . | nindent 4 }} spec: replicas: {{ .Values.replicaCount }} + {{- /* Read through default: --reuse-values from a chart before 0.2.4 has no deploymentStrategy. */}} + {{- $strategy := .Values.deploymentStrategy | default (dict "type" "RollingUpdate" "rollingUpdate" (dict "maxSurge" 0 "maxUnavailable" 1)) }} + strategy: + {{- toYaml $strategy | nindent 4 }} selector: matchLabels: {{- include "ctai.selectorLabels" . | nindent 6 }} @@ -44,7 +48,7 @@ spec: containers: - name: {{ .Chart.Name }} securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} + {{- include "ctai.containerSecurityContext" . | nindent 12 }} image: "{{ .Values.image.repository }}{{ if .Values.image.digest }}@{{ .Values.image.digest }}{{ else }}:{{ .Values.image.tag | default .Chart.AppVersion }}{{ end }}" imagePullPolicy: {{ .Values.image.pullPolicy }} env: @@ -79,18 +83,9 @@ spec: {{- with .Values.extraEnvVars }} {{- toYaml . | nindent 12 }} {{- end }} - {{- if eq (include "ctai.propertiesEnabled" .) "true" }} + {{- with (include "ctai.volumeMounts" . | trim) }} volumeMounts: - - name: ctai-properties - mountPath: {{ include "ctai.propertiesFilePath" . }} - subPath: {{ .Values.properties.fileName }} - readOnly: true - {{- with .Values.extraVolumeMounts }} - {{- toYaml . | nindent 12 }} - {{- end }} - {{- else if .Values.extraVolumeMounts }} - volumeMounts: - {{- toYaml .Values.extraVolumeMounts | nindent 12 }} + {{- . | nindent 12 }} {{- end }} ports: - name: http @@ -134,17 +129,9 @@ spec: {{- with .Values.extraContainers }} {{- toYaml . | nindent 8 }} {{- end }} - {{- if eq (include "ctai.propertiesEnabled" .) "true" }} - volumes: - - name: ctai-properties - secret: - secretName: {{ include "ctai.propertiesSecretName" . }} - {{- with .Values.extraVolumes }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- else if .Values.extraVolumes }} + {{- with (include "ctai.volumes" . | trim) }} volumes: - {{- toYaml .Values.extraVolumes | nindent 8 }} + {{- . | nindent 8 }} {{- end }} {{- with .Values.nodeSelector }} nodeSelector: diff --git a/charts/ai/values.yaml b/charts/ai/values.yaml index 3500d75..a63033b 100644 --- a/charts/ai/values.yaml +++ b/charts/ai/values.yaml @@ -166,6 +166,52 @@ securityContext: runAsUser: 2200 runAsGroup: 2200 allowPrivilegeEscalation: false + # The image's own files are read-only; the directories it writes are the + # writableDirectories below. false restores the previous layout (no + # writableDirectories, the container writes to its own layer), for a pre-start + # hook that writes elsewhere. Images older than the first one that supports it + # (see "Read-only root filesystem" in README.md) always get the previous layout + # when image.tag names a version. + readOnlyRootFilesystem: true + +# The directories the container writes, each an emptyDir mounted over the image's +# empty directory, so the root filesystem can be read-only. Mounted only when +# securityContext.readOnlyRootFilesystem is in effect. They live as long as the pod: +# a container restart keeps them (and reuses the unpacked artifacts), a new pod +# starts empty. Set enabled: false on one to mount your own volume there instead +# (a PVC on logs, for example) through extraVolumes and extraVolumeMounts; the +# chart refuses two volumes on the same path, and a disabled directory with no +# volume of yours on it. sizeLimit (for example 2Gi) caps one: the kubelet evicts +# the pod when it is exceeded, so leave it empty unless the node's ephemeral +# storage needs protecting. +writableDirectories: + # Artifacts unpacked from artifacts.zip at start, with the server URL injected + # into the IDE plugins (about 200 MB), and the YAML generated from the + # properties file. + runtime: + enabled: true + mountPath: /opt/ctai/runtime + sizeLimit: "" + # nginx's document root: the portal and metric lineage, unpacked at start. + www: + enabled: true + mountPath: /opt/ctai/www + sizeLimit: "" + # server.log, the nginx logs and heap dumps (only the newest is kept). + logs: + enabled: true + mountPath: /opt/ctai/logs + sizeLimit: "" + # nginx's pid file and request-body and proxy temp files. + tmp: + enabled: true + mountPath: /opt/ctai/tmp + sizeLimit: "" + # The JVM's and Tomcat's temp files. + systemTmp: + enabled: true + mountPath: /tmp + sizeLimit: "" resources: {} @@ -202,6 +248,21 @@ tolerations: [] affinity: {} replicaCount: 1 +# Rollout strategy. The default stops the old pod before it starts the new one +# (a short outage on a single replica), instead of the Kubernetes default +# (maxSurge 25%, which rounds up to one extra pod). Pods of one release share an +# embedded Hazelcast cluster, and a pod only joins a cluster of its own +# Hazelcast minor version: when a release changes that version, an old pod still +# running makes the new pod fail to join and restart in a loop, so a surge +# rollout never completes. With more than one replica, upgrade across a +# Hazelcast version with Recreate (see "Upgrade" in README.md): +# --set deploymentStrategy.type=Recreate --set deploymentStrategy.rollingUpdate=null +deploymentStrategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 0 + maxUnavailable: 1 + extraEnvVars: [] extraVolumes: [] extraVolumeMounts: [] diff --git a/charts/collab/Chart.yaml b/charts/collab/Chart.yaml index a4e3bb8..a78ba9e 100644 --- a/charts/collab/Chart.yaml +++ b/charts/collab/Chart.yaml @@ -3,7 +3,7 @@ name: codetogether-collab description: CodeTogether Collab type: application -version: 1.2.9 +version: 1.3.0 appVersion: "2026.1.2" icon: https://www.codetogether.com/wp-content/uploads/2020/02/codetogether-circle-128.png diff --git a/charts/collab/README.md b/charts/collab/README.md index f235f45..a2d7f62 100644 --- a/charts/collab/README.md +++ b/charts/collab/README.md @@ -11,6 +11,10 @@ This chart has been created with Helm v3 and tested with: - Kubernetes v1.18+ - Helm v3.5+ +With `gateway.enabled=true` (see [Gateway API](#gateway-api-nginx-gateway-fabric)), +the cluster also needs the Gateway API CRDs (v1.5+ for the ListenerSet) and a +`Gateway`, for example from NGINX Gateway Fabric. + ## Configuration The following table lists configurable parameters of the CodeTogether Collab chart and their default values: @@ -47,6 +51,14 @@ The following table lists configurable parameters of the CodeTogether Collab cha | `locatorEdge.region` | Region for the edge server | `default` | | `ingress.enabled` | Enables ingress controller resource | `true` | | `ingress.tls.secretName` | TLS secret name for ingress | `codetogether-tls` | +| `gateway.enabled` | Creates a Gateway API `HTTPRoute` for the `codetogether.url` host | `false` | +| `gateway.parentRefs` | Gateway(s) the `HTTPRoute` attaches to; required when enabled unless `gateway.listenerSet.enabled` | `[]` | +| `gateway.annotations` / `gateway.labels` | Extra `HTTPRoute` metadata (`labels` also go on the `ListenerSet`) | `{}` | +| `gateway.listenerSet.enabled` | Creates a `ListenerSet` with this release's HTTPS listener; requires `gateway.enabled=true` | `false` | +| `gateway.listenerSet.parentRef` | The shared Gateway (`name`, `namespace`); required when enabled | `{}` | +| `gateway.listenerSet.listenerName` / `port` | Listener name (the route's `sectionName`) and port | `https` / `443` | +| `gateway.listenerSet.tlsSecretName` | TLS Secret for the listener | `-tls` | +| `gateway.listenerSet.annotations` | `ListenerSet` annotations (e.g. the cert-manager issuer) | `{}` | | `dashboard.enabled` | Enables the dashboard and allows configuration of credentials | `false` | | `dashboard.username` | Dashboard username | `my-dashboard-username` | | `dashboard.password` | Dashboard password | `my-dashboard-password` | @@ -78,6 +90,99 @@ To secure CodeTogether, you can add a `secret` that contains your TLS (Transport $ kubectl create secret tls codetogether-tls --key --cert ``` +## Gateway API (NGINX Gateway Fabric) + +Clusters that route with Gateway API instead of an Ingress controller (for +example NGINX Gateway Fabric, which replaces the retired ingress-nginx) can have +the chart attach an `HTTPRoute` to an existing `Gateway`: + +```yaml +ingress: + enabled: false +gateway: + enabled: true + parentRefs: + - name: shared-gateway # your Gateway + namespace: gateway-system # omit if it is in the release namespace + sectionName: https # the HTTPS listener with the certificate +``` + +The chart renders an `HTTPRoute` for the `codetogether.url` host that sends `/` +to the chart Service. WebSocket connections need no extra setting: NGINX Gateway +Fabric passes the upgrade through. Settings you added as Ingress annotations +(`ingress.annotations`, `ingress.config`) don't carry over; set the equivalent on +your Gateway. + +### ListenerSet: your own listener on a shared Gateway + +Instead of adding a listener to the shared `Gateway` for this host, the chart +can create a `ListenerSet` (`gateway.networking.k8s.io/v1`, Gateway API v1.5+) +that adds the HTTPS listener for the `codetogether.url` host, with its +certificate, from the release namespace. The `HTTPRoute` then attaches to that +ListenerSet, so leave `gateway.parentRefs` empty: + +```yaml +ingress: + enabled: false +gateway: + enabled: true + listenerSet: + enabled: true + parentRef: + name: gateway-ngf # the shared Gateway + namespace: kube-system + # The certificate Secret defaults to -tls. Set + # tlsSecretName: codetogether-tls to keep the certificate from the TLS step. + annotations: + cert-manager.io/cluster-issuer: cert-manager-clusterissuer +``` + +The shared Gateway has to accept ListenerSets from the release namespace +(`spec.allowedListeners.namespaces`). With a cert-manager version that supports +ListenerSets, the issuer annotation on the ListenerSet issues the certificate +into that Secret; otherwise create the Secret yourself. On cert-manager v1.21 +that support is off by default; enable it in the cert-manager chart values: + +```yaml +config: + apiVersion: controller.config.cert-manager.io/v1alpha1 + kind: ControllerConfiguration + enableGatewayAPI: true + enableGatewayAPIListenerSet: true +featureGates: ListenerSets=true +``` + +Chart versions before 1.3.0 don't render Gateway API objects, so a Gateway setup +on them was applied by hand. If a ListenerSet or an HTTPRoute with the release +fullname already exists, Helm refuses to take it over (`invalid ownership +metadata`) and the upgrade stops without changing anything. Let Helm adopt each +one that exists before the upgrade: + +```bash +for kind in listenerset httproute; do + kubectl -n label $kind app.kubernetes.io/managed-by=Helm + kubectl -n annotate $kind \ + meta.helm.sh/release-name= meta.helm.sh/release-namespace= +done +``` + +With the same host and TLS Secret name, the upgrade keeps serving traffic and +cert-manager keeps the existing certificate. + +A `helm rollback` to a chart version without `gateway`, or a `helm uninstall`, +deletes the ListenerSet and the HTTPRoute, and with them this host's listener +and route. + +The chart doesn't create the `Gateway`. On the Gateway side, check that: + +- the listener allows routes from the release namespace + (`allowedRoutes.namespaces`); +- the listener can read its certificate Secret. A Secret in another namespace + needs a `ReferenceGrant` there; +- the route is accepted: + `kubectl get httproute -o jsonpath='{.status.parents[*].conditions}'` + (the install notes print the exact command). + ## Installing the Chart To install the chart with the release name `codetogether-collab`: diff --git a/charts/collab/templates/NOTES.txt b/charts/collab/templates/NOTES.txt index 7944fec..df07709 100644 --- a/charts/collab/templates/NOTES.txt +++ b/charts/collab/templates/NOTES.txt @@ -1,7 +1,36 @@ Application URL: +{{- $gw := .Values.gateway | default dict }} {{- if .Values.ingress.enabled }} {{- $host := (urlParse .Values.codetogether.url).host }} http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host }}{{ .path }} +{{- else if $gw.enabled }} + https://{{ (urlParse .Values.codetogether.url).host }}/ +{{- end }} + +{{- if $gw.enabled }} + +Gateway API: + {{- $parents := list }} + {{- range $gw.parentRefs }} + {{- $p := .name }} + {{- with .namespace }}{{ $p = printf "%s (namespace %s)" $p . }}{{ end }} + {{- with .sectionName }}{{ $p = printf "%s listener %s" $p . }}{{ end }} + {{- $parents = append $parents $p }} + {{- end }} + {{- if eq (include "codetogether.listenerSetEnabled" .) "true" }} + {{- $lsParent := $gw.listenerSet.parentRef }} + ListenerSet {{ include "codetogether.fullname" . }} adds an HTTPS listener to Gateway {{ $lsParent.name }}{{ with $lsParent.namespace }} (namespace {{ . }}){{ end }}. + Check it was accepted: kubectl get listenerset {{ include "codetogether.fullname" . }} -n {{ .Release.Namespace }} -o jsonpath='{.status.conditions}' + {{- if not $parents }} + {{- $parents = list (printf "ListenerSet %s listener %s" (include "codetogether.fullname" .) ($gw.listenerSet.listenerName | default "https")) }} + {{- end }} + {{- end }} + HTTPRoute {{ include "codetogether.fullname" . }} attaches to: {{ join ", " $parents }} + Check it was accepted: kubectl get httproute {{ include "codetogether.fullname" . }} -n {{ .Release.Namespace }} -o jsonpath='{.status.parents[*].conditions}' +{{- if .Values.ingress.enabled }} + WARNING: ingress.enabled is also true, so both an Ingress and an HTTPRoute + serve this host. Set ingress.enabled=false once the Gateway path works. +{{- end }} {{- end }} {{- if or .Values.av.enabled .Values.av.serverIP .Values.av.stunServers.enabled .Values.av.jitsiUrl }} diff --git a/charts/collab/templates/_helpers.tpl b/charts/collab/templates/_helpers.tpl index d257964..c6f017e 100644 --- a/charts/collab/templates/_helpers.tpl +++ b/charts/collab/templates/_helpers.tpl @@ -94,4 +94,42 @@ Get Proxy secret name {{- printf "%s-proxy-secret" $fullName }} {{- end }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} + +{{/* +Gateway API hostname: the codetogether.url host without a port (Gateway API +hostnames can't carry one). +*/}} +{{- define "codetogether.routeHostname" -}} +{{- $host := regexReplaceAll ":[0-9]+$" (urlParse (toString .Values.codetogether.url)).host "" -}} +{{- if not $host -}} +{{- fail "gateway.enabled=true requires codetogether.url to be a full URL with a host, for example https://codetogether.example.com." -}} +{{- end -}} +{{- $host -}} +{{- end }} + +{{/* +"true" when the chart renders a ListenerSet. Read `gateway` defensively: a +`helm upgrade --reuse-values` from a chart without it keeps the old values and +skips the new defaults. +*/}} +{{- define "codetogether.listenerSetEnabled" -}} +{{- $gw := .Values.gateway | default dict -}} +{{- if and $gw.enabled ($gw.listenerSet | default dict).enabled -}}true{{- end -}} +{{- end }} + +{{/* +HTTPRoute parentRefs: gateway.parentRefs when set; otherwise the chart's +ListenerSet and its listener. +*/}} +{{- define "codetogether.routeParentRefs" -}} +{{- $gw := .Values.gateway | default dict -}} +{{- if $gw.parentRefs -}} +{{- toYaml $gw.parentRefs -}} +{{- else if eq (include "codetogether.listenerSetEnabled" .) "true" -}} +- group: gateway.networking.k8s.io + kind: ListenerSet + name: {{ include "codetogether.fullname" . }} + sectionName: {{ ($gw.listenerSet | default dict).listenerName | default "https" }} +{{- end -}} +{{- end }} diff --git a/charts/collab/templates/httproute.yaml b/charts/collab/templates/httproute.yaml new file mode 100644 index 0000000..ccfdee0 --- /dev/null +++ b/charts/collab/templates/httproute.yaml @@ -0,0 +1,36 @@ +{{- $gw := .Values.gateway | default dict }} +{{- if $gw.enabled }} +{{- if not (include "codetogether.routeParentRefs" .) }} +{{- fail "gateway.enabled=true requires gateway.parentRefs (the Gateway, and namespace/sectionName if needed, the HTTPRoute attaches to) or gateway.listenerSet.enabled=true." }} +{{- end }} +{{- if not (.Capabilities.APIVersions.Has "gateway.networking.k8s.io/v1/HTTPRoute") }} +{{- fail "gateway.enabled=true but the cluster does not serve gateway.networking.k8s.io/v1 HTTPRoute. Install the Gateway API CRDs (or pass --api-versions gateway.networking.k8s.io/v1/HTTPRoute to helm template)." }} +{{- end }} +{{- $fullName := include "codetogether.fullname" . }} +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ $fullName }} + labels: + {{- include "codetogether.labels" . | nindent 4 }} + {{- with $gw.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with $gw.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + parentRefs: + {{- include "codetogether.routeParentRefs" . | nindent 4 }} + hostnames: + - {{ include "codetogether.routeHostname" . | quote }} + rules: + - matches: + - path: + type: PathPrefix + value: / + backendRefs: + - name: {{ $fullName }} + port: {{ .Values.service.port }} +{{- end }} diff --git a/charts/collab/templates/listenerset.yaml b/charts/collab/templates/listenerset.yaml new file mode 100644 index 0000000..c944857 --- /dev/null +++ b/charts/collab/templates/listenerset.yaml @@ -0,0 +1,42 @@ +{{- $gwValues := .Values.gateway | default dict }} +{{- if and ($gwValues.listenerSet | default dict).enabled (not $gwValues.enabled) }} +{{- fail "gateway.listenerSet.enabled=true requires gateway.enabled=true: the ListenerSet carries the HTTPRoute's listener, and without the HTTPRoute nothing is rendered." }} +{{- end }} +{{- if eq (include "codetogether.listenerSetEnabled" .) "true" }} +{{- $ls := .Values.gateway.listenerSet }} +{{- $parent := $ls.parentRef | default dict }} +{{- if not $parent.name }} +{{- fail "gateway.listenerSet.enabled=true requires gateway.listenerSet.parentRef.name: the Gateway the ListenerSet adds a listener to." }} +{{- end }} +{{- if not (.Capabilities.APIVersions.Has "gateway.networking.k8s.io/v1/ListenerSet") }} +{{- fail "gateway.listenerSet.enabled=true but the cluster does not serve gateway.networking.k8s.io/v1 ListenerSet. Install Gateway API v1.5+ standard CRDs (or pass --api-versions gateway.networking.k8s.io/v1/ListenerSet to helm template)." }} +{{- end }} +# HTTPS listener for this release on the shared Gateway {{ $parent.name }}. With a +# cert-manager.io/(cluster-)issuer annotation, cert-manager issues the +# certificate into the Secret named below. +apiVersion: gateway.networking.k8s.io/v1 +kind: ListenerSet +metadata: + name: {{ include "codetogether.fullname" . }} + labels: + {{- include "codetogether.labels" . | nindent 4 }} + {{- with $gwValues.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with $ls.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + parentRef: + {{- toYaml $parent | nindent 4 }} + listeners: + - name: {{ $ls.listenerName | default "https" }} + hostname: {{ include "codetogether.routeHostname" . | quote }} + port: {{ $ls.port | default 443 }} + protocol: HTTPS + tls: + mode: Terminate + certificateRefs: + - name: {{ $ls.tlsSecretName | default (printf "%s-tls" (include "codetogether.fullname" .)) }} +{{- end }} diff --git a/charts/collab/values.yaml b/charts/collab/values.yaml index 6b514a0..b0ee29a 100644 --- a/charts/collab/values.yaml +++ b/charts/collab/values.yaml @@ -163,6 +163,49 @@ ingress: tls: - secretName: codetogether-tls # +# Gateway API (gateway.networking.k8s.io/v1), for clusters that route with a +# Gateway instead of an Ingress controller (for example NGINX Gateway Fabric, +# replacing the retired ingress-nginx). Off by default. +# +# The chart attaches an HTTPRoute for the codetogether.url host to a Gateway you +# already run. It does not create the Gateway. Set ingress.enabled=false when you +# switch, unless you deliberately run both during a migration. +# +gateway: + enabled: false + # Gateway(s) the HTTPRoute attaches to. Required when enabled, unless + # listenerSet.enabled is true. Example: + # parentRefs: + # - name: shared-gateway + # namespace: gateway-system + # sectionName: https # the HTTPS listener that holds the certificate + parentRefs: [] + annotations: {} + labels: {} + # Optional ListenerSet (gateway.networking.k8s.io/v1, Gateway API v1.5+): adds + # this release's HTTPS listener (the codetogether.url host and its certificate) + # to a shared Gateway, so the shared Gateway doesn't need a listener edited for + # each application. The Gateway must allow it (spec.allowedListeners). When + # enabled and parentRefs is empty, the HTTPRoute attaches to this ListenerSet; + # if parentRefs is set, the HTTPRoute attaches only to those parents. + listenerSet: + enabled: false + # The Gateway this ListenerSet adds a listener to. Required when enabled. + # Example: + # parentRef: + # name: gateway-ngf + # namespace: kube-system + parentRef: {} + listenerName: https + port: 443 + # cert-manager reads these (cert-manager.io/cluster-issuer or + # cert-manager.io/issuer) and issues the certificate into tlsSecretName. + annotations: {} + # TLS Secret in the release namespace. Defaults to -tls. + # Set it to codetogether-tls to keep the certificate the Ingress used. + tlsSecretName: "" + +# # CodeTogether has a dashboard to view metrics, and for the locator, update # configuration on the fly. If a custom username and password is not enabled, # one will be dynamically generated and shared in the log when the server