Skip to content

Commit 2cd0609

Browse files
Kubernetes resource view for Arc-enabled K8s
1 parent 6b0409e commit 2cd0609

File tree

1 file changed

+25
-32
lines changed

1 file changed

+25
-32
lines changed

articles/azure-arc/kubernetes/cluster-connect.md

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,20 @@ A conceptual overview of this feature is available in [Cluster connect - Azure A
2323

2424
- Install the `connectedk8s` Azure CLI extension of version >= 1.1.0:
2525

26-
```azurecli
26+
```console
2727
az extension add --name connectedk8s
2828
```
2929
3030
If you've already installed the `connectedk8s` extension, update the extension to the latest version:
3131
32-
```azurecli
32+
```console
3333
az extension update --name connectedk8s
3434
```
3535

3636
- An existing Azure Arc-enabled Kubernetes connected cluster.
3737
- If you haven't connected a cluster yet, use our [quickstart](quickstart-connect-cluster.md).
3838
- [Upgrade your agents](agent-upgrade.md#manually-upgrade-agents) to version >= 1.1.0.
3939

40-
- Enable the Cluster Connect on any Azure Arc-enabled Kubernetes cluster by running the following command on a machine where the `kubeconfig` file is pointed to the cluster of concern:
41-
42-
```azurecli
43-
az connectedk8s enable-features --features cluster-connect -n <clusterName> -g <resourceGroupName>
44-
```
45-
4640
- Enable the below endpoints for outbound access in addition to the ones mentioned under [connecting a Kubernetes cluster to Azure Arc](quickstart-connect-cluster.md#meet-network-requirements):
4741

4842
| Endpoint | Port |
@@ -58,45 +52,44 @@ A conceptual overview of this feature is available in [Cluster connect - Azure A
5852
ARM_ID_CLUSTER=$(az connectedk8s show -n $CLUSTER_NAME -g $RESOURCE_GROUP --query id -o tsv)
5953
```
6054

55+
6156
## Enable Cluster Connect feature
6257

6358
You can enable the Cluster Connect on any Azure Arc-enabled Kubernetes cluster by running the following command on a machine where the `kubeconfig` file is pointed to the cluster of concern:
6459

65-
```azurecli
60+
```console
6661
az connectedk8s enable-features --features cluster-connect -n $CLUSTER_NAME -g $RESOURCE_GROUP
6762
```
6863

6964
## Azure Active Directory authentication option
7065

71-
1. With the `kubeconfig` file pointing to the `apiserver` of your Kubernetes cluster, create a ClusterRoleBinding or RoleBinding to the Azure AD entity (service principal or user) requiring access:
66+
1. Get the `objectId` associated with your Azure AD entity:
7267

73-
1. Get the `objectId` associated with your Azure AD entity:
68+
- For Azure AD user account:
7469

75-
- For Azure AD user account:
76-
77-
```console
78-
AAD_ENTITY_OBJECT_ID=$(az ad signed-in-user show --query objectId -o tsv)
79-
```
70+
```console
71+
AAD_ENTITY_OBJECT_ID=$(az ad signed-in-user show --query objectId -o tsv)
72+
```
8073

81-
- For Azure AD application:
74+
- For Azure AD application:
8275

83-
```console
84-
AAD_ENTITY_OBJECT_ID=$(az ad sp show --id <id> --query objectId -o tsv)
85-
```
76+
```console
77+
AAD_ENTITY_OBJECT_ID=$(az ad sp show --id <id> --query objectId -o tsv)
78+
```
8679

87-
1. Authorize the AAD entity with appropriate permissions:
80+
1. Authorize the AAD entity with appropriate permissions:
8881

89-
- If you are using Kubernetes native ClusterRoleBinding or RoleBinding for authorization checks on the cluster, you can create one mapped to the Azure AD entity (service principal or user) that needs to access this cluster. Example:
90-
91-
```console
92-
kubectl create clusterrolebinding admin-user-binding --clusterrole cluster-admin --user=$AAD_ENTITY_OBJECT_ID
93-
```
82+
- If you are using Kubernetes native ClusterRoleBinding or RoleBinding for authorization checks on the cluster, with the `kubeconfig` file pointing to the `apiserver` of your cluster for direct access, you can create one mapped to the Azure AD entity (service principal or user) that needs to access this cluster. Example:
83+
84+
```console
85+
kubectl create clusterrolebinding admin-user-binding --clusterrole cluster-admin --user=$AAD_ENTITY_OBJECT_ID
86+
```
9487

95-
- If you are using Azure RBAC for authorization checks on the cluster, you can create an Azure role assignment mapped to the Azure AD entity. Example:
88+
- If you are using Azure RBAC for authorization checks on the cluster, you can create an Azure role assignment mapped to the Azure AD entity. Example:
9689

97-
```azurecli
98-
az role assignment create --role "Azure Arc Kubernetes Viewer" --assignee $AAD_ENTITY_OBJECT_ID --scope $ARM_ID_CLUSTER
99-
```
90+
```console
91+
az role assignment create --role "Azure Arc Kubernetes Viewer" --assignee $AAD_ENTITY_OBJECT_ID --scope $ARM_ID_CLUSTER
92+
```
10093

10194
## Service account token authentication option
10295

@@ -128,13 +121,13 @@ az connectedk8s enable-features --features cluster-connect -n $CLUSTER_NAME -g $
128121

129122
- If using Azure Active Directory authentication option, after logging into Azure CLI using the Azure AD entity of interest, get the Cluster Connect `kubeconfig` needed to communicate with the cluster from anywhere (from even outside the firewall surrounding the cluster):
130123

131-
```azurecli
124+
```console
132125
az connectedk8s proxy -n $CLUSTER_NAME -g $RESOURCE_GROUP
133126
```
134127

135128
- If using the service account authentication option, get the Cluster Connect `kubeconfig` needed to communicate with the cluster from anywhere:
136129

137-
```azurecli
130+
```console
138131
az connectedk8s proxy -n $CLUSTER_NAME -g $RESOURCE_GROUP --token $TOKEN
139132
```
140133

0 commit comments

Comments
 (0)