Skip to content

Commit d78aad4

Browse files
authored
Merge pull request #189957 from erik-ha-msft/erikha-aks-ssh
[AKS] - Update ssh.md
2 parents 1dae6db + 36ad7b1 commit d78aad4

File tree

3 files changed

+37
-20
lines changed

3 files changed

+37
-20
lines changed

.openpublishing.redirection.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2385,9 +2385,14 @@
23852385
},
23862386
{
23872387
"source_path_from_root": "/articles/aks/aks-ssh.md",
2388-
"redirect_url": "/azure/aks/ssh",
2388+
"redirect_url": "/azure/aks/node-access",
23892389
"redirect_document_id": true
23902390
},
2391+
{
2392+
"source_path_from_root": "/articles/aks/ssh.md",
2393+
"redirect_url": "/azure/aks/node-access",
2394+
"redirect_document_id": false
2395+
},
23912396
{
23922397
"source_path_from_root": "/articles/aks/windows-node-limitations.md",
23932398
"redirect_url": "/azure/aks/windows-faq",

articles/aks/TOC.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,8 @@
473473
items:
474474
- name: Common issues
475475
href: troubleshooting.md
476-
- name: SSH node access
477-
href: ssh.md
476+
- name: Node access
477+
href: node-access.md
478478
- name: Linux performance tools
479479
href: troubleshoot-linux.md
480480
- name: Check for Resource Health events (preview)

articles/aks/ssh.md renamed to articles/aks/node-access.md

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
---
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.
44
services: container-service
55
ms.topic: article
6-
ms.date: 05/17/2021
6+
ms.date: 02/25/2022
77

88
ms.custom: contperf-fy21q4
99

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.
1111
---
1212

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
1414

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.
1616

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.
1818

1919
## Before you begin
2020

@@ -24,9 +24,9 @@ This article also assumes you have an SSH key. You can create an SSH key using [
2424

2525
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].
2626

27-
## Create the SSH connection to a Linux node
27+
## Create an interactive shell connection to a Linux node
2828

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`:
3030

3131
```output
3232
$ kubectl get nodes -o wide
@@ -40,13 +40,13 @@ aksnpwin000000 Ready agent 87s v1.19.9 10.240.0.
4040
Use `kubectl debug` to run a container image on the node to connect to it.
4141

4242
```azurecli-interactive
43-
kubectl debug node/aks-nodepool1-12345678-vmss000000 -it --image=mcr.microsoft.com/aks/fundamental/base-ubuntu:v0.0.11
43+
kubectl debug node/aks-nodepool1-12345678-vmss000000 -it --image=mcr.microsoft.com/dotnet/runtime-deps:6.0
4444
```
4545

46-
This command starts a privileged container on your node and connects to it over SSH.
46+
This command starts a privileged container on your node and connects to it.
4747

4848
```output
49-
$ kubectl debug node/aks-nodepool1-12345678-vmss000000 -it --image=mcr.microsoft.com/aks/fundamental/base-ubuntu:v0.0.11
49+
$ kubectl debug node/aks-nodepool1-12345678-vmss000000 -it --image=mcr.microsoft.com/dotnet/runtime-deps:6.0
5050
Creating debugging pod node-debugger-aks-nodepool1-12345678-vmss000000-bkmmx with container debugger on node aks-nodepool1-12345678-vmss000000.
5151
If you don't see a command prompt, try pressing enter.
5252
root@aks-nodepool1-12345678-vmss000000:/#
@@ -57,11 +57,19 @@ This privileged container gives access to the node.
5757
> [!NOTE]
5858
> You can interact with the node session by running `chroot /host` from the privileged container.
5959
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+
6068
## Create the SSH connection to a Windows node
6169

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.
6371

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].
6573

6674
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.
6775

@@ -125,9 +133,13 @@ The above example connects to port 22 on the Windows Server node through port 20
125133
> ssh -o 'ProxyCommand ssh -p 2022 -W %h:%p [email protected]' -o PreferredAuthentications=password [email protected]
126134
> ```
127135
128-
## Remove SSH access
136+
### Remove SSH access
137+
138+
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`.
129139
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+
```
131143
132144
## Next steps
133145

@@ -143,4 +155,4 @@ If you need more troubleshooting data, you can [view the kubelet logs][view-kube
143155
[aks-windows-rdp]: rdp.md
144156
[ssh-nix]: ../virtual-machines/linux/mac-create-ssh-keys.md
145157
[ssh-windows]: ../virtual-machines/linux/ssh-from-windows.md
146-
[ssh-linux-kubectl-debug]: #create-the-ssh-connection-to-a-linux-node
158+
[ssh-linux-kubectl-debug]: #create-an-interactive-shell-connection-to-a-linux-node

0 commit comments

Comments
 (0)