Skip to main content

Cluster Info Template Variables

The platform cluster operator generates a cluster-info.json secret that contains cluster-specific configuration values. These values can be referenced in your Helm chart templates using the {{variable_name}} syntax, allowing for dynamic configuration that automatically adapts to wherever your application gets installed.

Basic Usage

In your installable CRD (and also in installation overrides), you can reference these variables in your Helm chart "template":

source:
chart: my-application
template: |
agent:
identifier: {{cluster.name}}
organization: {{cluster.organization}}
server:
endpoint: {{server}}

This template will inject those variables and be used as a values file when rendering the helm chart. This enables you to customize this installation when installing it across many clusters without having to make special per-cluster configuration if the platform already knows this information about your cluster.

Available Variables

Core Cluster Information

VariableDescriptionExample Value
{{cluster.name}}The name of the platform cluster"my-cluster"
{{cluster.uniqueName}}Unique identifier for the cluster"my-cluster-abc123"
{{cluster.organization}}The organization/namespace where the cluster is deployed"my-org"

DNS Configuration

VariableDescriptionExample Value
{{dns.domainName}}The cluster's domain name"cluster.example.com"
{{dns.cdnDomainName}}CDN domain name for the cluster"cdn.cluster.example.com"
{{dns.cdnHostedZoneId}}AWS CDN hosted zone ID (AWS clusters only)"Z1234567890ABC"

Orchestration Cluster

VariableDescriptionExample Value
{{orchestrationCluster.domain}}Domain of the orchestration cluster"orchestration.example.com"

Environment Configuration

VariableDescriptionExample Value
{{environment.name}}Environment name (dev, staging, prod, etc.)"dev"
{{environment.type}}Environment type (same as name)"dev"

OIDC Configuration

VariableDescriptionExample Value
{{oidc.issuer}}OIDC issuer URL"https://oidc.example.com"
{{oidc.scopes}}OIDC scopes["openid", "profile"]
{{oidc.org}}Organization ID for OIDC"org123"

Istio Configuration

VariableDescriptionExample Value
{{istio.enabled}}Whether Istio is enabledtrue or false
{{istio.defaultGateway}}Default Istio gateway name"default-gateway"

Cloud Provider Information

VariableDescriptionExample Value
{{cloud}}Cloud provider type"aws", "azure", or "vcluster"

AWS-Specific Variables (EKS clusters only)

VariableDescriptionExample Value
{{aws.region}}AWS region"us-east-1"
{{aws.accountId}}AWS account ID"123456789012"
{{aws.certificateArn}}SSL certificate ARN"arn:aws:acm:us-east-1:123456789012:certificate/abc123"
{{aws.eksOidcIssuerUrl}}EKS OIDC issuer URL"https://oidc.eks.us-east-1.amazonaws.com/id/ABC123"
{{aws.permissionBoundaryName}}Permission boundary name"MyPermissionBoundary"
{{aws.albOidcAnnotation}}ALB OIDC annotation"arn:aws:iam::123456789012:oidc-provider/oidc.eks.us-east-1.amazonaws.com/id/ABC123"
{{aws.wildcardCert}}Wildcard certificate ARN"arn:aws:acm:us-east-1:123456789012:certificate/abc123"

Azure-Specific Variables (AKS clusters only)

VariableDescriptionExample Value
{{azure.location}}Azure region/location"eastus"
{{azure.subscriptionId}}Azure subscription ID"12345678-1234-1234-1234-123456789012"
{{azure.resourceGroup}}Azure resource group name"my-resource-group"
{{azure.storageAccountName}}Storage account name"mystorageaccount"
{{azure.storageRedundancySku}}Storage redundancy SKU"Standard_LRS"
{{azure.aksOidcIssuerUrl}}AKS OIDC issuer URL"https://token.actions.githubusercontent.com"
{{azure.uniqueSuffix}}Unique suffix for Azure resources"a1b2c3d4"

Kubernetes Server Information

VariableDescriptionExample Value
{{server}}Kubernetes API server endpoint"https://api.cluster.example.com"

Example Templates

Basic Application Configuration

source:
chart: my-app
template: |
app:
name: "{{cluster.name}}-app"
environment: "{{environment.name}}"
organization: "{{cluster.organization}}"

ingress:
host: "{{cluster.name}}.{{dns.domainName}}"
tls:
secretName: "{{cluster.name}}-tls"

config:
apiEndpoint: "{{server}}"
oidcIssuer: "{{oidc.issuer}}"

AWS-Specific Configuration

source:
chart: aws-app
template: |
aws:
region: "{{aws.region}}"
accountId: "{{aws.accountId}}"
certificateArn: "{{aws.certificateArn}}"

istio:
enabled: {{istio.enabled}}
gateway: "{{istio.defaultGateway}}"

Azure-Specific Configuration

source:
chart: azure-app
template: |
azure:
location: "{{azure.location}}"
subscriptionId: "{{azure.subscriptionId}}"
resourceGroup: "{{azure.resourceGroup}}"
storageAccount: "{{azure.storageAccountName}}"

oidc:
issuer: "{{azure.aksOidcIssuerUrl}}"

Cluster Type Availability

Variable GroupEKSAKSvCluster
cluster.*
dns.*
orchestrationCluster.*
environment.*
oidc.*
istio.*
aws.*
azure.*
server

Best Practices

  1. Always provide fallbacks: Use Helm's default values for critical configuration
  2. Validate required fields: Check that required variables are available for your cluster type
  3. Use conditional logic: Leverage Helm's if statements to handle different cluster types
  4. Test across environments: Verify your templates work with different cluster configurations

Troubleshooting

If a variable is not available or contains an empty value:

  1. Check that your cluster type supports the variable
  2. Verify the cluster configuration has the required fields populated
  3. Use Helm's default function to provide fallback values: {{variable_name | default "fallback"}}
  4. Check the cluster-info secret in the target namespace to see what values are actually available