XResourceGroup¶
Experimental
This API is experimental and may change without notice.
An Azure resource group: the container every other resource in this platform is created inside.
API¶
| Group | azure.platform.example.org |
| Kind | XResourceGroup |
| Plural | xresourcegroups |
| Scope | Namespaced |
| Versions | v1alpha1 (referenceable) |
| Source | compositions/azure/resourcegroup/xrd.yaml |
Spec¶
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name immutable |
string |
yes | — | Name of the Azure resource group. |
location |
string |
no | swedencentral |
Azure region for the resource group. |
tags (nullable) |
map[string]string |
no | null |
Optional tags to apply to the resource group. |
Fields marked immutable are fixed once the resource is created; changing one is rejected by the API server. An immutable object pins the fields nested under it too. To change one, delete the resource and create it again.
Example¶
Most teams create one resource group per environment and then reference it by its logical name from the other compositions. The Azure resource is named rg-<spec.name>.
---
# Namespaced (see compositions/azure/resourcegroup/xrd.yaml) — the team
# Kustomization supplies the team's namespace automatically.
apiVersion: azure.platform.example.org/v1alpha1
kind: XResourceGroup
metadata:
name: mvpdagen-demo
spec:
name: mvpdagen-demo
location: swedencentral
Taken from teams/mvpdagen/resourcegroup.yaml,
which is applied to the cluster by Flux, so it cannot drift from a working
manifest.
Status¶
Populated by Crossplane once the underlying Azure resources exist. Every
composite in this repository exposes the provisioned Azure resource ID as
status.id.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
id |
string |
no | — | Azure resource ID of the resource group. |
name |
string |
no | — | Name of the provisioned resource group. |
Common problems¶
The XR stays SYNCED=False with an authorization or subscription error.
Cause. The azure-secret credentials do not have permission to create resource groups in the target subscription.
Fix. Re-run the bootstrap script so the service principal is recreated with the Contributor role, then delete and recreate the XR.
A second XR reports that the resource group already exists.
Cause. spec.name collides with a resource group created by another team.
Fix. Pick a unique spec.name; names are global within a subscription.