Skip to content

Commit 56a18f6

Browse files
committed
Added some recomendation
1 parent 53209fa commit 56a18f6

File tree

1 file changed

+39
-39
lines changed

1 file changed

+39
-39
lines changed

articles/operator-nexus/howto-kubernetes-cluster-connect.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -19,45 +19,6 @@ Throughout the lifecycle of your Azure Operator Nexus Kubernetes cluster, you ev
1919
* SSH private key for the cluster nodes.
2020
* To SSH using the node IP address, you must deploy a jumpbox VM on the same Container Network Interface (CNI) network as the cluster nodes.
2121

22-
## Access nodes using the Kubernetes API
23-
24-
This method requires usage of `kubectl debug` command.
25-
26-
### Access to Kubernetes API via Azure Arc for Kubernetes
27-
28-
[!INCLUDE [quickstart-cluster-connect](./includes/kubernetes-cluster/cluster-connect.md)]
29-
30-
### Access to cluster nodes via Azure Arc for Kubernetes
31-
32-
Once you're connected to a cluster via Arc for Kubernetes, you can connect to individual Kubernetes node using the `kubectl debug` command to run a privileged container on your node.
33-
34-
1. List the nodes in your Nexus Kubernetes cluster:
35-
36-
```console
37-
$> kubectl get nodes
38-
NAME STATUS ROLES AGE VERSION
39-
mynexusk8scluster-0b32128d-agentpool1-md-7h9t4 Ready <none> 125m v1.24.9
40-
mynexusk8scluster-0b32128d-agentpool1-md-c6xbs Ready <none> 125m v1.24.9
41-
mynexusk8scluster-0b32128d-control-plane-qq5jm Ready <none> 124m v1.24.9
42-
```
43-
44-
2. Start a privileged container on your node and connect to it:
45-
46-
```console
47-
$> kubectl debug node/mynexusk8scluster-0b32128d-agentpool1-md-7h9t4 -it --image=mcr.microsoft.com/cbl-mariner/base/core:2.0
48-
Creating debugging pod node-debugger-mynexusk8scluster-0b32128d-agentpool1-md-7h9t4-694gg with container debugger on node mynexusk8scluster-0b32128d-agentpool1-md-7h9t4.
49-
If you don't see a command prompt, try pressing enter.
50-
root [ / ]#
51-
```
52-
53-
This privileged container gives access to the node. Execute commands on the cluster node by running `chroot /host` at the command line.
54-
55-
3. When you're done with a debugging pod, enter the `exit` command to end the interactive shell session. After exiting the shell, make sure to delete the pod:
56-
57-
```bash
58-
kubectl delete pod node-debugger-mynexusk8scluster-0b32128d-agentpool1-md-7h9t4-694gg
59-
```
60-
6122
## Access to cluster nodes via Azure Arc for servers
6223

6324
The `az ssh arc` command allows users to remotely access a cluster VM that has been connected to Azure Arc. This method is a secure way to SSH into the cluster node directly from the command line, making it a quick and efficient method for remote management.
@@ -106,6 +67,45 @@ The `az ssh arc` command allows users to remotely access a cluster VM that has b
10667
--private-key-file $SSH_PRIVATE_KEY_FILE
10768
```
10869

70+
## Access nodes using the Kubernetes API
71+
72+
This method requires usage of `kubectl debug` command. This method is limited to containers and may miss wider system issues, unlike SSH (using 'az ssh arc' or direct IP), which offers full node access and control.
73+
74+
### Access to Kubernetes API via Azure Arc for Kubernetes
75+
76+
[!INCLUDE [quickstart-cluster-connect](./includes/kubernetes-cluster/cluster-connect.md)]
77+
78+
### Access to cluster nodes via Azure Arc for Kubernetes
79+
80+
Once you're connected to a cluster via Arc for Kubernetes, you can connect to individual Kubernetes node using the `kubectl debug` command to run a privileged container on your node.
81+
82+
1. List the nodes in your Nexus Kubernetes cluster:
83+
84+
```console
85+
$> kubectl get nodes
86+
NAME STATUS ROLES AGE VERSION
87+
mynexusk8scluster-0b32128d-agentpool1-md-7h9t4 Ready <none> 125m v1.24.9
88+
mynexusk8scluster-0b32128d-agentpool1-md-c6xbs Ready <none> 125m v1.24.9
89+
mynexusk8scluster-0b32128d-control-plane-qq5jm Ready <none> 124m v1.24.9
90+
```
91+
92+
2. Start a privileged container on your node and connect to it:
93+
94+
```console
95+
$> kubectl debug node/mynexusk8scluster-0b32128d-agentpool1-md-7h9t4 -it --image=mcr.microsoft.com/cbl-mariner/base/core:2.0
96+
Creating debugging pod node-debugger-mynexusk8scluster-0b32128d-agentpool1-md-7h9t4-694gg with container debugger on node mynexusk8scluster-0b32128d-agentpool1-md-7h9t4.
97+
If you don't see a command prompt, try pressing enter.
98+
root [ / ]#
99+
```
100+
101+
This privileged container gives access to the node. Execute commands on the cluster node by running `chroot /host` at the command line.
102+
103+
3. When you're done with a debugging pod, enter the `exit` command to end the interactive shell session. After exiting the shell, make sure to delete the pod:
104+
105+
```bash
106+
kubectl delete pod node-debugger-mynexusk8scluster-0b32128d-agentpool1-md-7h9t4-694gg
107+
```
108+
109109
## Create an interactive shell connection to a node using the IP address
110110
111111
### Connecting to the cluster node from Azure jumpbox

0 commit comments

Comments
 (0)