Skip to content

Commit dd5cd28

Browse files
authored
Merge pull request #2784 from replicatedhq/114747
add `cluster shell` doc page
2 parents 357f896 + 309c7f5 commit dd5cd28

File tree

3 files changed

+56
-4
lines changed

3 files changed

+56
-4
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import Help from "../partials/replicated-cli/_help.mdx"
2+
3+
# cluster shell
4+
5+
Opens a new shell session with the kubeconfig configured for the specified cluster. This allows you to have immediate kubectl access to the cluster within the shell environment.
6+
7+
You can either specify the cluster ID directly or provide the cluster name to resolve the corresponding cluster ID. The shell will inherit your existing environment and add the necessary kubeconfig context for interacting with the Kubernetes cluster.
8+
9+
Once inside the shell, you can use 'kubectl' to interact with the cluster. To exit the shell, press Ctrl-D or type 'exit'. When the shell closes, the kubeconfig will be reset back to your default configuration.
10+
11+
## Usage
12+
13+
```bash
14+
replicated cluster shell [ID] [flags]
15+
```
16+
17+
<table>
18+
<tr>
19+
<th width="30%">Flag</th>
20+
<th width="20%">Type (if applicable)</th>
21+
<th width="50%">Description</th>
22+
</tr>
23+
<Help/>
24+
<tr>
25+
<td>--id</td>
26+
<td>string</td>
27+
<td>ID of the cluster to have kubectl access to (when name is not provided)</td>
28+
</tr>
29+
<tr>
30+
<td>--name</td>
31+
<td>string</td>
32+
<td>Name of the cluster to have kubectl access to.</td>
33+
</tr>
34+
</table>
35+
36+
## Examples
37+
38+
```bash
39+
# Open a shell for a cluster by ID
40+
replicated cluster shell 89be02de
41+
```
42+
43+
```bash
44+
# Open a shell for a cluster by name
45+
replicated cluster shell --name "My Cluster"
46+
```

docs/vendor/testing-how-to.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ The `cluster prepare` command requires either a Helm chart archive or a director
193193
```
194194

195195
For command usage, including additional options, see [cluster prepare](/reference/replicated-cli-cluster-prepare).
196+
196197
### Access Clusters
197198

198199
Compatibility Matrix provides the kubeconfig for clusters so that you can access clusters with the kubectl command line tool. For more information, see [Command line tool (kubectl)](https://kubernetes.io/docs/reference/kubectl/) in the Kubernetes documentation.
@@ -206,19 +207,23 @@ To access a cluster from the command line:
206207
```
207208
In the output of the command, verify that the `STATUS` for the target cluster is `running`. For command usage, see [cluster ls](/reference/replicated-cli-cluster-ls).
208209

209-
1. Run the following command to download the kubeconfig for the cluster and update Kubernetes context:
210+
1. Run the following command to open a new shell session with the kubeconfig configured for the cluster:
210211

211212
```bash
212-
replicated cluster kubeconfig CLUSTER_ID
213-
```
214-
When the command completes, a `Updated kubernetes context` message is displayed. For command usage, see [cluster kubeconfig](/reference/replicated-cli-cluster-kubeconfig).
213+
replicated cluster shell CLUSTER_ID
214+
```
215+
Where `CLUSTER_ID` is the unique ID for the running cluster that you want to access.
216+
217+
For command usage, see [cluster shell](/reference/replicated-cli-cluster-shell).
215218

216219
1. Verify that you can interact with the cluster through kubectl by running a command. For example:
217220

218221
```bash
219222
kubectl get ns
220223
```
221224

225+
1. Press Ctrl-D or type `exit` when done to end the shell and the connection to the server.
226+
222227
### Upgrade Clusters (kURL Only)
223228

224229
For kURL clusters provisioned with Compatibility Matrix, you can use the the `cluster upgrade` command to upgrade the version of the kURL installer specification used to provision the cluster. A recommended use case for the `cluster upgrade` command is for testing your application's compatibility with Kubernetes API resource version migrations after upgrade.

sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,7 @@ const sidebars = {
661661
'reference/replicated-cli-cluster-port-ls',
662662
'reference/replicated-cli-cluster-port-rm',
663663
'reference/replicated-cli-cluster-rm',
664+
'reference/replicated-cli-cluster-shell',
664665
'reference/replicated-cli-cluster-update-ttl',
665666
'reference/replicated-cli-cluster-upgrade',
666667
'reference/replicated-cli-cluster-versions',

0 commit comments

Comments
 (0)