Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/bin/sh
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -eu

chart_dir=${CHART_DIR:-.}
release_name=${RELEASE_NAME:-function-autoscaler}
namespace=${NAMESPACE:-nvcf}
tmpdir=$(mktemp -d)

cleanup() {
rm -rf "$tmpdir"
}
trap cleanup EXIT

export HELM_CONFIG_HOME=${HELM_CONFIG_HOME:-"$tmpdir/helm-config"}
export HELM_CACHE_HOME=${HELM_CACHE_HOME:-"$tmpdir/helm-cache"}
export HELM_DATA_HOME=${HELM_DATA_HOME:-"$tmpdir/helm-data"}

render() {
helm template "$release_name" "$chart_dir" \
--namespace "$namespace" \
--values "$chart_dir/values.yaml" \
--set functionautoscaler.image.repository=rs-autoscaler \
"$@"
}

assert_contains() {
file=$1
pattern=$2

if ! grep -Fq -- "$pattern" "$file"; then
echo "expected rendered output to contain: $pattern" >&2
return 1
fi
}

assert_not_contains() {
file=$1
pattern=$2

if grep -Fq -- "$pattern" "$file"; then
echo "expected rendered output not to contain: $pattern" >&2
return 1
fi
}

default_render="$tmpdir/default.yaml"
render > "$default_render"
assert_contains "$default_render" "secrets.json.tmpl: |-"
assert_not_contains "$default_render" "nvcfApiToken"
assert_not_contains "$default_render" "NVCF_API_TOKEN_BLOCK"
assert_not_contains "$default_render" "services/nvcf-api/jwt/sign/nvcf-autoscaler-service"

static_token_render="$tmpdir/static-token.yaml"
render --set functionautoscaler.vault.staticNvcfApiToken.enabled=true > "$static_token_render"
assert_contains "$static_token_render" "services/nvcf-api/jwt/sign/nvcf-autoscaler-service"
assert_contains "$static_token_render" '"nvcfApiToken": "{{ .Data.token }}",'
assert_not_contains "$static_token_render" "NVCF_API_TOKEN_BLOCK"

custom_path_render="$tmpdir/custom-path.yaml"
render \
--set functionautoscaler.vault.staticNvcfApiToken.enabled=true \
--set functionautoscaler.vault.staticNvcfApiToken.path=services/custom/jwt/sign/autoscaler \
> "$custom_path_render"
assert_contains "$custom_path_render" "services/custom/jwt/sign/autoscaler"
assert_not_contains "$custom_path_render" "services/nvcf-api/jwt/sign/nvcf-autoscaler-service"
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
# limitations under the License.

{{ if .Values.functionautoscaler.vault.enabled }}
{{- $open := "{{" -}}
{{- $close := "}}" -}}
{{- $staticTokenMarker := printf "%s/* NVCF_API_TOKEN_BLOCK */%s" $open $close -}}
{{- $staticTokenBlock := "" -}}
{{- if .Values.functionautoscaler.vault.staticNvcfApiToken.enabled -}}
{{- $staticTokenPath := required "A valid static NVCF API token path (.Values.functionautoscaler.vault.staticNvcfApiToken.path) is required when staticNvcfApiToken.enabled=true!" .Values.functionautoscaler.vault.staticNvcfApiToken.path -}}
{{- $staticTokenBlock = printf "%s- with secret %q %s\n \"nvcfApiToken\": \"%s .Data.token %s\",\n %s- end %s" $open $staticTokenPath $close $open $close $open $close -}}
{{- end }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -23,5 +31,5 @@ metadata:
{{- include "function-autoscaler.labels" . | nindent 4 }}
data:
secrets.json.tmpl: |-
{{ .Files.Get "vault-agent-templates/secrets.json.tmpl" | indent 4 }}
{{ replace $staticTokenMarker $staticTokenBlock (.Files.Get "vault-agent-templates/secrets.json.tmpl") | indent 4 }}
{{- end }}
27 changes: 27 additions & 0 deletions deploy/helm/function-autoscaler/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ functionautoscaler:
role: nvcf-autoscaler-service
authPath: auth/jwt

# Enable only for deployments that provision the OpenBao JWT signing path.
# When disabled, the app falls back to OAuth2 credentials or auth-disabled
# mode without the Vault Agent dereferencing this optional secret.
staticNvcfApiToken:
enabled: false
path: services/nvcf-api/jwt/sign/nvcf-autoscaler-service

podAnnotations: {}
podLabels: {}
podSecurityContext: {}
Expand Down Expand Up @@ -97,6 +104,9 @@ functionautoscaler:
- name: probe
containerPort: 8181
protocol: TCP
- name: metrics
containerPort: 41338
protocol: TCP

# Stable service DNS. Override for multiple releases in one namespace.
service:
Expand All @@ -110,6 +120,10 @@ functionautoscaler:
port: 8181
targetPort: probe
protocol: TCP
- name: metrics
port: 41338
targetPort: metrics
protocol: TCP

# Additional volumes on the output Deployment definition.
# The projected service account token lets the Vault Agent authenticate to
Expand Down Expand Up @@ -140,3 +154,16 @@ functionautoscaler:
# Read the secrets file rendered by the Vault Agent. Override this value
# when mounting secrets manually.
SECRETS_PATH: "/vault/secrets/secrets.json"

# Self-managed in-cluster defaults. Consuming stacks should override these
# only when service names, namespaces, or auth mode differ.
CASSANDRA__CONTACT_POINTS: "cassandra.cassandra-system.svc.cluster.local"
CASSANDRA__PORT: "9042"
CASSANDRA__KEYSPACE: "nvcf_autoscaler"
CASSANDRA__SSL__ENABLED: "false"
TIMESERIES_DB__TIMESERIES_DB_URL: "http://vmsingle.monitoring.svc.cluster.local:8428"
TIMESERIES_DB__DISABLE_AUTH: "true"
TIMESERIES_DB__ENV: "stg"
TIMESERIES_DB__IGNORE_ENV: "true"
NVCF_API__NVCF_API_GRPC_ADDRESS: "http://api.nvcf.svc.cluster.local:9090"
NVCF_API__DISABLE_AUTH: "true"
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
corresponding app integration is enabled and wired to a secret path.
*/}}
{
{{/* NVCF_API_TOKEN_BLOCK */}}
"kv": {
"cassandra": {
{{- with secret "services/nvcf-autoscaler-service/kv/data/cassandra/creds" }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,35 @@ controlPlane:
selector:
app.kubernetes.io/instance: state-metrics
app.kubernetes.io/name: helm-nvcf-state-metrics
- name: function-autoscaler
enabled: true
selector:
app.kubernetes.io/instance: function-autoscaler
app.kubernetes.io/name: helm-nvcf-function-autoscaler
- name: grpc-proxy
enabled: true
selector:
app.kubernetes.io/instance: grpc-proxy
- name: api
enabled: true
path: /actuator/prometheus
port: management-port
selector:
app.kubernetes.io/name: helm-nvcf-api
- name: sis
enabled: true
namespaces:
- sis
path: /actuator/prometheus
port: management-port
selector:
app.kubernetes.io/name: helm-nvcf-sis
Comment on lines 57 to 70

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Confirm api/sis services expose a named 'management-port' and inspect metrics gating.
fd -t f -e yaml -e gotmpl -e tpl . deploy/helm 2>/dev/null | xargs rg -nP -C2 'management-port|actuator/prometheus' 2>/dev/null
rg -nP -C2 'MANAGEMENT_PROMETHEUS_METRICS_EXPORT_ENABLED|observability\.metrics\.enabled' deploy/stacks/self-managed

Repository: NVIDIA/nvcf

Length of output: 4962


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Map the observability monitor chart and the api/sis service templates.
fd -t f 'values.yaml' deploy/stacks/observability/charts/nvcf-default-monitors deploy/helm 2>/dev/null
printf '\n---\n'
fd -t f -g 'deployment*.yaml' -g 'service*.yaml' deploy/helm 2>/dev/null | sort
printf '\n--- nvcf-default-monitors values excerpt ---\n'
sed -n '1,140p' deploy/stacks/observability/charts/nvcf-default-monitors/values.yaml
printf '\n--- api/sis service/deployment excerpts ---\n'
for f in \
  deploy/helm/api-keys-colocated/api-keys/templates/deployment.yaml \
  deploy/helm/api-keys-colocated/api-keys/templates/service.yaml \
  deploy/helm/api-keys-colocated/sis/templates/deployment.yaml \
  deploy/helm/api-keys-colocated/sis/templates/service.yaml
do
  if [ -f "$f" ]; then
    echo "### $f"
    sed -n '1,180p' "$f"
    echo
  fi
done
printf '\n--- metrics gating references ---\n'
rg -n -C2 'MANAGEMENT_PROMETHEUS_METRICS_EXPORT_ENABLED|MANAGEMENT_METRICS_ENABLE_ALL|observability\.metrics\.enabled|management-port' deploy/helm deploy/stacks/self-managed deploy/stacks/observability 2>/dev/null

Repository: NVIDIA/nvcf

Length of output: 16110


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Focus on the exact files and line ranges implied by the review comment.
echo '--- deploy/stacks/observability/charts/nvcf-default-monitors/values.yaml ---'
nl -ba deploy/stacks/observability/charts/nvcf-default-monitors/values.yaml | sed -n '45,90p'

echo
echo '--- deploy/stacks/self-managed/global.yaml.gotmpl ---'
nl -ba deploy/stacks/self-managed/global.yaml.gotmpl | sed -n '332,345p'

echo
echo '--- api-keys service deployment/service ---'
for f in \
  deploy/helm/api-keys-colocated/api-keys/templates/deployment.yaml \
  deploy/helm/api-keys-colocated/api-keys/templates/service.yaml \
  deploy/helm/api-keys-colocated/sis/templates/deployment.yaml \
  deploy/helm/api-keys-colocated/sis/templates/service.yaml
do
  if [ -f "$f" ]; then
    echo "### $f"
    nl -ba "$f" | sed -n '1,140p'
    echo
  fi
done

echo '--- search for management-port service names in relevant charts ---'
rg -n -C2 'name:\s*management-port|port:\s*management-port|management-port:' deploy/helm/api-keys-colocated deploy/stacks/observability deploy/stacks/self-managed 2>/dev/null

Repository: NVIDIA/nvcf

Length of output: 266


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the exact service definitions for api and sis, plus the chart mode wiring.
for f in \
  deploy/helm/api-keys-colocated/api-keys/templates/service.yaml \
  deploy/helm/api-keys-colocated/sis/templates/service.yaml \
  deploy/stacks/observability/charts/nvcf-default-monitors/values.yaml \
  deploy/stacks/observability/charts/nvcf-default-monitors/templates/*.yaml
do
  [ -f "$f" ] || continue
  echo "### $f"
  nl -ba "$f" | sed -n '1,220p'
  echo
done

echo '--- grep for observability mode and metrics defaults ---'
rg -n -C3 'observability\.mode|metrics\.enabled|enabled:\s*true|enabled:\s*false' deploy/stacks/self-managed deploy/stacks/observability 2>/dev/null

Repository: NVIDIA/nvcf

Length of output: 257


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Look for the actual Service definitions and any management-port service name on api/sis charts.
rg -n -C3 'kind:\s*Service|name:\s*management-port|targetPort:\s*management-port|port:\s*management-port' \
  deploy/helm/api-keys-colocated deploy/helm 2>/dev/null

printf '\n--- files mentioning helm-nvcf-sis ---\n'
rg -n -C2 'helm-nvcf-sis|app.kubernetes.io/name:\s*helm-nvcf-sis|sis' deploy/helm 2>/dev/null

printf '\n--- service templates under api-keys-colocated ---\n'
fd -t f 'service.yaml' deploy/helm/api-keys-colocated 2>/dev/null

Repository: NVIDIA/nvcf

Length of output: 50368


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find the sis chart/service definitions and limit output to the relevant lines.
fd -t f -g '*sis*' deploy/helm 2>/dev/null | sort
printf '\n--- sis references with service/port names ---\n'
rg -n -C2 'kind:\s*Service|name:\s*management-port|targetPort:|port: management-port|app.kubernetes.io/name:\s*helm-nvcf-sis|helm-nvcf-sis' deploy/helm 2>/dev/null | head -n 200

Repository: NVIDIA/nvcf

Length of output: 15848


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect how the nvcf-default-monitors chart enables ServiceMonitors and what it keys off.
fd -t f -g '*.yaml' -g '*.yml' -g '*.gotmpl' deploy/stacks/observability/charts/nvcf-default-monitors 2>/dev/null | sort
printf '\n--- chart templates mentioning controlPlane/mode/enabled ---\n'
rg -n -C3 'controlPlane|install|existing|disabled|enabled:|namespaceSelector|ServiceMonitor' deploy/stacks/observability/charts/nvcf-default-monitors 2>/dev/null

Repository: NVIDIA/nvcf

Length of output: 11698


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check the observability stack wiring for mode -> chart enablement.
rg -n -C3 'observability\.mode|nvcf-default-monitors|controlPlane\.enabled|default-monitors|install|existing|disabled' \
  deploy/stacks/observability deploy/stacks/self-managed 2>/dev/null

Repository: NVIDIA/nvcf

Length of output: 42627


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find the sis service/deployment templates and any management port exposure.
rg -n -C3 'helm-nvcf-sis|management-port|managementPort|kind:\s*Service|ports:' deploy/helm/api-keys-colocated deploy/helm 2>/dev/null | head -n 250

Repository: NVIDIA/nvcf

Length of output: 19568


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Show the exact service port names used by api-keys and sis-related templates.
for f in \
  deploy/helm/api-keys-colocated/api-keys/templates/service.yaml \
  deploy/helm/api-keys-colocated/api-keys/templates/deployment.yaml \
  deploy/helm/api-keys-colocated/api-keys/values.yaml \
  deploy/helm/api-keys-colocated/sis/templates/service.yaml \
  deploy/helm/api-keys-colocated/sis/templates/deployment.yaml \
  deploy/helm/api-keys-colocated/sis/values.yaml
do
  [ -f "$f" ] || continue
  echo "### $f"
  sed -n '1,140p' "$f"
  echo
done

Repository: NVIDIA/nvcf

Length of output: 7266


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check whether api-keys or sis consume the global metrics-export env vars.
rg -n -C3 'MANAGEMENT_PROMETHEUS_METRICS_EXPORT_ENABLED|MANAGEMENT_METRICS_ENABLE_ALL|global\.observability\.metrics|actuator/prometheus|management-port' \
  deploy/helm/api-keys-colocated deploy/helm 2>/dev/null | head -n 250

Repository: NVIDIA/nvcf

Length of output: 5941


Retarget api to an existing Service port. The api Service only exposes http, so port: management-port won’t match unless that Service adds a named management-port port.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@deploy/stacks/observability/charts/nvcf-default-monitors/values.yaml` around
lines 57 - 70, Update the api monitor definition in values.yaml to target the
existing Service port named http instead of management-port. Leave the sis
monitor and other api settings unchanged.

- name: llm-api-gateway
enabled: true
selector:
app.kubernetes.io/instance: llm-api-gateway
# Off until the Invocation Service exporter is enabled.
- name: invocation-service
enabled: false
enabled: true
selector:
app.kubernetes.io/instance: invocation-service
app.kubernetes.io/name: helm-nvcf-invocation-service
Comment on lines 75 to +79

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n -C3 'invocation-service|name:\s*metrics|targetPort:\s*metrics|/metrics' deploy/helm deploy/stacks/self-managed

Repository: NVIDIA/nvcf

Length of output: 43866


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the invocation-service chart for its metrics service/endpoint contract
printf '\n== values ==\n'
sed -n '130,165p' deploy/helm/http-invocation/values.yaml

printf '\n== deployment ==\n'
sed -n '1,140p' deploy/helm/http-invocation/templates/deployment.yaml

printf '\n== service ==\n'
sed -n '1,120p' deploy/helm/http-invocation/templates/service.yaml

printf '\n== default monitor values ==\n'
sed -n '60,95p' deploy/stacks/observability/charts/nvcf-default-monitors/values.yaml

Repository: NVIDIA/nvcf

Length of output: 7163


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== default monitor templates ==\n'
fd -a . deploy/stacks/observability/charts/nvcf-default-monitors/templates
printf '\n== monitor template references ==\n'
rg -n -C3 'path:|port:|ServiceMonitor|PodMonitor|invocation-service' deploy/stacks/observability/charts/nvcf-default-monitors/templates deploy/stacks/observability/charts/nvcf-default-monitors/values.yaml

Repository: NVIDIA/nvcf

Length of output: 9066


Add a metrics Service port before enabling the invocation-service monitor.

deploy/helm/http-invocation only publishes grpc and http service ports, so this monitor’s default port: metrics/path: /metrics has no Service endpoint to scrape. If metrics are exposed elsewhere, wire that port here; otherwise keep the monitor disabled.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@deploy/stacks/observability/charts/nvcf-default-monitors/values.yaml` around
lines 75 - 79, Update the invocation-service monitor configuration in
nvcf-default-monitors values so its enabled state matches an available metrics
Service endpoint: add and wire a metrics port for helm-nvcf-invocation-service
if metrics are exposed there, or set enabled to false while no metrics Service
port exists. Preserve the monitor’s metrics port/path defaults.

38 changes: 38 additions & 0 deletions deploy/stacks/self-managed/environments/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,31 @@ global:
# global.observability.metrics.enabled
enabled: false

# Optional observability runtime (stage 03). `install` deploys the complete
# managed metrics path; `existing` assumes a customer-owned backend.
observability:
mode: disabled
namespace: monitoring

prometheusOperatorCrds:
version: "30.0.0"

opentelemetryOperator:
version: "0.114.1"

victoriaMetrics:
version: "0.38.0"

controlPlaneCollector:
version: "0.1.0"

defaultMonitors:
version: "0.1.0"
# External observability mode may set enabled: true to install the NVCF-owned
# default monitors against customer-managed scrape infrastructure.
controlPlane:
enabled: true

accounts:
limits:
maxFunctions: 10
Expand Down Expand Up @@ -260,6 +285,19 @@ addons:
tolerations: []
affinity: {}

# Function Autoscaler workload (stage 03). Disabled by default; requires the
# stage-01 Cassandra/OpenBao migrations and a Prometheus-compatible TSDB.
functionAutoscaler:
enabled: false
chartVersion: "0.1.0"
image:
tag: "1.18.6"
pullPolicy: IfNotPresent
# Optional overrides for chart-owned defaults.
timeseriesDb: {}
nvcfApi: {}
cassandra: {}

stateMetrics:
enabled: false
# Disable ServiceMonitor for environments without Prometheus Operator
Expand Down
104 changes: 103 additions & 1 deletion deploy/stacks/self-managed/global.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ api:
NVCF_REGISTRIES_RECOGNIZED_RESOURCE_NGC_OAUTH2_GROUP_SCOPE: "ngc"
# Observability
MANAGEMENT_TRACING_ENABLED: {{ .Values.global.observability.tracing.enabled | quote }}
MANAGEMENT_PROMETHEUS_METRICS_EXPORT_ENABLED: {{ .Values.global.observability.metrics.enabled | quote }}
MANAGEMENT_METRICS_ENABLE_ALL: {{ .Values.global.observability.metrics.enabled | quote }}
{{- if .Values.global.observability.tracing.enabled }}
MANAGEMENT_OTLP_TRACING_ENDPOINT: "{{ .Values.global.observability.tracing.collectorProtocol }}://{{ .Values.global.observability.tracing.collectorEndpoint }}:{{ .Values.global.observability.tracing.collectorPort }}/v1/traces"
{{- end }}
Expand Down Expand Up @@ -565,7 +567,7 @@ adminIssuerProxy:
path: "/v1/admin/keys"

stateMetrics:
enabled: false
enabled: {{ dig "stateMetrics" "enabled" false .Values }}
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml .Values.global.imagePullSecrets | nindent 4 }}
Expand All @@ -583,6 +585,106 @@ stateMetrics:
serviceMonitor:
enabled: false

{{- $observabilityNamespace := dig "observability" "namespace" "monitoring" .Values }}
{{- $victoriaMetricsNamespace := dig "victoriaMetrics" "namespace" $observabilityNamespace .Values }}
{{- $functionAutoscalerValues := (index .Values "functionAutoscaler") | default (index .Values "functionautoscaler") | default dict }}
{{- if not (kindIs "map" $functionAutoscalerValues) }}
{{- fail "functionAutoscaler must be a map" }}
{{- end }}
{{- $functionAutoscalerImageValues := (index $functionAutoscalerValues "image") | default dict }}
{{- if not (kindIs "map" $functionAutoscalerImageValues) }}
{{- fail "functionAutoscaler.image must be a map" }}
{{- end }}
{{- $functionAutoscalerTimeseriesDbValues := (index $functionAutoscalerValues "timeseriesDb") | default dict }}
{{- if not (kindIs "map" $functionAutoscalerTimeseriesDbValues) }}
{{- fail "functionAutoscaler.timeseriesDb must be a map" }}
{{- end }}
{{- $functionAutoscalerNvcfApiValues := (index $functionAutoscalerValues "nvcfApi") | default dict }}
{{- if not (kindIs "map" $functionAutoscalerNvcfApiValues) }}
{{- fail "functionAutoscaler.nvcfApi must be a map" }}
{{- end }}
{{- $functionAutoscalerVaultValues := (index $functionAutoscalerValues "vault") | default dict }}
{{- if not (kindIs "map" $functionAutoscalerVaultValues) }}
{{- fail "functionAutoscaler.vault must be a map" }}
{{- end }}
{{- $functionAutoscalerCassandraValues := (index $functionAutoscalerValues "cassandra") | default dict }}
{{- if not (kindIs "map" $functionAutoscalerCassandraValues) }}
{{- fail "functionAutoscaler.cassandra must be a map" }}
{{- end }}
{{- $functionAutoscalerCassandraSslValues := (index $functionAutoscalerCassandraValues "ssl") | default dict }}
{{- if not (kindIs "map" $functionAutoscalerCassandraSslValues) }}
{{- fail "functionAutoscaler.cassandra.ssl must be a map" }}
{{- end }}
{{- $functionAutoscalerTsdbURL := (index $functionAutoscalerValues "timeseriesDbUrl") | default (index $functionAutoscalerTimeseriesDbValues "url") | default "" }}
{{- if and (not $functionAutoscalerTsdbURL) (ne $victoriaMetricsNamespace "monitoring") }}
{{- $functionAutoscalerTsdbURL = printf "http://vmsingle.%s.svc.cluster.local:8428" $victoriaMetricsNamespace }}
{{- end }}
{{- $functionAutoscalerCassandraContactPoints := (index $functionAutoscalerValues "cassandraContactPoints") | default (index $functionAutoscalerCassandraValues "contactPoints") | default "" }}
{{- $functionAutoscalerGrpcAddress := (index $functionAutoscalerValues "nvcfApiGrpcAddress") | default (index $functionAutoscalerNvcfApiValues "grpcAddress") | default "" }}
{{- $functionAutoscalerOauthURL := (index $functionAutoscalerValues "oauth2TokenApiAddress") | default (index $functionAutoscalerNvcfApiValues "oauth2TokenApiAddress") | default "" }}
{{- $functionAutoscalerImageRepository := (index $functionAutoscalerImageValues "repository") | default (printf "%s/nvcf-autoscaler-service" .Values.global.image.repository) }}
{{- $functionAutoscalerHasEnvOverrides := or $functionAutoscalerTsdbURL $functionAutoscalerCassandraContactPoints $functionAutoscalerGrpcAddress $functionAutoscalerOauthURL (hasKey $functionAutoscalerTimeseriesDbValues "disableAuth") (hasKey $functionAutoscalerTimeseriesDbValues "env") (hasKey $functionAutoscalerTimeseriesDbValues "ignoreEnv") (hasKey $functionAutoscalerCassandraValues "port") (hasKey $functionAutoscalerCassandraValues "keyspace") (hasKey $functionAutoscalerCassandraSslValues "enabled") (hasKey $functionAutoscalerNvcfApiValues "disableAuth") }}
functionautoscaler:
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml .Values.global.imagePullSecrets | nindent 4 }}
{{- end }}
image:
registry: {{ .Values.global.image.registry }}
repository: {{ $functionAutoscalerImageRepository }}
{{- with (index $functionAutoscalerImageValues "tag") }}
tag: {{ . | quote }}
{{- end }}
{{- with (index $functionAutoscalerImageValues "pullPolicy") }}
pullPolicy: {{ . | quote }}
{{- end }}
{{- with $functionAutoscalerVaultValues }}
vault:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with include "nvcf.nodeSelector" (dict "type" "controlplane" "selectors" .Values.global.nodeSelectors) }}
{{- . | nindent 2 }}
{{- end }}
{{- with include "nvcf.tolerations" (dict "type" "controlplane" "tolerations" .Values.global.tolerations) }}
{{- . | nindent 2 }}
{{- end }}
{{- if $functionAutoscalerHasEnvOverrides }}
env:
{{- with $functionAutoscalerTsdbURL }}
TIMESERIES_DB__TIMESERIES_DB_URL: {{ $functionAutoscalerTsdbURL | quote }}
{{- end }}
{{- if hasKey $functionAutoscalerTimeseriesDbValues "disableAuth" }}
TIMESERIES_DB__DISABLE_AUTH: {{ index $functionAutoscalerTimeseriesDbValues "disableAuth" | quote }}
{{- end }}
{{- with (index $functionAutoscalerTimeseriesDbValues "env") }}
TIMESERIES_DB__ENV: {{ . | quote }}
{{- end }}
{{- if hasKey $functionAutoscalerTimeseriesDbValues "ignoreEnv" }}
TIMESERIES_DB__IGNORE_ENV: {{ index $functionAutoscalerTimeseriesDbValues "ignoreEnv" | quote }}
{{- end }}
{{- with $functionAutoscalerCassandraContactPoints }}
CASSANDRA__CONTACT_POINTS: {{ $functionAutoscalerCassandraContactPoints | quote }}
{{- end }}
{{- with (index $functionAutoscalerCassandraValues "port") }}
CASSANDRA__PORT: {{ . | quote }}
{{- end }}
{{- with (index $functionAutoscalerCassandraValues "keyspace") }}
CASSANDRA__KEYSPACE: {{ . | quote }}
{{- end }}
{{- if hasKey $functionAutoscalerCassandraSslValues "enabled" }}
CASSANDRA__SSL__ENABLED: {{ index $functionAutoscalerCassandraSslValues "enabled" | quote }}
{{- end }}
{{- with $functionAutoscalerGrpcAddress }}
NVCF_API__NVCF_API_GRPC_ADDRESS: {{ $functionAutoscalerGrpcAddress | quote }}
{{- end }}
{{- with $functionAutoscalerOauthURL }}
NVCF_API__OAUTH2_TOKEN_API_ADDRESS: {{ $functionAutoscalerOauthURL | quote }}
{{- end }}
{{- if hasKey $functionAutoscalerNvcfApiValues "disableAuth" }}
NVCF_API__DISABLE_AUTH: {{ index $functionAutoscalerNvcfApiValues "disableAuth" | quote }}
{{- end }}
{{- end }}

reval:
fullnameOverride: reval
{{- if .Values.global.imagePullSecrets }}
Expand Down
Loading