Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ jobs:
- name: 'Database URL compatibility'
run: bash test/database-urls.sh

- name: 'Autoscaler unit configuration'
run: bash test/autoscaler-unit.sh

- name: 'Install kubeconform'
run: |
curl -sSL -o /tmp/kubeconform.tar.gz \
Expand Down
2 changes: 1 addition & 1 deletion MIGRATING-v3-to-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ Use the same Helm release name and release namespace as v3. Pin the exact v4
chart version that you tested.

```sh
CHART_VERSION=4.2.0
CHART_VERSION=4.3.0

helm upgrade "$RELEASE" oci://ghcr.io/platformatic/helm \
--version "$CHART_VERSION" \
Expand Down
1 change: 1 addition & 0 deletions README-ENTERPRISE.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ production-ready set of values except for the `secrets` portion.
| `services.icc.image.pullPolicy` | When to pull an image update | IfNotPresent | No |
| `services.icc.log_level` | The level to log ICC services | warn | No |
| `services.icc.public_url` | The URL to access Intelligent Command Center (Note: ingress and domain must be configured by the user | "" | Yes |
| `services.icc.autoscaler_unit` | Singular word used by the UI for the autoscaler unit | pod | No |
| `services.icc.database_url` | Base database connection string used when an exact URL is not set | "" | Conditional |
| `services.icc.database_urls` | Exact connection strings keyed by ICC database service | {} | Conditional |
| `services.icc.valkey.apps_url` | Valkey connection string | "" | Yes |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ production-ready set of values except for the `secrets` portion.
| `services.icc.image.pullPolicy` | When to pull an image update | IfNotPresent | No |
| `services.icc.log_level` | The level to log ICC services | warn | No |
| `services.icc.public_url` | The URL to access Intelligent Command Center (Note: ingress and domain must be configured by the user | "" | Yes |
| `services.icc.autoscaler_unit` | Singular word used by the UI for the autoscaler unit | pod | No |
| `services.icc.database_url` | Base database connection string used when an exact URL is not set | "" | Conditional |
| `services.icc.database_urls` | Exact connection strings keyed by ICC database service | {} | Conditional |
| `services.icc.valkey.apps_url` | Valkey connection string | "" | Yes |
Expand Down
2 changes: 1 addition & 1 deletion chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: helm
version: 4.2.0
version: 4.3.0
kubeVersion: ">= 1.30.0-0"
description: Platformatic microservices
type: application
Expand Down
2 changes: 2 additions & 0 deletions chart/templates/deployment/_icc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ spec:
value: "{{ .public_url }}"
- name: VITE_TERMS_VERSION
value: "1"
- name: VITE_AUTOSCALER_UNIT
value: "{{ dig "autoscaler_unit" "pod" . | toString }}"

# User manager
- name: PLT_USER_MANAGER_SESSION_SECRET_KEY
Expand Down
3 changes: 3 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ services:
# https://example.com/icc
#public_url: ""

# The word the UI uses for the autoscaler unit (e.g. "pod", "task")
#autoscaler_unit: "pod"

# Base URL used to derive all ICC database URLs. Do not include a database
# name or trailing slash. Required unless all required exact URLs are set.
database_url: ""
Expand Down
42 changes: 42 additions & 0 deletions test/autoscaler-unit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash

set -euo pipefail

ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
CHART_DIR="$ROOT_DIR/chart"

fail() {
echo "FAIL: $*" >&2
exit 1
}

autoscaler_unit() {
awk '
$1 == "-" && $2 == "name:" && $3 == "VITE_AUTOSCALER_UNIT" { found = 1; next }
found && $1 == "value:" { gsub(/"/, "", $2); print $2; exit }
'
}

required_values=(
--set-string services.icc.database_url=postgres://user:pass@db:5432
--set-string services.icc.valkey.apps_url=redis://valkey:6379/0
--set-string services.icc.valkey.icc_url=redis://valkey:6379/1
--set-string services.icc.prometheus.url=http://prometheus:9090
)

default_value=$(helm template autoscaler-unit "$CHART_DIR" \
--kube-version 1.30.0 \
"${required_values[@]}" | autoscaler_unit)

[[ "$default_value" == 'pod' ]] || \
fail "default autoscaler unit is $default_value, expected pod"

custom_value=$(helm template autoscaler-unit "$CHART_DIR" \
--kube-version 1.30.0 \
"${required_values[@]}" \
--set-string services.icc.autoscaler_unit=task | autoscaler_unit)

[[ "$custom_value" == 'task' ]] || \
fail "custom autoscaler unit is $custom_value, expected task"

echo 'Autoscaler unit tests passed'
Loading