Skip to content

Commit ff7b1eb

Browse files
committed
Allow configuring ASO for non-public cloud at install
1 parent e3c702c commit ff7b1eb

9 files changed

+86
-24
lines changed

api/v1beta1/azuremanagedcontrolplane_types.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,18 @@ type AzureManagedControlPlaneSpec struct {
192192
// - ChinaCloud: "AzureChinaCloud"
193193
// - PublicCloud: "AzurePublicCloud"
194194
// - USGovernmentCloud: "AzureUSGovernmentCloud"
195+
//
196+
// Note that values other than the default must also be accompanied by corresponding changes to the
197+
// aso-controller-settings Secret to configure ASO to refer to the non-Public cloud. ASO currently does
198+
// not support referring to multiple different clouds in a single installation. The following fields must
199+
// be defined in the Secret:
200+
// - AZURE_AUTHORITY_HOST
201+
// - AZURE_RESOURCE_MANAGER_ENDPOINT
202+
// - AZURE_RESOURCE_MANAGER_AUDIENCE
203+
//
204+
// See the [ASO docs] for more details.
205+
//
206+
// [ASO docs]: https://azure.github.io/azure-service-operator/guide/aso-controller-settings-options/
195207
// +optional
196208
AzureEnvironment string `json:"azureEnvironment,omitempty"`
197209

api/v1beta1/types_class.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@ type AzureClusterClassSpec struct {
4646
// - GermanCloud: "AzureGermanCloud"
4747
// - PublicCloud: "AzurePublicCloud"
4848
// - USGovernmentCloud: "AzureUSGovernmentCloud"
49+
//
50+
// Note that values other than the default must also be accompanied by corresponding changes to the
51+
// aso-controller-settings Secret to configure ASO to refer to the non-Public cloud. ASO currently does
52+
// not support referring to multiple different clouds in a single installation. The following fields must
53+
// be defined in the Secret:
54+
// - AZURE_AUTHORITY_HOST
55+
// - AZURE_RESOURCE_MANAGER_ENDPOINT
56+
// - AZURE_RESOURCE_MANAGER_AUDIENCE
57+
//
58+
// See the [ASO docs] for more details.
59+
//
60+
// [ASO docs]: https://azure.github.io/azure-service-operator/guide/aso-controller-settings-options/
4961
// +optional
5062
AzureEnvironment string `json:"azureEnvironment,omitempty"`
5163

config/aso/credentials.yaml

Lines changed: 0 additions & 10 deletions
This file was deleted.

config/aso/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace: capz-system
44
resources:
55
- https://github.com/Azure/azure-service-operator/releases/download/v2.3.0/azureserviceoperator_v2.3.0.yaml
66
- crds.yaml
7-
- credentials.yaml
7+
- settings.yaml
88

99
patches:
1010
- patch: |- # default kustomization includes a namespace already

config/aso/settings.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: aso-controller-settings
5+
type: Opaque
6+
stringData:
7+
AZURE_AUTHORITY_HOST: ${AZURE_AUTHORITY_HOST:=""}
8+
AZURE_RESOURCE_MANAGER_ENDPOINT: ${AZURE_RESOURCE_MANAGER_ENDPOINT:=""}
9+
AZURE_RESOURCE_MANAGER_AUDIENCE: ${AZURE_RESOURCE_MANAGER_AUDIENCE:=""}
10+
AZURE_SYNC_PERIOD: ${AZURE_SYNC_PERIOD:=""}
11+
# Per-resource Secrets will be created based on a Cluster's AzureClusterIdentity.
12+
AZURE_SUBSCRIPTION_ID: ""
13+
AZURE_TENANT_ID: ""
14+
AZURE_CLIENT_ID: ""

config/crd/bases/infrastructure.cluster.x-k8s.io_azureclusters.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,17 @@ spec:
8181
added by default.
8282
type: object
8383
azureEnvironment:
84-
description: 'AzureEnvironment is the name of the AzureCloud to be
85-
used. The default value that would be used by most users is "AzurePublicCloud",
86-
other values are: - ChinaCloud: "AzureChinaCloud" - GermanCloud:
87-
"AzureGermanCloud" - PublicCloud: "AzurePublicCloud" - USGovernmentCloud:
88-
"AzureUSGovernmentCloud"'
84+
description: "AzureEnvironment is the name of the AzureCloud to be
85+
used. The default value that would be used by most users is \"AzurePublicCloud\",
86+
other values are: - ChinaCloud: \"AzureChinaCloud\" - GermanCloud:
87+
\"AzureGermanCloud\" - PublicCloud: \"AzurePublicCloud\" - USGovernmentCloud:
88+
\"AzureUSGovernmentCloud\" \n Note that values other than the default
89+
must also be accompanied by corresponding changes to the aso-controller-settings
90+
Secret to configure ASO to refer to the non-Public cloud. ASO currently
91+
does not support referring to multiple different clouds in a single
92+
installation. The following fields must be defined in the Secret:
93+
- AZURE_AUTHORITY_HOST - AZURE_RESOURCE_MANAGER_ENDPOINT - AZURE_RESOURCE_MANAGER_AUDIENCE
94+
\n See the [ASO docs] for more details. \n [ASO docs]: https://azure.github.io/azure-service-operator/guide/aso-controller-settings-options/"
8995
type: string
9096
bastionSpec:
9197
description: BastionSpec encapsulates all things related to the Bastions

config/crd/bases/infrastructure.cluster.x-k8s.io_azureclustertemplates.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,19 @@ spec:
5454
addition to the ones added by default.
5555
type: object
5656
azureEnvironment:
57-
description: 'AzureEnvironment is the name of the AzureCloud
57+
description: "AzureEnvironment is the name of the AzureCloud
5858
to be used. The default value that would be used by most
59-
users is "AzurePublicCloud", other values are: - ChinaCloud:
60-
"AzureChinaCloud" - GermanCloud: "AzureGermanCloud" - PublicCloud:
61-
"AzurePublicCloud" - USGovernmentCloud: "AzureUSGovernmentCloud"'
59+
users is \"AzurePublicCloud\", other values are: - ChinaCloud:
60+
\"AzureChinaCloud\" - GermanCloud: \"AzureGermanCloud\"
61+
- PublicCloud: \"AzurePublicCloud\" - USGovernmentCloud:
62+
\"AzureUSGovernmentCloud\" \n Note that values other than
63+
the default must also be accompanied by corresponding changes
64+
to the aso-controller-settings Secret to configure ASO to
65+
refer to the non-Public cloud. ASO currently does not support
66+
referring to multiple different clouds in a single installation.
67+
The following fields must be defined in the Secret: - AZURE_AUTHORITY_HOST
68+
- AZURE_RESOURCE_MANAGER_ENDPOINT - AZURE_RESOURCE_MANAGER_AUDIENCE
69+
\n See the [ASO docs] for more details. \n [ASO docs]: https://azure.github.io/azure-service-operator/guide/aso-controller-settings-options/"
6270
type: string
6371
bastionSpec:
6472
description: BastionSpec encapsulates all things related to

config/crd/bases/infrastructure.cluster.x-k8s.io_azuremanagedcontrolplanes.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,17 @@ spec:
218218
type: string
219219
type: object
220220
azureEnvironment:
221-
description: 'AzureEnvironment is the name of the AzureCloud to be
222-
used. The default value that would be used by most users is "AzurePublicCloud",
223-
other values are: - ChinaCloud: "AzureChinaCloud" - PublicCloud:
224-
"AzurePublicCloud" - USGovernmentCloud: "AzureUSGovernmentCloud"'
221+
description: "AzureEnvironment is the name of the AzureCloud to be
222+
used. The default value that would be used by most users is \"AzurePublicCloud\",
223+
other values are: - ChinaCloud: \"AzureChinaCloud\" - PublicCloud:
224+
\"AzurePublicCloud\" - USGovernmentCloud: \"AzureUSGovernmentCloud\"
225+
\n Note that values other than the default must also be accompanied
226+
by corresponding changes to the aso-controller-settings Secret to
227+
configure ASO to refer to the non-Public cloud. ASO currently does
228+
not support referring to multiple different clouds in a single installation.
229+
The following fields must be defined in the Secret: - AZURE_AUTHORITY_HOST
230+
- AZURE_RESOURCE_MANAGER_ENDPOINT - AZURE_RESOURCE_MANAGER_AUDIENCE
231+
\n See the [ASO docs] for more details. \n [ASO docs]: https://azure.github.io/azure-service-operator/guide/aso-controller-settings-options/"
225232
type: string
226233
controlPlaneEndpoint:
227234
description: ControlPlaneEndpoint represents the endpoint used to

docs/book/src/topics/aso.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@ the resource will not be deleted in Azure.
3636
Additionally, BYO resources may include ASO resources managed by the user. CAPZ will not modify or delete such
3737
resources. Note that `clusterctl move` will not move user-managed ASO resources.
3838

39+
## Configuration with Environment Variables
40+
41+
These environment variables are passed through to the `aso-controller-settings` Secret to configure ASO when
42+
CAPZ is installed and are consumed by `clusterctl init`. They may also be modified directly in the Secret
43+
after installing ASO with CAPZ:
44+
45+
- `AZURE_AUTHORITY_HOST`
46+
- `AZURE_RESOURCE_MANAGER_AUDIENCE`
47+
- `AZURE_RESOURCE_MANAGER_ENDPOINT`
48+
- `AZURE_SYNC_PERIOD`
49+
50+
More details on each can be found in [ASO's documentation](https://azure.github.io/azure-service-operator/guide/aso-controller-settings-options/).
51+
3952
## Using ASO for non-CAPZ resources
4053

4154
CAPZ's installation of ASO can be used directly to manage Azure resources outside the domain of

0 commit comments

Comments
 (0)