Skip to content

Chart Reference: azure-base

Detailed reference for every file in the charts/azure-base/ chart. Each template is shown alongside the real Crossplane CRD it renders.


Chart Structure

charts/azure-base/
├── Chart.yaml
├── values.yaml              # Defaults (dev-friendly)
├── values-dev.yaml
├── values-staging.yaml
├── values-prod.yaml
└── templates/
    ├── _helpers.tpl          # Name generation, labels, tags
    ├── resource-group.yaml   # azure.upbound.io/v1beta1 ResourceGroup
    ├── vnet.yaml             # network.azure.upbound.io/v1beta1 VirtualNetwork
    ├── subnets.yaml          # network.azure.upbound.io/v1beta1 Subnet (loops)
    ├── nsg.yaml              # network.azure.upbound.io/v1beta1 SecurityGroup + Association
    ├── storage.yaml          # storage.azure.upbound.io/v1beta1 Account + Container
    └── keyvault.yaml         # keyvault.azure.upbound.io/v1beta1 Vault

_helpers.tpl — Naming and Labeling

Name generation

Every resource name follows {project}-{environment}-{suffix}:

go
{{- define "azure-base.name" -}}
{{- printf "%s-%s-%s" .ctx.Values.project .ctx.Values.environment .suffix -}}
{{- end -}}

Usage in templates:

yaml
metadata:
  name: {{ include "azure-base.name" (dict "ctx" . "suffix" "vnet") }}
  # Renders: myapp-dev-vnet

This naming scheme is critical because Crossplane *Ref fields reference resources by metadata.name. As long as the naming helper is consistent, all cross-resource references resolve correctly.

Labels

Applied to every Kubernetes object (visible in kubectl get but not in Azure):

yaml
app.kubernetes.io/managed-by: helm
app.kubernetes.io/part-of: myapp
crossplane.io/environment: dev
crossplane.io/owner: platform-team

Tags

Applied to every Azure resource (visible in Azure portal and cost management):

yaml
project: myapp
environment: dev
owner: platform-team
managed-by: crossplane

resource-group.yaml

CRD: azure.upbound.io/v1beta1 ResourceGroupProvider: provider-family-azureAzure docs: Resource Group is a container for Azure resources.

yaml
apiVersion: azure.upbound.io/v1beta1
kind: ResourceGroup
metadata:
  name: myapp-dev-rg
spec:
  forProvider:
    location: eastus
    tags:
      project: myapp
      environment: dev
  providerConfigRef:
    name: default

Configurable values:

ValuePathDefault
Locationlocationeastus
Enable/disableresourceGroup.enabledtrue

Every other resource in this chart references the Resource Group via resourceGroupNameRef.


vnet.yaml

CRD: network.azure.upbound.io/v1beta1 VirtualNetworkProvider: provider-azure-network

yaml
apiVersion: network.azure.upbound.io/v1beta1
kind: VirtualNetwork
metadata:
  name: myapp-dev-vnet
spec:
  forProvider:
    location: eastus
    resourceGroupNameRef:
      name: myapp-dev-rg          # Crossplane resolves this at runtime
    addressSpace:
      - "10.0.0.0/16"
  providerConfigRef:
    name: default

Configurable values:

ValuePathDefault
Address spacenetwork.vnet.addressSpace10.0.0.0/16
Enable/disablenetwork.enabledtrue

Key CRD fields from the provider:

FieldTypeRequiredDescription
locationstringYesAzure region
resourceGroupNamestringYesRG name (or use *Ref)
addressSpacestring[]YesCIDR blocks for the VNet
bgpCommunitystringNoBGP community value
ddosProtectionPlanobjectNoDDoS protection configuration
encryptionobjectNoNetwork encryption settings

subnets.yaml

CRD: network.azure.upbound.io/v1beta1 SubnetProvider: provider-azure-network

This template loops over network.subnets in values, generating one Subnet MR per entry.

yaml
{{- range $subnetName, $subnet := .Values.network.subnets }}
apiVersion: network.azure.upbound.io/v1beta1
kind: Subnet
metadata:
  name: myapp-dev-subnet-{{ $subnetName }}   # e.g., myapp-dev-subnet-app
spec:
  forProvider:
    resourceGroupNameRef:
      name: myapp-dev-rg
    virtualNetworkNameRef:
      name: myapp-dev-vnet
    addressPrefixes:
      - "10.0.1.0/24"
    serviceEndpoints:
      - "Microsoft.Storage"
      - "Microsoft.KeyVault"
{{- end }}

Configurable values:

ValuePathDefault
App subnet CIDRnetwork.subnets.app.addressPrefix10.0.1.0/24
Data subnet CIDRnetwork.subnets.data.addressPrefix10.0.2.0/24
Service endpointsnetwork.subnets.<name>.serviceEndpoints[Microsoft.Storage]

Key CRD fields:

FieldTypeRequiredDescription
addressPrefixesstring[]YesCIDR blocks for the subnet
virtualNetworkNamestringYesParent VNet (or use *Ref)
serviceEndpointsstring[]NoAzure service endpoints to enable
delegationobject[]NoService delegations (e.g., for App Service)
privateEndpointNetworkPoliciesstringNoEnabled or Disabled

nsg.yaml

CRD: network.azure.upbound.io/v1beta1 SecurityGroup + SubnetNetworkSecurityGroupAssociationProvider: provider-azure-network

This template renders two resources:

  1. SecurityGroup — the NSG with inline security rules
  2. SubnetNetworkSecurityGroupAssociation — binds the NSG to the app subnet
yaml
# 1. The NSG
apiVersion: network.azure.upbound.io/v1beta1
kind: SecurityGroup
metadata:
  name: myapp-dev-nsg
spec:
  forProvider:
    location: eastus
    resourceGroupNameRef:
      name: myapp-dev-rg
    securityRule:
      - name: AllowHTTPS
        priority: 100
        direction: Inbound
        access: Allow
        protocol: "Tcp"
        sourcePortRange: "*"
        destinationPortRange: "443"
        sourceAddressPrefix: "*"
        destinationAddressPrefix: "10.0.1.0/24"
---
# 2. The association
apiVersion: network.azure.upbound.io/v1beta1
kind: SubnetNetworkSecurityGroupAssociation
metadata:
  name: myapp-dev-nsg-assoc-app
spec:
  forProvider:
    subnetIdRef:
      name: myapp-dev-subnet-app
    networkSecurityGroupIdRef:
      name: myapp-dev-nsg

Configurable values:

ValuePathDefault
Security rulesnsg.rules[]AllowHTTPS + AllowHTTP + DenyAll
Enable/disablensg.enabledtrue

Security rule structure:

yaml
nsg:
  rules:
    - name: AllowHTTPS          # Rule name
      priority: 100             # 100-4096, lower = higher priority
      direction: Inbound        # Inbound or Outbound
      access: Allow             # Allow or Deny
      protocol: Tcp             # Tcp, Udp, Icmp, or *
      sourcePortRange: "*"
      destinationPortRange: "443"
      sourceAddressPrefix: "*"
      destinationAddressPrefix: "10.0.1.0/24"

storage.yaml

CRD: storage.azure.upbound.io/v1beta1 Account + ContainerProvider: provider-azure-storage

Renders a Storage Account and loops over storage.containers[] for blob containers.

yaml
# Storage Account
apiVersion: storage.azure.upbound.io/v1beta1
kind: Account
metadata:
  name: myapp-dev-sa
spec:
  forProvider:
    location: eastus
    resourceGroupNameRef:
      name: myapp-dev-rg
    accountTier: Standard
    accountReplicationType: LRS
    accountKind: StorageV2
    httpsTrafficOnlyEnabled: true
    minTlsVersion: TLS1_2
    networkRules:
      - defaultAction: Deny
        bypass:
          - AzureServices
yaml
# One Container per entry in storage.containers[]
apiVersion: storage.azure.upbound.io/v1beta1
kind: Container
metadata:
  name: myapp-dev-container-data
spec:
  forProvider:
    containerAccessType: private
    storageAccountNameRef:
      name: myapp-dev-sa

Configurable values:

ValuePathDefault
Account tierstorage.accountTierStandard
Replicationstorage.accountReplicationTypeLRS
Kindstorage.accountKindStorageV2
HTTPS onlystorage.httpsOnlytrue
Min TLSstorage.minTlsVersionTLS1_2
Containersstorage.containers[][{name: data}, {name: logs}]

Key Account CRD fields:

FieldTypeDescription
accountTierstringStandard or Premium
accountReplicationTypestringLRS, ZRS, GRS, RAGRS, GZRS, RAGZRS
accountKindstringStorageV2, BlobStorage, BlockBlobStorage, FileStorage
networkRulesobject[]Firewall rules, VNet rules, bypass settings
blobPropertiesobjectVersioning, soft delete, change feed

keyvault.yaml

CRD: keyvault.azure.upbound.io/v1beta1 VaultProvider: provider-azure-keyvault

yaml
apiVersion: keyvault.azure.upbound.io/v1beta1
kind: Vault
metadata:
  name: myapp-dev-kv
spec:
  forProvider:
    location: eastus
    resourceGroupNameRef:
      name: myapp-dev-rg
    tenantId: "your-tenant-id"
    skuName: standard
    enableRbacAuthorization: true
    purgeProtectionEnabled: false
    softDeleteRetentionDays: 7

Configurable values:

ValuePathDefault
SKUkeyvault.skuNamestandard
RBAC authkeyvault.enableRbacAuthorizationtrue
Purge protectionkeyvault.purgeProtectionEnabledfalse
Soft delete dayskeyvault.softDeleteRetentionDays7
Public accesskeyvault.publicNetworkAccessEnabledtrue
Tenant IDkeyvault.tenantIdMust be overridden

Key Vault CRD fields:

FieldTypeDescription
tenantIdstringAzure AD tenant ID (required)
skuNamestringstandard or premium (HSM-backed keys require premium)
enableRbacAuthorizationboolUse Azure RBAC instead of access policies
purgeProtectionEnabledboolPrevents permanent deletion (cannot be disabled once on)
softDeleteRetentionDaysint7-90 days
networkAclsobject[]Firewall rules and VNet integration

Dependency Map

Arrows show *Ref dependencies. Crossplane resolves these at runtime — resources that depend on others will retry until the dependency becomes READY: True.

Released under the MIT License.