Skip to content

Commit 55e0559

Browse files
authored
Merge pull request #4273 from dtzar/Podiddeprecation
Docs: Pod identity deprecation
2 parents 4475fa7 + e5680c7 commit 55e0559

File tree

4 files changed

+113
-122
lines changed

4 files changed

+113
-122
lines changed

docs/book/src/SUMMARY.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@
2121
- [GPU-enabled Clusters](./topics/gpu.md)
2222
- [Confidential VMs](./topics/confidential-vms.md)
2323
- [Trusted Launch for VMs](./topics/trusted-launch-for-vms.md)
24-
- [Identity use cases](./topics/identities-use-cases.md)
24+
- [Identities](./topics/identities.md)
25+
- [Identity use cases](./topics/identities-use-cases.md)
26+
- [Multi-tenancy](./topics/multitenancy.md)
27+
- [Workload Identity](./topics/workload-identity.md)
2528
- [IPv6](./topics/ipv6.md)
2629
- [Machine Pools (VMSS)](./topics/machinepools.md)
2730
- [Managed Clusters (AKS)](./topics/managedcluster.md)
28-
- [Multitenancy](./topics/multitenancy.md)
2931
- [Node Outbound Connection](./topics/node-outbound-connection.md)
3032
- [OS Disk](./topics/os-disk.md)
3133
- [Spot Virtual Machines](./topics/spot-vms.md)
@@ -35,7 +37,6 @@
3537
- [Windows](./topics/windows.md)
3638
- [Flatcar](./topics/flatcar.md)
3739
- [WebAssembly / WASI Pods](./topics/wasi.md)
38-
- [Workload Identity](./topics/workload-identity.md)
3940
- [Development](./developers/development.md)
4041
- [Kubernetes Developers](./developers/kubernetes-developers.md)
4142
- [Releasing](./developers/releasing.md)
Lines changed: 18 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,22 @@
1-
## How to use Identities with CAPZ
1+
# Identity User Stories
22

3-
## CAPZ controller:
4-
This is the identity used by the management cluster to provision infrastructure in Azure
5-
- Multi-tenant config via AzureClusterIdentity
6-
- [AAD Pod Identity](https://azure.github.io/aad-pod-identity/) using Service Principals and Managed Identities: by default, the identity used by the workload cluster running on Azure is the same Service Principal assigned to the management cluster. If an identity is specified on the Azure Cluster Resource, that identity will be used when creating Azure resources related to that cluster. See [Multi-tenancy](multitenancy.md) page for details.
7-
More details in [Azure built-in roles documentation](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles).
3+
This describes some common user stories for identities being utilized with CAPZ.
4+
Please see the core [identities page](identities.md) first.
5+
Also see related [identities use cases](identities-use-cases.md) and [Multi-tenancy](multitenancy.md) pages.
86

9-
<aside class="note warning">
10-
11-
<h1> Warning </h1>
12-
13-
The capability to set credentials using environment variables has been removed, the required approach is to use `AzureClusterIdentity` as explained [here](multitenancy.md)
14-
15-
</aside>
16-
17-
## Azure Host Identity:
18-
The identity assigned to the Azure host which in the control plane provides the identity to Azure Cloud Provider, and can be used on all nodes to provide access to Azure services during cloud-init, etc.
19-
20-
- User-assigned Managed Identity
21-
- System-assigned Managed Identity
22-
- Service Principal
23-
- See details about each type in the [VM identity](vm-identity.md) page
24-
25-
## Pod Identity:
26-
The identity used by pods running within the workload cluster to provide access to Azure services during runtime. For example, to access blobs stored in Azure Storage or to access Azure database services.
27-
- [AAD Pod Identity](https://azure.github.io/aad-pod-identity/): The workload cluster requires an identity to communicate with Azure. This identity can be either a managed identity (in the form of system-assigned identity or user-assigned identity) or a service principal. The AAD Pod Identity pod allows the cluster to use the Identity referenced by the Azure CLuster to access cloud resources securely with Azure Active Directory.
28-
29-
## User Stories
30-
31-
#### Story 1 - Locked down with Service Principal Per Subscription
7+
## Story 1 - Locked down with Service Principal Per Subscription
328

339
Alex is an engineer in a large organization which has a strict Azure account architecture. This architecture dictates that Kubernetes clusters must be hosted in dedicated Subscriptions with AAD identity having RBAC rights to provision the infrastructure only in the Subscription. The workload clusters must run with a System Assigned machine identity. The organization has adopted Cluster API in order to manage Kubernetes infrastructure, and expects 'management' clusters running the Cluster API controllers to manage 'workload' clusters in dedicated Azure Subscriptions with an AAD account which only has access to that Subscription.
3410

3511
The current configuration exists:
36-
* Subscription for each cluster
37-
* AAD Service Principals with Subscription Owner rights for each Subscription
38-
* A management Kubernetes cluster running Cluster API Provider Azure controllers
12+
13+
- Subscription for each cluster
14+
- AAD Service Principals with Subscription Owner rights for each Subscription
15+
- A management Kubernetes cluster running Cluster API Provider Azure controllers
3916

4017
Alex can provision a new workload cluster in the specified Subscription with the corresponding AAD Service Principal by creating new Cluster API resources in the management cluster. Each of the workload cluster machines would run as the System Assigned identity described in the Cluster API resources. The CAPZ controller in the management cluster uses the Service Principal credentials when reconciling the AzureCluster so that it can create/use/destroy resources in the workload cluster.
4118

42-
#### Story 2 - Locked down by Namespace and Subscription
19+
## Story 2 - Locked down by Namespace and Subscription
4320

4421
Alex is an engineer in a large organization which has a strict Azure account architecture. This architecture dictates that Kubernetes clusters must be hosted in dedicated Subscriptions with AAD identity having RBAC rights to provision the infrastructure only in the Subscription. The workload clusters must run with a System Assigned machine identity.
4522

@@ -49,26 +26,23 @@ The organization has adopted Cluster API in order to manage Kubernetes infrastru
4926
API controllers to manage 'workload' clusters in dedicated Azure Subscriptions with an AAD account which only has access to that Subscription.
5027

5128
The current configuration exists:
52-
* Subscription for each cluster
53-
* AAD Service Principals with Subscription Owner rights for each Subscription
54-
* A management Kubernetes cluster running Cluster API Provider Azure controllers
29+
30+
- Subscription for each cluster
31+
- AAD Service Principals with Subscription Owner rights for each Subscription
32+
- A management Kubernetes cluster running Cluster API Provider Azure controllers
5533

5634
Alex can provision a new workload cluster in the specified Subscription with the corresponding AAD Service Principal by creating new Cluster API resources in the management cluster in the predetermined namespace. Each of the workload cluster machines would run as the System Assigned identity described in the Cluster API resources. The CAPZ controller in the management cluster uses the Service Principal credentials when reconciling the AzureCluster so that it can create/use/destroy resources in the workload cluster.
5735

5836
Erin can provision an identity in a namespace of limited access and define the allowed namespaces, which will include the predetermined namespace for the workload cluster.
5937

60-
#### Story 3 - Using an Azure User Assigned Identity
38+
## Story 3 - Using an Azure User Assigned Identity
6139

6240
Erin is an engineer working in a large organization. Erin does not want to be responsible for ensuring Service Principal secrets are rotated on a regular basis. Erin would like to use an Azure User Assigned Identity to provision workload cluster infrastructure. The User Assigned Identity will have the RBAC rights needed to provision the infrastructure in Erin's subscription.
6341

6442
The current configuration exists:
6543

66-
* Subscription for the workload cluster
67-
* A User Assigned Identity with RBAC with Subscription Owner rights for the Subscription
68-
* A management Kubernetes cluster running Cluster API Provider Azure controllers
44+
- Subscription for the workload cluster
45+
- A User Assigned Identity with RBAC with Subscription Owner rights for the Subscription
46+
- A management Kubernetes cluster running Cluster API Provider Azure controllers
6947

7048
Erin can provision a new workload cluster in the specified Subscription with the Azure User Assigned Identity by creating new Cluster API resources in the management cluster. The CAPZ controller in the management cluster uses the User Assigned Identity credentials when reconciling the AzureCluster so that it can create/use/destroy resources in the workload cluster.
71-
72-
#### Story 4 - Legacy Behavior Preserved
73-
74-
Dascha is an engineer in a smaller, less strict organization with a few Azure accounts intended to build all infrastructure. There is a single Azure Subscription named 'dev', and Dascha wants to provision a new cluster in this Subscription. An existing Kubernetes cluster is already running the Cluster API operators and managing resources in the dev Subscription. Dascha can provision a new cluster by creating Cluster API resources in the existing cluster, omitting the ProvisionerIdentity field in the AzureCluster spec. The CAPZ operator will use the Azure credentials provided in its deployment template.

docs/book/src/topics/identities.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Supported Identity methods
2+
3+
Identities are used on the management cluster and the VMs/clusters/workloads which get provisioned by the management cluster.
4+
Also see relevant [identities use cases](identities-use-cases.md), [Azure Active Directory integration](aad-integration.md), and [Multi-tenancy](multitenancy.md) pages.
5+
6+
## Deprecated Identity Types
7+
8+
<aside class="note warning">
9+
10+
<h1> Warning </h1>
11+
The capability to set credentials using environment variables has been removed, the required approach is to use `AzureClusterIdentity` as shown with the below supported identity examples.
12+
</aside>
13+
14+
<aside class="note warning">
15+
<h1> Warning </h1>
16+
All of the methods which utilize AAD Pod Identity will no longer function starting in the 1.13 release of CAPZ.
17+
</aside>
18+
19+
For more details on the deprecated Pod identity types, [see this page](multitenancy.md#deprecated-identity-types)
20+
21+
## Workload Identity (Recommended)
22+
23+
Follow this [link](./workload-identity.md) for a quick start guide on setting up workload identity.
24+
25+
Once you've set up the management cluster with the workload identity (see link above), the corresponding values should be used to create an `AzureClusterIdentity` resource. Create an `azure-cluster-identity.yaml` file with the following content:
26+
27+
```yaml
28+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
29+
kind: AzureClusterIdentity
30+
metadata:
31+
name: cluster-identity
32+
spec:
33+
type: WorkloadIdentity
34+
tenantID: <your-tenant-id>
35+
clientID: <your-client-id>
36+
allowedNamespaces:
37+
list:
38+
- <cluster-namespace>
39+
```
40+
41+
## Manual Service Principal Identity
42+
43+
Manual Service Principal Identity uses the service principal's `clientSecret` directly fetched from the secret containing it. To use this type of identity, set the identity type as `ManualServicePrincipal` in `AzureClusterIdentity`. For example,
44+
45+
```yaml
46+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
47+
kind: AzureClusterIdentity
48+
metadata:
49+
name: example-identity
50+
namespace: default
51+
spec:
52+
type: ManualServicePrincipal
53+
tenantID: <azure-tenant-id>
54+
clientID: <client-id-of-SP-identity>
55+
clientSecret: {"name":"<secret-name-for-client-password>","namespace":"default"}
56+
allowedNamespaces:
57+
list:
58+
- <cluster-namespace>
59+
```
60+
61+
## Azure Host Identity
62+
63+
The identity assigned to the Azure host which in the control plane provides the identity to Azure Cloud Provider, and can be used on all nodes to provide access to Azure services during cloud-init, etc.
64+
65+
- User-assigned Managed Identity
66+
- System-assigned Managed Identity
67+
- Service Principal
68+
- See details about each type in the [VM identity](vm-identity.md) page
69+
70+
More details in [Azure built-in roles documentation](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles).

docs/book/src/topics/multitenancy.md

Lines changed: 21 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,32 @@
22

33
To enable single controller multi-tenancy, a different Identity can be added to the Azure Cluster that will be used as the Azure Identity when creating Azure resources related to that cluster.
44

5-
This is achieved using [workload identity](https://azure.github.io/azure-workload-identity). Workload identity is the next iteration of the now deprecated [aad-pod-identity](https://azure.github.io/aad-pod-identity).
5+
This is achieved using [workload identity](workload-identity.md).
66

7-
## Identity Types
7+
## Supported Identity Types
88

9-
### Workload Identity (Recommended)
9+
Please read the [identities](identities.md) page for more information on the supported identity types.
1010

11-
Follow this [link](./workload-identity.md) for a quick start guide on setting up workload identity.
11+
### allowedNamespaces
1212

13-
Once you've set up the management cluster with the workload identity (see link above), the corresponding values should be used to create an `AzureClusterIdentity` resource. Create an `azure-cluster-identity.yaml` file with the following content:
13+
AllowedNamespaces is used to identify the namespaces the clusters are allowed to use the identity from. Namespaces can be selected either using an array of namespaces or with label selector.
14+
An empty allowedNamespaces object indicates that AzureClusters can use this identity from any namespace.
15+
If this object is nil, no namespaces will be allowed (default behavior, if this field is not provided)
16+
A namespace should be either in the NamespaceList or match with Selector to use the identity.
17+
Please note NamespaceList will take precedence over Selector if both are set.
1418

15-
```yaml
16-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
17-
kind: AzureClusterIdentity
18-
metadata:
19-
name: cluster-identity
20-
spec:
21-
type: WorkloadIdentity
22-
tenantID: <your-tenant-id>
23-
clientID: <your-client-id>
24-
allowedNamespaces:
25-
list:
26-
- <cluster-namespace>
27-
```
19+
## Deprecated Identity Types
20+
21+
<aside class="note warning">
22+
23+
<h1> Warning </h1>
24+
The capability to set credentials using environment variables has been removed, the required approach is to use `AzureClusterIdentity` as seen in the [identities](identities.md) page.
25+
</aside>
26+
27+
<aside class="note warning">
28+
<h1> Warning </h1>
29+
All of the remaining methods utilize AAD Pod Identity and will no longer function starting in the 1.13 release of CAPZ.
30+
</aside>
2831

2932
### AAD Pod Identity using Service Principal With Client Password (Deprecated)
3033

@@ -153,60 +156,3 @@ spec:
153156
#### Assigning VM identities for cloud-provider authentication
154157

155158
When using a user-assigned managed identity to create the workload cluster, a VM identity should also be assigned to each control-plane machine in the workload cluster for Cloud Provider to use. See [here](../topics/vm-identity.md#managed-identities) for more information.
156-
157-
### Manual Service Principal Identity
158-
159-
Manual Service Principal Identity is similar to [Service Principal Identity](https://capz.sigs.k8s.io/topics/multitenancy.html#service-principal-identity) except that the service principal's `clientSecret` is directly fetched from the secret containing it.
160-
To use this type of identity, set the identity type as `ManualServicePrincipal` in `AzureClusterIdentity`. For example,
161-
162-
```yaml
163-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
164-
kind: AzureClusterIdentity
165-
metadata:
166-
name: example-identity
167-
namespace: default
168-
spec:
169-
type: ManualServicePrincipal
170-
tenantID: <azure-tenant-id>
171-
clientID: <client-id-of-SP-identity>
172-
clientSecret: {"name":"<secret-name-for-client-password>","namespace":"default"}
173-
allowedNamespaces:
174-
list:
175-
- <cluster-namespace>
176-
```
177-
178-
The rest of the configuration is the same as that of service principal identity. This useful in scenarios where you don't want to have a dependency on [aad-pod-identity](https://azure.github.io/aad-pod-identity).
179-
180-
## allowedNamespaces
181-
182-
AllowedNamespaces is used to identify the namespaces the clusters are allowed to use the identity from. Namespaces can be selected either using an array of namespaces or with label selector.
183-
An empty allowedNamespaces object indicates that AzureClusters can use this identity from any namespace.
184-
If this object is nil, no namespaces will be allowed (default behaviour, if this field is not provided)
185-
A namespace should be either in the NamespaceList or match with Selector to use the identity.
186-
Please note NamespaceList will take precedence over Selector if both are set.
187-
188-
## IdentityRef in AzureCluster
189-
190-
The Identity can be added to an `AzureCluster` by using `IdentityRef` field:
191-
192-
```yaml
193-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
194-
kind: AzureCluster
195-
metadata:
196-
name: example-cluster
197-
namespace: default
198-
spec:
199-
location: eastus
200-
networkSpec:
201-
vnet:
202-
name: example-cluster-vnet
203-
resourceGroup: example-cluster
204-
subscriptionID: <AZURE_SUBSCRIPTION_ID>
205-
identityRef:
206-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
207-
kind: AzureClusterIdentity
208-
name: <name-of-identity>
209-
namespace: <namespace-of-identity>
210-
```
211-
212-

0 commit comments

Comments
 (0)