Skip to content

Commit dc8f2f6

Browse files
committed
Various doc updates
1 parent 951aa55 commit dc8f2f6

File tree

1 file changed

+55
-41
lines changed

1 file changed

+55
-41
lines changed

articles/service-connector/how-to-use-service-connector-in-aks.md

Lines changed: 55 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,71 @@
11
---
2-
title: How Service Connector helps Azure Kubernetes Service (AKS) connect to other Azure services
3-
description: Learn how to use Service Connector in Azure Kubernetes Service (AKS).
2+
title: Use Service Connector in Azure Kubernetes Service (AKS)
3+
description: Learn how to use Service Connector to connect AKS to other Azure services. Learn about Service Connector operations, resource management, and troubleshooting.
44
author: houk-ms
55
ms.service: service-connector
66
ms.topic: conceptual
7-
ms.date: 03/01/2024
7+
ms.date: 02/06/2025
88
ms.author: honc
99
---
10+
1011
# How to use Service Connector in Azure Kubernetes Service (AKS)
1112

12-
Azure Kubernetes Service (AKS) is one of the compute services supported by Service Connector. This article aims to help you understand:
13+
Azure Kubernetes Service (AKS) is one of the compute services supported by Service Connector.
14+
This article aims to help you understand:
1315

1416
* What operations are made on the cluster when creating a service connection.
15-
* How to use the kubernetes resources Service Connector creates.
16-
* How to troubleshoot and view logs of Service Connector in an AKS cluster.
17+
* How to use the Kubernetes resources created by Service Connector.
18+
* How to troubleshoot and view Service Connector logs in an AKS cluster.
1719

1820
## Prerequisites
1921

2022
* This guide assumes that you already know the [basic concepts of Service Connector](concept-service-connector-internals.md).
2123

22-
## What operations Service Connector makes on the cluster
24+
## Learn about operations performed by Service Connector on the AKS cluster
2325

2426
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.
2527

26-
### Add the Service Connector kubernetes extension
28+
### Adding the Service Connector Kubernetes extension
2729

28-
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.
30+
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.
2931

3032
:::image type="content" source="./media/aks-tutorial/sc-extension.png" alt-text="Screenshot of the Azure portal, view AKS extension.":::
3133

3234
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`.
3335

34-
### Create kubernetes resources
36+
### Creating the Kubernetes resources
3537

36-
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.
38+
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.
3739

38-
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.
40+
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.
3941

40-
:::image type="content" source="./media/aks-tutorial/kubernetes-resources.png" alt-text="Screenshot of the Azure portal, view Service Connector created kubernetes resources.":::
42+
:::image type="content" source="./media/aks-tutorial/kubernetes-resources.png" alt-text="Screenshot of the Azure portal, view Service Connector created Kubernetes resources.":::
4143

4244
Deleting a service connection doesn't delete the associated Kubernetes resource. If necessary, remove your resource manually, using for example the kubectl delete command.
4345

44-
### Enable the `azureKeyvaultSecretsProvider` addon
46+
### Enabling the `azureKeyvaultSecretsProvider` add-on
4547

4648
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.
4749

4850
:::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.":::
4951

5052
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.
5153

52-
### Enable workload identity and OpenID Connect (OIDC) issuer
54+
### Enabling workload identity and OpenID Connect (OIDC) issuer
5355

5456
If the authentication type is `Workload Identity` when creating a service connection, Service Connector enables workload identity and OIDC issuer for the cluster.
5557

5658
:::image type="content" source="./media/aks-tutorial/workload-identity.png" alt-text="Screenshot of the Azure portal, using workload identity to create a connection.":::
5759

5860
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.
5961

60-
## How to use the Service Connector created kubernetes resources
62+
## Use the Kubernetes resources created by Service Connector
6163

62-
Different kubernetes resources are created when the target service type and authentication type are different. The following sections show how to use the Service Connector created kubernetes resources in your cluster workloads definition and application codes.
64+
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 Service Connector created Kubernetes resources in your cluster workloads definition and application codes.
6365

64-
#### Kubernetes secret
66+
### Kubernetes secret
6567

66-
A kubernetes secret is created when the authentication type is `Connection String` or `Service Principal`. Your cluster workload definition can reference the secret directly. The following snippet is an example.
68+
A Kubernetes secret is created when the authentication type is `Connection String` or `Service Principal`. Your cluster workload definition can reference the secret directly. The following snippet is an example.
6769

6870
```yaml
6971
apiVersion: batch/v1
@@ -87,9 +89,9 @@ spec:
8789

8890
Then, your application codes can consume the connection string in the secret from environment variable. You can check the [sample code](./how-to-integrate-storage-blob.md) to learn more about the environment variable names and how to use them in your application codes to authenticate to different target services.
8991

90-
#### Kubernetes service account
92+
### Kubernetes service account
9193

92-
Both a kubernetes service account and a secret are created when the authentication type is `Workload Identity`. Your cluster workload definition can reference the service account and secret to authenticate through workload identity. The following snippet provides an example.
94+
Both a Kubernetes service account and a secret are created when the authentication type is `Workload Identity`. Your cluster workload definition can reference the service account and secret to authenticate through workload identity. The following snippet provides an example.
9395

9496
```yaml
9597
apiVersion: batch/v1
@@ -115,13 +117,13 @@ spec:
115117
116118
You may check the tutorial to learn [how to connect to Azure Storage using workload identity](tutorial-python-aks-storage-workload-identity.md).
117119
118-
## How to troubleshoot and view logs
120+
## Troubleshoot and view logs
119121
120122
If an error happens and couldn't be mitigated by retrying when creating a service connection, the following methods can help gather more information for troubleshooting.
121123
122-
### Check Service Connector kubernetes extension
124+
### Check Service Connector Kubernetes extension
123125
124-
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 investigate if there are any errors during the extension installation or updating.
126+
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 investigate if there are any errors during the extension installation or updating.
125127
126128
1. Install the `k8s-extension` Azure CLI extension.
127129

@@ -139,9 +141,9 @@ Service Connector kubernetes extension is built on top of [Azure Arc-enabled Kub
139141
--name sc-extension
140142
```
141143

142-
### Check kubernetes cluster logs
144+
### Check Kubernetes cluster logs
143145

144-
If there's an error during the extension installation, and the error message in the `statuses` property doesn't provide enough information about what happened, you can further check the kubernetes logs with the followings steps.
146+
If there's an error during the extension installation, and the error message in the `statuses` property doesn't provide enough information about what happened, you can further check the Kubernetes logs with the followings steps.
145147

146148
1. Connect to your AKS cluster.
147149

@@ -163,7 +165,7 @@ If there's an error during the extension installation, and the error message in
163165
```Bash
164166
helm list -n sc-system
165167
```
166-
1. During the extension installation or updating, a kubernetes job called `sc-job` creates the kubernetes resources for the service connection. The job execution failure usually causes the extension failure. Check the job status by running the following commands. If `sc-job` doesn't exist in `sc-system` namespace, it should have been executed successfully. This job is designed to be automatically deleted after successful execution.
168+
1. During the extension installation or updating, a Kubernetes job called `sc-job` creates the Kubernetes resources for the service connection. The job execution failure usually causes the extension failure. Check the job status by running the following commands. If `sc-job` doesn't exist in `sc-system` namespace, it should have been executed successfully. This job is designed to be automatically deleted after successful execution.
167169

168170
- Check the job exists.
169171

@@ -185,73 +187,85 @@ If there's an error during the extension installation, and the error message in
185187

186188
### Common errors and mitigations
187189

188-
#### Extension creation errors
190+
#### Extension creation error
191+
192+
**Error message:**
189193

190-
**Error Message:**
191194
`Unable to get a response from the agent in time`.
192195

193196
**Mitigation:**
197+
194198
Refer to [extension creation errors](/troubleshoot/azure/azure-kubernetes/extensions/cluster-extension-deployment-errors#extension-creation-errors)
195199

196200

197201
#### Helm errors
198202

199-
**Error Message:**
203+
**Error messages:**
204+
200205
- `Timed out waiting for resource readiness`
201206
- `Unable to download the Helm chart from the repo URL`
202207
- `Helm chart rendering failed with given values`
203208
- `Resource already exists in your cluster`
204209
- `Operation is already in progress for Helm`
205210

206211
**Mitigation:**
212+
207213
Refer to [Helm errors](/troubleshoot/azure/azure-kubernetes/extensions/cluster-extension-deployment-errors#helm-errors)
208214

209215

210216
#### Conflict
211217

212-
**Error Message:**
218+
**Error message:**
219+
213220
`Operation returned an invalid status code: Conflict`.
214221

215222
**Reason:**
216-
This error usually occurs when attempting to create a service connection while the AKS (Azure Kubernetes Service) cluster is in an updating state. The service connection update conflicts with the ongoing update. It could also happen when your subscription is not registered for the `Microsoft.KubernetesConfiguration` resource provider.
223+
224+
This error usually occurs when attempting to create a service connection while the Azure Kubernetes Service (AKS) cluster is in an updating state. The service connection update conflicts with the ongoing update. This error also occurs when your subscription is not registered with the `Microsoft.KubernetesConfiguration` resource provider.
217225

218226
**Mitigation:**
219-
- Run the following command to make sure your subscription is registered for `Microsoft.KubernetesConfiguration` resource provider.
227+
228+
1. Ensure your cluster is in a "Succeeded" state and retry the creation.
229+
1. Run the following command to make sure your subscription is registered with the `Microsoft.KubernetesConfiguration` resource provider.
220230

221231
```azurecli
222232
az provider register -n Microsoft.KubernetesConfiguration
223233
```
224-
- Ensure your cluster is in a "Succeeded" state and retry the creation.
225-
226234

227235
#### Unauthorized resource access
228236

229-
**Error Message:**
237+
**Error message:**
238+
230239
`You do not have permission to perform ... If access was recently granted, please refresh your credentials`.
231240

232241
**Reason:**
242+
233243
Service Connector requires permissions to operate the Azure resources you want to connect to, in order to perform connection operations on your behalf. This error indicates a lack of necessary permissions on some Azure resources.
234244

235245
**Mitigation:**
236-
Check the permissions on the Azure resources specified in the error message. Obtain the required permissions and retry the creation.
237246

247+
Check the permissions on the Azure resources specified in the error message. Obtain the required permissions and retry the creation.
238248

239249
#### Missing subscription registration
240-
**Error Message:**
250+
251+
**Error message:**
252+
241253
`The subscription is not registered to use namespace 'Microsoft.KubernetesConfiguration'`
242254

243255
**Reason:**
244-
Service Connector requires the subscription to be registered for `Microsoft.KubernetesConfiguration`, which is the resource provider for [Azure Arc-enabled Kubernetes cluster extensions](/azure/azure-arc/kubernetes/extensions).
256+
257+
Service Connector requires the subscription to be registered with `Microsoft.KubernetesConfiguration`, which is the resource provider for [Azure Arc-enabled Kubernetes cluster extensions](/azure/azure-arc/kubernetes/extensions).
245258

246259
**Mitigation:**
247-
Register the `Microsoft.KubernetesConfiguration` resource provider by running the following command. For more information on resource provider registration errors, please refer to this [tutorial](../azure-resource-manager/troubleshooting/error-register-resource-provider.md).
260+
261+
Register the `Microsoft.KubernetesConfiguration` resource provider by running the following command. For more information on resource provider registration errors, please refer to [Resolve errors for resource provider registration](../azure-resource-manager/troubleshooting/error-register-resource-provider.md).
248262

249263
```azurecli
250264
az provider register -n Microsoft.KubernetesConfiguration
251265
```
252266

253267

254-
## Next steps
268+
## Next step
255269

256270
Learn how to integrate different target services and read about their configuration settings and authentication methods.
257271

0 commit comments

Comments
 (0)