You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/service-connector/how-to-use-service-connector-in-aks.md
+85-18Lines changed: 85 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,58 +11,117 @@ ms.author: honc
11
11
12
12
# Use Service Connector in Azure Kubernetes Service (AKS)
13
13
14
-
Azure Kubernetes Service (AKS) is one of the compute services supported by Service Connector.
15
-
This article aims to help you understand:
14
+
Azure Kubernetes Service (AKS) is one of the compute services supported by Service Connector.
16
15
17
-
* What operations are made on the cluster when creating a service connection.
18
-
* How to use the Kubernetes resources created by Service Connector.
19
-
* How to troubleshoot and view Service Connector logs in an AKS cluster.
16
+
This article covers:
17
+
18
+
* The differences between Service Connector for AKS and other compute services.
19
+
* The operations executed on the cluster during the creation of a service connection.
20
+
* The operations executed on the target services during the creation of a service connection.
21
+
* Using the Kubernetes resources created by Service Connector.
22
+
* Troubleshooting and viewing Service Connector logs in an AKS cluster.
20
23
21
24
## Prerequisites
22
25
23
26
* This guide assumes that you already know the [basic concepts of Service Connector](concept-service-connector-internals.md).
24
27
28
+
## Differences between Service Connector for AKS and other compute services
29
+
30
+
Service Connector for AKS differs from how it operates with other [compute services supported by Service Connector](/azure/service-connector/overview#what-services-are-supported-by-service-connector) in several ways. The following outlines AKS-specific options and behaviors for each API operation.
31
+
32
+
### Creation
33
+
34
+
The AKS-specific creation options are listed below. Refer to the [Azure portal](/azure/service-connector/quickstart-portal-aks-connection) or [Azure CLI](/azure/service-connector/quickstart-cli-aks-connection) quickstarts to learn how to create a new connection in AKS.
35
+
36
+
- Service Connector for AKS requires the `Kubernetes namespace` parameter to specify where to [create the Kubernetes resources](#creating-the-kubernetes-resources). By default, it uses the `default` namespace.
37
+
- Service Connector for AKS supports `Workload Identity` as the secure credential authentication option, while other compute services offer `System Managed Identity` and `User Managed Identity` options.
38
+
- When using Azure Key Vault as the target service with the Secret Store CSI Driver enabled, Service Connector uses the user-assigned managed identity from the AKS `azure-keyvault-secrets-provider` add-on for authentication, without requiring users to specify the authentication type.
39
+
- Service Connector for AKS only supports the `Firewall Rules` networking option, whereas other compute services may also support `Private Link` and `Virtual Network` options.
40
+
41
+
### List configurations
42
+
43
+
Service Connector for AKS displays only non-credential configurations in the list configuration views. Users should manually check the credentials in the [associated Kubernetes resource](#creating-the-kubernetes-resources) if needed.
44
+
45
+
Using the Azure CLI command [az aks connection list-configuration](/cli/azure/aks/connection?view=azure-cli-latest&preserve-view=true#az-aks-connection-list-configuration), the value of a credential configuration is an empty string. In the Azure portal, the value of a credential configuration is hidden, as shown below.
46
+
47
+
:::image type="content" source="./media/aks-tutorial/aks-list-config.png" alt-text="Screenshot of the AKS connection listing configuration.":::
48
+
49
+
### Validation
50
+
51
+
Service Connector for AKS doesn't validate configuration value changes made within the user's cluster, whether they're credential or non-credential configurations. However, Service Connector performs the following validations, as it does for other compute services:
52
+
53
+
- Verifying the existence of the target service
54
+
- Checking IP firewall rules for access to the target service
55
+
- Ensuring role assignment for workload identity to access the target service
56
+
57
+
The output of the Azure CLI command [az aks connection validate](/cli/azure/aks/connection?view=azure-cli-latest&preserve-view=true#az-aks-connection-validate) is always `success`. The same applies to the Azure portal, as shown below.
58
+
59
+
:::image type="content" source="./media/aks-tutorial/aks-validate.png" alt-text="Screenshot of the AKS connection validation.":::
60
+
25
61
## Operations performed by Service Connector on the AKS cluster
26
62
27
-
Depending on the different target services and authentication types selected when creating a service connection, Service Connector makes different operations on the AKS cluster. The following lists the possible operations made by Service Connector.
63
+
The operations performed by Service Connector on the AKS cluster vary depending on the target services and authentication types selected when creating a service connection. The following lists the possible operations made by Service Connector.
28
64
29
65
### Adding the Service Connector Kubernetes extension
30
66
31
-
A Kubernetes extension named `sc-extension` is added to the cluster the first time a service connection is created. Later on, the extension helps create Kubernetes resources in user's cluster, whenever a service connection request comes to Service Connector. You can find the extension in your AKS cluster in the Azure portal, in the **Extensions + applications** menu.
67
+
A Kubernetes extension named `sc-extension` is added to the cluster the first time a service connection is created. Later on, the extension helps create Kubernetes resources in the user's cluster, whenever a service connection request comes to Service Connector. The extension is found in the user's AKS cluster in the Azure portal, in the **Extensions + applications** menu.
32
68
33
69
:::image type="content" source="./media/aks-tutorial/sc-extension.png" alt-text="Screenshot of the Azure portal, view AKS extension.":::
34
70
35
-
The extension is also where the cluster connections metadata are stored. Uninstalling the extension makes all the connections in the cluster unavailable. The extension operator is hosted in the cluster namespace `sc-system`.
71
+
The cluster connection's metadata are also stored in the extension. Uninstalling the extension renders all the connections in the cluster unavailable. The extension operator is hosted in the cluster namespace `sc-system`.
36
72
37
73
### Creating the Kubernetes resources
38
74
39
-
Service Connector creates some Kubernetes resources to the namespace the user specified when creating a service connection. The Kubernetes resources store the connection information, which is needed by the user's workload definitions or application code to talk to target services. Depending on different authentication types, different Kubernetes resources are created. For the `Connection String` and `Service Principal` auth types, a Kubernetes secret is created. For the `Workload Identity` auth type, a Kubernetes service account is also created in addition to a Kubernetes secret.
75
+
Service Connector creates Kubernetes resources in the namespace the user specifies when creating the service connection. The Kubernetes resources store the connection informationneeded by the user's workload definitions or application code to communicate with the target services. Depending on the authentication type, different Kubernetes resources are created. For the `Connection String` and `Service Principal` auth types, a Kubernetes secret is created. For the `Workload Identity` auth type, a Kubernetes service account is also created in addition to a Kubernetes secret.
40
76
41
77
You can find the Kubernetes resources created by Service Connector for each service connection on the Azure portal in your Kubernetes resource, in the Service Connector menu.
42
78
43
79
:::image type="content" source="./media/aks-tutorial/kubernetes-resources.png" alt-text="Screenshot of the Azure portal, view Service Connector created Kubernetes resources.":::
44
80
45
-
Deleting a service connection doesn't delete the associated Kubernetes resource. If necessary, remove your resource manually, using for example the kubectl delete command.
81
+
Deleting a service connection doesn't delete the associated Kubernetes resource. If necessary, remove your resource manually, using for example the `kubectl delete` command.
46
82
47
83
### Enabling the `azureKeyvaultSecretsProvider` add-on
48
84
49
-
If target service is Azure Key Vault and the Secret Store CSI Driver is enabled when creating a service connection, Service Connector enables the `azureKeyvaultSecretsProvider` add-on for the cluster.
85
+
If the target service is Azure Key Vault and the Secret Store CSI Driver is enabled, Service Connector enables the `azureKeyvaultSecretsProvider` add-on for the cluster.
50
86
51
87
:::image type="content" source="./media/aks-tutorial/keyvault-csi.png" alt-text="Screenshot of the Azure portal, enabling CSI driver for keyvault when creating a connection.":::
52
88
53
-
Follow the [Connect to Azure Key Vault using CSI driver tutorial](./tutorial-python-aks-keyvault-csi-driver.md)to set up a connection to Azure Key Vault using Secret Store CSI driver.
89
+
Follow the [Connect to Azure Key Vault using CSI driver tutorial](./tutorial-python-aks-keyvault-csi-driver.md)to set up a connection to Azure Key Vault using Secret Store CSI driver.
54
90
55
91
### Enabling workload identity and OpenID Connect (OIDC) issuer
56
92
57
-
If the authentication type is `Workload Identity` when creating a service connection, Service Connector enables workload identity and OIDC issuer for the cluster.
93
+
If the authentication type is `Workload Identity`, Service Connector enables workload identity and OIDC issuer for the cluster.
58
94
59
95
:::image type="content" source="./media/aks-tutorial/workload-identity.png" alt-text="Screenshot of the Azure portal, using workload identity to create a connection.":::
60
96
61
-
When the authentication type is `Workload Identity`, a user-assigned managed identity is needed to create the federated identity credential. Learn more from [what are workload identities](/entra/workload-id/workload-identities-overview), or follow the [tutorial](./tutorial-python-aks-storage-workload-identity.md)to set up a connection to Azure Storage using workload identity.
97
+
If the authentication type is `Workload Identity`, a user-assigned managed identity is needed to create the federated identity credential. Learn more about [workload identities](/entra/workload-id/workload-identities-overview) or refer [the following tutorial](./tutorial-python-aks-storage-workload-identity.md) to set up a connection to Azure Storage using a workload identity.
98
+
99
+
## Operations performed by Service Connector on the target services
100
+
101
+
Service Connector for AKS performs the same operations on target services as other compute services. However, the operations vary depending on the target service types and authentication methods. The following lists some possible operations.
102
+
103
+
### Get connection configurations
104
+
105
+
Service Connector retrieves the required connection configurations from the target service and sets them as a Kubernetes secret in the user's cluster. The connection configurations vary based on the target service type and authentication method:
106
+
107
+
- For the `Connection String` authentication type, the configuration typically includes a service secret or connection string.
108
+
- For the `Workload Identity` authentication type, it usually contains the service endpoint.
109
+
- For the `Service Principal` authentication type, it contains the service principal's tenant ID, client ID, and client secret.
110
+
111
+
For detailed information on specific target services, refer to the corresponding documentation, such as the [Azure AI services](/azure/service-connector/how-to-integrate-ai-services?tabs=dotnet#system-assigned-managed-identity-recommended) guide.
112
+
113
+
### Create IP based firewall rules
114
+
115
+
Service Connector retrieves the outbound public IP from the AKS cluster and creates IP firewall rules on the target service to allow network access from the cluster.
116
+
117
+
### Create Microsoft Entra ID role assignments
118
+
119
+
When using the `Workload Identity` authentication type, Service Connector automatically creates a role assignment for the identity. The assigned role varies based on the target service to ensure appropriate access.
120
+
Users can also customize role assignments as needed. For more information, see [role customization](/azure/service-connector/concept-microsoft-entra-roles#role-customization).
62
121
63
122
## Use the Kubernetes resources created by Service Connector
64
123
65
-
Various Kubernetes resources are created by Service Connector depending on the target service type and authentication type. The following sections show how to use the Kubernetes resources created by Service Connector in your cluster workloads definition and application code.
124
+
Service Connector creates various Kubernetes resources depending on the target service type and authentication type selected. The following sections show how to use the Kubernetes resources created by Service Connector in your cluster workloads definition and application code.
66
125
67
126
### Kubernetes secret
68
127
@@ -124,7 +183,7 @@ If an error occurs and can't be resolved by retrying when creating a service con
124
183
125
184
### Check Service Connector Kubernetes extension
126
185
127
-
The Service Connector Kubernetes extension is built on top of [Azure Arc-enabled Kubernetes cluster extensions](/azure/azure-arc/kubernetes/extensions). Use the following commands to check for any errors that occurred during the extension installation or update process.
186
+
The Service Connector Kubernetes extension is built on top of [Azure Arc-enabled Kubernetes cluster extensions](/azure/azure-arc/kubernetes/extensions). Use the following commands to check for any errors occurring during the extension installation or update process.
128
187
129
188
1. Install the `k8s-extension` Azure CLI extension.
130
189
@@ -193,7 +252,8 @@ If an error occurs during the extension installation and the error message in th
193
252
194
253
**Error message:**
195
254
196
-
`Unable to get a response from the agent in time`.
255
+
- `Unable to get a response from the agent in time`.
256
+
- `Extension pods can't be scheduled if all the node pools in the cluster are "CriticalAddonsOnly" tainted`
197
257
198
258
**Mitigation:**
199
259
@@ -204,8 +264,15 @@ Refer to [extension creation errors](/troubleshoot/azure/azure-kubernetes/extens
204
264
205
265
**Error messages:**
206
266
207
-
- `Timed out waiting for resource readiness`
208
267
- `Unable to download the Helm chart from the repo URL`
268
+
269
+
This error is caused by connectivity problems that occur between the cluster and the firewall in addition to egress blocking problems.
270
+
To resolve this problem, see [Outbound network and FQDN rules for Azure Kubernetes Service (AKS) clusters](/azure/aks/outbound-rules-control-egress),
271
+
and add the FQDN required to pull Service Connector Helm chart: `scaksextension.azurecr.io`
0 commit comments