Skip to content

Commit a6c8152

Browse files
authored
Merge pull request #2219 from mboersma/ssh-docs-fixes
Minor edits to "SSH access to nodes" doc
2 parents 7f28901 + b8d5873 commit a6c8152

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

docs/book/src/topics/ssh-access.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# SSH access to nodes
22

3-
This document describes how to get SSH access to virtual machines being part of a CAPZ cluster.
3+
This document describes how to get SSH access to virtual machines that are part of a CAPZ cluster.
44

55
In order to get SSH access to a Virtual Machine on Azure, two requirements have to be met:
66

7-
- get network-level access to the SSH service;
8-
- get authentication sorted.
7+
- get network-level access to the SSH service
8+
- get authentication sorted
99

10-
This documents describe some possible strategies to fulfil both requirements.
10+
This documents describe some possible strategies to fulfill both requirements.
1111

1212
## Network Access
1313

@@ -16,7 +16,7 @@ This documents describe some possible strategies to fulfil both requirements.
1616
By default, `control plane` VMs have SSH access allowed from any source in their `Network Security Group`s. Also by default,
1717
VMs don't have a public IP address assigned.
1818

19-
To get SSH access to one of the `Control Plane` VMs you can use the `API Load Balancer`'s IP, because by default an `Inbound NAT Rule`
19+
To get SSH access to one of the `control plane` VMs you can use the `API Load Balancer`'s IP, because by default an `Inbound NAT Rule`
2020
is created to route traffic coming to the load balancer on TCP port 22 (the SSH port) to one of the nodes with role `master` in the workload cluster.
2121

2222
This of course works only for clusters that are using a `Public` Load Balancer.
@@ -26,32 +26,32 @@ address for the other nodes.
2626

2727
For example, let's consider this CAPZ cluster (using a Public Load Balancer) with two nodes:
2828

29-
```
30-
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
31-
test1-control-plane-cn9lm Ready master 111m v1.18.16 10.0.0.4 <none> Ubuntu 18.04.5 LTS 5.4.0-1039-azure containerd://1.4.3
32-
test1-md-0-scctm Ready <none> 109m v1.18.16 10.1.0.4 <none> Ubuntu 18.04.5 LTS 5.4.0-1039-azure containerd://1.4.3
29+
```shell
30+
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
31+
test1-control-plane-cn9lm Ready control-plane,master 111m v1.18.16 10.0.0.4 <none> Ubuntu 18.04.5 LTS 5.4.0-1039-azure containerd://1.4.3
32+
test1-md-0-scctm Ready <none> 109m v1.18.16 10.1.0.4 <none> Ubuntu 18.04.5 LTS 5.4.0-1039-azure containerd://1.4.3
3333
```
3434

3535
You can SSH to the control plane node using the load balancer's public DNS name:
3636

37-
```
38-
$ kubectl get azurecluster test1 -o json| jq .spec.networkSpec.apiServerLB.frontendIPs[0].publicIP.dnsName
37+
```shell
38+
$ kubectl get azurecluster test1 -o json | jq '.spec.networkSpec.apiServerLB.frontendIPs[0].publicIP.dnsName'
3939
test1-21192f78.eastus.cloudapp.azure.com
4040

4141
$ ssh [email protected] hostname
4242
test1-control-plane-cn9lm
4343
```
4444

45-
As you can see, the Load Balancer routed the request to node `test1-control-plane-cn9lm` that is the only node with role `master` in this workload cluster.
45+
As you can see, the Load Balancer routed the request to node `test1-control-plane-cn9lm` that is the only node with role `control-plane` in this workload cluster.
4646

4747
In order to SSH to node 'test1-md-0-scctm', you can use the other node as a bastion:
4848

49-
```
49+
```shell
5050
5151
test1-md-0-scctm
5252
```
5353

54-
Clusters using an `Internal` Load Balancer (private clusters) can't use this approach. Network-level SSH access to those clusters have to be made on the private IP address of VMs
54+
Clusters using an `Internal` Load Balancer (private clusters) can't use this approach. Network-level SSH access to those clusters has to be made on the private IP address of VMs
5555
by first getting access to the Virtual Network. How to do that is out of the scope of this document.
5656
A possible alternative that works for private clusters as well is described in the next paragraph.
5757

@@ -65,7 +65,7 @@ It is enough to set the field's value to the empty object `{}` and the default c
6565

6666
For example this is an `AzureCluster` CR with the `Azure Bastion` feature enabled:
6767

68-
```
68+
```yaml
6969
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
7070
kind: AzureCluster
7171
metadata:
@@ -92,7 +92,7 @@ When the `AzureBastion` feature is enabled in a CAPZ cluster, 3 new resources wi
9292
The default values for the new resources should work for most use cases, but if you need to customize them you can
9393
provide your own values. Here is a detailed example:
9494

95-
```
95+
```yaml
9696
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
9797
kind: AzureCluster
9898
metadata:
@@ -121,7 +121,7 @@ With the networking part sorted, we still have to work out a way of authenticati
121121
In order to add an SSH authorized key for user `username` and provide `sudo` access to the `control plane` VMs, you can adjust the `KubeadmControlPlane` CR
122122
as in the following example:
123123

124-
```
124+
```yaml
125125
apiVersion: controlplane.cluster.x-k8s.io/v1alpha3
126126
kind: KubeadmControlPlane
127127
...
@@ -143,7 +143,7 @@ spec:
143143

144144
Similarly, you can achieve the same result for `Machine Deployments` by customizing the `KubeadmConfigTemplate` CR:
145145

146-
```
146+
```yaml
147147
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3
148148
kind: KubeadmConfigTemplate
149149
metadata:

0 commit comments

Comments
 (0)