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/aks/node-access.md
+29-17Lines changed: 29 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,20 @@
1
1
---
2
-
title: SSH into Azure Kubernetes Service (AKS) cluster nodes
3
-
description: Learn how to create an SSH connection with Azure Kubernetes Service (AKS) cluster nodes for troubleshooting and maintenance tasks.
2
+
title: Connect to Azure Kubernetes Service (AKS) cluster nodes
3
+
description: Learn how to connect to Azure Kubernetes Service (AKS) cluster nodes for troubleshooting and maintenance tasks.
4
4
services: container-service
5
5
ms.topic: article
6
-
ms.date: 05/17/2021
6
+
ms.date: 02/25/2022
7
7
8
8
ms.custom: contperf-fy21q4
9
9
10
-
#Customer intent: As a cluster operator, I want to learn how to use SSH to connect to virtual machines in an AKS cluster to perform maintenance or troubleshoot a problem.
10
+
#Customer intent: As a cluster operator, I want to learn how to connect to virtual machines in an AKS cluster to perform maintenance or troubleshoot a problem.
11
11
---
12
12
13
-
# Connect with SSH to Azure Kubernetes Service (AKS) cluster nodes for maintenance or troubleshooting
13
+
# Connect to Azure Kubernetes Service (AKS) cluster nodes for maintenance or troubleshooting
14
14
15
-
Throughout the lifecycle of your Azure Kubernetes Service (AKS) cluster, you may need to access an AKS node. This access could be for maintenance, log collection, or other troubleshooting operations. You can access AKS nodes using SSH, including Windows Server nodes. You can also [connect to Windows Server nodes using remote desktop protocol (RDP) connections][aks-windows-rdp]. For security purposes, the AKS nodes aren't exposed to the internet. To SSH to the AKS nodes, you use `kubectl debug` or the private IP address.
15
+
Throughout the lifecycle of your Azure Kubernetes Service (AKS) cluster, you may need to access an AKS node. This access could be for maintenance, log collection, or other troubleshooting operations. You can access AKS nodes using SSH, including Windows Server nodes. You can also [connect to Windows Server nodes using remote desktop protocol (RDP) connections][aks-windows-rdp]. For security purposes, the AKS nodes aren't exposed to the internet. To connect to the AKS nodes, you use `kubectl debug` or the private IP address.
16
16
17
-
This article shows you how to create an SSH connection with an AKS node.
17
+
This article shows you how to create a connection to an AKS node.
18
18
19
19
## Before you begin
20
20
@@ -24,9 +24,9 @@ This article also assumes you have an SSH key. You can create an SSH key using [
24
24
25
25
You also need the Azure CLI version 2.0.64 or later installed and configured. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI][install-azure-cli].
26
26
27
-
## Create the SSH connection to a Linux node
27
+
## Create an interactive shell connection to a Linux node
28
28
29
-
To create an SSH connection to an AKS node, use `kubectl debug` to run a privileged container on your node. To list your nodes, use `kubectl get nodes`:
29
+
To create an interactive shell connection to a Linux node, use `kubectl debug` to run a privileged container on your node. To list your nodes, use `kubectl get nodes`:
Creating debugging pod node-debugger-aks-nodepool1-12345678-vmss000000-bkmmx with container debugger on node aks-nodepool1-12345678-vmss000000.
51
51
If you don't see a command prompt, try pressing enter.
52
52
root@aks-nodepool1-12345678-vmss000000:/#
@@ -57,11 +57,19 @@ This privileged container gives access to the node.
57
57
> [!NOTE]
58
58
> You can interact with the node session by running `chroot /host` from the privileged container.
59
59
60
+
### Remove Linux node access
61
+
62
+
When done, `exit` the interactive shell session. After the interactive container session closes, delete the pod used for access with `kubectl delete pod`.
63
+
64
+
```output
65
+
kubectl delete pod node-debugger-aks-nodepool1-12345678-vmss000000-bkmmx
66
+
```
67
+
60
68
## Create the SSH connection to a Windows node
61
69
62
-
At this time, you can't connect to a Windows Server node using SSH directly by using `kubectl debug`. Instead, you need to first connect to another node in the cluster, then connect to the Windows Server node from that node using SSH. Alternatively, you can [connect to Windows Server nodes using remote desktop protocol (RDP) connections][aks-windows-rdp] instead of using SSH.
70
+
At this time, you can't connect to a Windows Server node directly by using `kubectl debug`. Instead, you need to first connect to another node in the cluster, then connect to the Windows Server node from that node using SSH. Alternatively, you can [connect to Windows Server nodes using remote desktop protocol (RDP) connections][aks-windows-rdp] instead of using SSH.
63
71
64
-
To connect to another node in the cluster, use `kubectl debug`. For more information, see [Create the SSH connection to a Linux node][ssh-linux-kubectl-debug].
72
+
To connect to another node in the cluster, use `kubectl debug`. For more information, see [Create an interactive shell connection to a Linux node][ssh-linux-kubectl-debug].
65
73
66
74
To create the SSH connection to the Windows Server node from another node, use the SSH keys provided when you created the AKS cluster and the internal IP address of the Windows Server node.
67
75
@@ -125,9 +133,13 @@ The above example connects to port 22 on the Windows Server node through port 20
When done, `exit` the SSH session, stop any port forwarding, and then `exit` the interactive container session. After the interactive container session closes, delete the pod used for SSH access with `kubectl delete pod`.
129
139
130
-
When done, `exit` the SSH session, stop any port forwarding, and then `exit` the interactive container session. After the interactive container session closes, the pod used for SSH access from the AKS cluster is deleted.
140
+
```output
141
+
kubectl delete pod node-debugger-aks-nodepool1-12345678-vmss000000-bkmmx
142
+
```
131
143
132
144
## Next steps
133
145
@@ -143,4 +155,4 @@ If you need more troubleshooting data, you can [view the kubelet logs][view-kube
0 commit comments