Skip to content

Commit fe6b975

Browse files
committed
Add direct port of VM beta
1 parent 8590b78 commit fe6b975

File tree

2 files changed

+334
-0
lines changed

2 files changed

+334
-0
lines changed

docs/vendor/testing-vm-create.md

Lines changed: 333 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,333 @@
1+
# Create VMs (Alpha)
2+
3+
The Compatibility Matrix (CMX) platform allows you to create VMs with no Kubernetes pre-installed on them. This is particularly useful for testing VM-based installs such as the [Replicated Embedded Cluster](https://docs.replicated.com/intro-replicated#embedded-cluster).
4+
5+
| ⚠️ Current Limitations [GitHub Actions](https://docs.replicated.com/vendor/testing-how-to#replicated-github-actions) do not yet work with Compatibility Matrix VMs. [Cluster prepare](https://docs.replicated.com/reference/replicated-cli-cluster-prepare) is not yet supported with Compatibility Matrix VMs. → To try out VMs (Alpha), [email](mailto:[email protected]) Replicated for access & support. |
6+
| :---- |
7+
8+
## Create VMs
9+
10+
To create [3] [Ubuntu] VMs:
11+
12+
```bash
13+
replicated vm create --distribution ubuntu --count 3
14+
```
15+
16+
List supported distributions and versions:
17+
18+
```bash
19+
replicated vm versions
20+
```
21+
22+
Supported VM types:
23+
24+
| Distribution | Versions | Instance Types |
25+
| :---- | :---- | :---- |
26+
| ubuntu | 24.04, 22.04 | r1.small, r1.medium, r1.large, r1.xlarge, r1.2xlarge |
27+
| almalinux | 8 | r1.small, r1.medium, r1.large, r1.xlarge, r1.2xlarge |
28+
29+
## Prerequisites
30+
31+
Before you can use Compatibility Matrix VMs, you must complete the following prerequisites:
32+
33+
### Connect GitHub Account
34+
35+
Before you can SSH into a VM:
36+
37+
1. Configure your GitHub username in Replicated Vendor Portal ([Replicated Docs](https://docs.replicated.com/vendor/team-management-github-username#procedure))
38+
2. Make sure you've added your SSH key in your GitHub account ([GitHub instructions](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account))
39+
40+
| GitHub usernames and SSH keys are synced every 24hrs. To immediately sync: → [Account Settings](https://vendor.replicated.com/account-settings/info) > click Save Keys are synced to the VM at time of creation, so any updates after creation are ignored. |
41+
| :---- |
42+
43+
To confirm your GitHub username and SSH key have been set up successfully:
44+
45+
```bash
46+
47+
```
48+
49+
If successful, you'll see:
50+
51+
```
52+
You've successfully authenticated, use [VM_ID]@replicatedvm.com to access your VM.
53+
```
54+
55+
If you do not see this message, your public/private key likely was not available.
56+
57+
### Use a Service GitHub Account
58+
59+
To automate VMs in your CI, or otherwise avoid using a personal GitHub account, use the flag `--ssh-public-key` when you first create a VM:
60+
61+
```bash
62+
replicated vm create --distribution ubuntu --version 20.04 --ssh-public-key ~/.ssh/id_rsa.pub
63+
```
64+
65+
Using multiple SSH public keys:
66+
67+
```bash
68+
replicated vm create --distribution ubuntu --version 20.04 --ssh-public-key ~/.ssh/id_rsa.pub --ssh-public-key ~/.ssh/id_ed25519.pub
69+
```
70+
71+
## Connect to a VM
72+
73+
There are currently two supported methods to SSH into a VM:
74+
75+
1. [**CMX Forwarder**](#cmx-forwarder)
76+
* Easier – You only need to know the VM ID to connect to the machine via SSH. This is more approachable for users less familiar with SSH clients.
77+
* Example Use Case – Run an online Embedded Cluster install command
78+
79+
2. [**Direct SSH**](#direct-ssh)
80+
* More Flexible – Leverage your SSH tool of choice and pass any client supported flags, without any added connection lag of being routed through the CMX Forwarder.
81+
* Example Use Case – SCP large assets to the VM, such as air gap bundles.
82+
Pass specific SHH flags during testing workflows
83+
84+
### CMX Forwarder
85+
86+
| Transferring files using CMX Forwarder is slower than Direct SSH. CMX servers run on EKS, so depending on your location going through the forwarder will add latency. If you're transferring large files onto the VM, use [Direct SSH](#direct-ssh) in combination with SCP. |
87+
| :---- |
88+
89+
SSH into the VM:
90+
91+
```bash
92+
ssh [VMID]@replicatedvm.com
93+
```
94+
95+
If needed, copy files onto the machine:
96+
97+
```bash
98+
scp somefile [VMID]@replicatedvm:/home/folder/somefile
99+
```
100+
101+
| Alpha Limitations: scp with flag -O (legacy scp protocol) is not supported. Relative paths is not supported `❌ scp somefile [VMID]@replicatedvm.com:~ ✅ scp somefile [VMID]@replicatedvm:/home/folder/somefile` File permissions are not inherited. |
102+
| :---- |
103+
104+
### Direct SSH
105+
106+
| Transferring files using Direct SSH allows you to use your SSH tool of choice, and pass any client-supported flags. Note: Requires Replicated CLI v0.104.0 or later. |
107+
| :---- |
108+
109+
Get the SSH endpoint for the VM:
110+
111+
```bash
112+
replicated vm ssh-endpoint [VMID or VMNAME]
113+
```
114+
115+
If successful, you'll see:
116+
117+
```
118+
ssh://[github-user-name]@[ssh-endpoint]:[port]
119+
```
120+
121+
**Example**`ssh://[email protected]:46795`
122+
123+
⚠️ The username for SSH should match the GitHub username in Vendor Portal. ([override info](#override-username))
124+
125+
SSH into the VM:
126+
127+
```bash
128+
ssh $(replicated vm ssh-endpoint [VMID or VMNAME])
129+
```
130+
131+
**Example**`ssh $(replicated vm ssh-endpoint aba1acc2)`
132+
133+
### Copy Files to the VM (SCP)
134+
135+
Request the scp endpoint:
136+
137+
```bash
138+
replicated vm scp-endpoint [VMID or VMNAME]
139+
```
140+
141+
**Example**`replicated vm scp-endpoint aba1acc2`
142+
143+
If successful, you'll see:
144+
145+
```
146+
scp://[github-user-name]@[ssh-endpoint]:[port]
147+
```
148+
149+
**Example**`scp://[email protected]:46795`
150+
151+
⚠️ The username for SSH should match the GitHub username in Vendor Portal. ([override info](#override-username))
152+
153+
SCP files into the VM:
154+
155+
```bash
156+
scp somefile $(replicated vm scp-endpoint [VMID or VMNAME])//[PATH]
157+
```
158+
159+
**Example**`scp somefile $(replicated vm scp-endpoint aba1acc2)//home/MyName/somefile`
160+
161+
#### Override Username
162+
163+
**Note:** You can override the username used for the endpoint with the `--username` flag.
164+
Useful if you want to:
165+
166+
* Use a different GitHub username than what is in Vendor Portal. (Or no username set.)
167+
* When creating a VM, you used the `--ssh-public-key` flag to associate the VM with a GitHub service account, and this doesn't match the GitHub username set in Vendor Portal. ([more info](#use-a-service-github-account))
168+
169+
```bash
170+
replicated vm ssh-endpoint [VMID or VMNAME] --username [github-user-name]
171+
```
172+
173+
**Example**`replicated vm ssh-endpoint aba1acc2 --username MyName`
174+
175+
## Connect to a VM Manually
176+
177+
You may need an alternate method if the above options don't work with your preferred SSH client.
178+
179+
When a VM is created, a random port is assigned to each machine within each group of the VM.
180+
To connect with the machine over SSH:
181+
182+
```bash
183+
replicated vm ls --output json
184+
```
185+
186+
If successful, you'll see:
187+
188+
```json
189+
[
190+
{
191+
"id": "e32aafa1",
192+
"name": "sad_black",
193+
"distribution": "ubuntu",
194+
"version": "24.04",
195+
"status": "running",
196+
"created_at": "2024-10-24T15:00:37Z",
197+
"expires_at": "2024-10-24T16:01:10Z",
198+
"ttl": "1h",
199+
"credits_per_hour_per_vm": 0,
200+
"flat_fee": 50000,
201+
"total_credits": 0,
202+
"estimated_cost": 0,
203+
"direct_ssh_port": 33655,
204+
"direct_ssh_endpoint": "95.217.47.21",
205+
"tags": []
206+
}
207+
]
208+
```
209+
210+
To connect with them, you can run:
211+
212+
```bash
213+
ssh -p [direct_ssh_port] [github_username]@[direct_ssh_endpoint]
214+
```
215+
216+
**Example**`ssh -p 33655 [email protected]`
217+
218+
## Compatibility Matrix Tunnels
219+
220+
| ⚠️Creating wildcard DNS entries for VMs is not currently supported. ([email](mailto:[email protected]) feedback) |
221+
| :---- |
222+
223+
You can expose ports on a VM and make them accessible on the public internet.
224+
(Learn about a similar feature: [Compatibility Matrix Tunnels for Clusters](https://docs.replicated.com/vendor/testing-ingress#compatibility-matrix-tunnels-beta))
225+
226+
### Create a Tunnel
227+
228+
```bash
229+
replicated vm port expose [VMID or VMNAME]
230+
```
231+
232+
**Example** – Expose port 3000 with HTTP protocol
233+
`replicated vm port expose VM_ID --port 30000 --protocol http`
234+
235+
### List Tunnels
236+
237+
```bash
238+
replicated vm port ls [VMID or VMNAME]
239+
```
240+
241+
### Remove a Tunnel
242+
243+
```bash
244+
replicated vm port rm [VMID or VMNAME]
245+
```
246+
247+
## Connect a CMX VM with a CMX Cluster
248+
249+
You can make a CMX Cluster available on the same network as a CMX VM.
250+
251+
**Compatible Clusters:** Openshift, K3s, RKE2, EC, kURL
252+
**Requirement:** Replicated CLI 0.90.0 or higher.
253+
**NOTE:** Create the cluster first, then attach the new VM to that existing network.
254+
255+
### Create a Cluster
256+
257+
```bash
258+
replicated cluster create --distribution [K8s Distribution]
259+
```
260+
261+
**Example**`replicated cluster create --distribution k3s`
262+
263+
If successful, you'll see:
264+
265+
```
266+
ID NAME DISTRIBUTION VERSION STATUS CREATED
267+
EXPIRES COST
268+
b09cf035 affect_mend k3s 1.32.0 queued 2025-01-28 16:04 PST - $0.60
269+
```
270+
271+
### Check the Network
272+
273+
```bash
274+
replicated network ls
275+
```
276+
277+
If successful, you'll see:
278+
279+
```
280+
ID NAME STATUS CREATED EXPIRES
281+
accbd6a7 affect_mend running 2025-01-28 16:04 PST 2025-01-28 17:05 PST
282+
```
283+
284+
### Create CMX VM on same Network
285+
286+
```bash
287+
replicated vm create --distribution [Distribution] --network [Network ID]
288+
```
289+
290+
**Example**`replicated vm create --distribution ubuntu --network accbd6a7`
291+
292+
If successful, you'll see:
293+
294+
```
295+
ID NAME DISTRIBUTION VERSION STATUS CREATED EXPIRES COST
296+
760a30b1 laughing_tu ubuntu 24.04 queued 2025-01-28 16:07 PST - $0.60
297+
```
298+
299+
**Example** – Both the cluster `b09cf035` and the VM `760a30b1` are now on the same tailnet.
300+
301+
## Connect CMX VMs on a Shared Network
302+
303+
Use the `--count` flag to create multiple VMs with the same name, all running on the same Network ID.
304+
305+
```bash
306+
replicated vm create --distribution ubuntu --count 3
307+
```
308+
309+
### Join VMs to an Existing VM network
310+
311+
First, get the ID of an existing VM network:
312+
313+
```bash
314+
replicated vm ls
315+
```
316+
317+
Or
318+
319+
```bash
320+
replicated network ls
321+
```
322+
323+
Use the `--network` flag to create new VMs on the same network
324+
325+
```bash
326+
replicated vm create --distribution ubuntu --network [NETWORK_ID]
327+
```
328+
329+
## Install Embedded Cluster on a CMX VM
330+
331+
* Only available for [EC **1.21.x**](https://github.com/replicatedhq/embedded-cluster/releases/tag/1.21.0%2Bk8s-1.30) or later.
332+
* You can now reboot a CMX VM. e.g., when running the [Embedded Cluster reset command](https://docs.replicated.com/vendor/embedded-using#reset-a-node).
333+
* For **multi-node** Embedded Cluster initial install: you **no longer** need the flag `--network-interface tailscale0` as part of your [Embedded Cluster install command](https://docs.replicated.com/reference/embedded-cluster-install), which was needed to make sure the nodes can reach the api-server. This was due to an [upstream issue](https://github.com/tailscale/tailscale/issues/14706) with the Calico CNI on a Tailscale network. As of Jul 2, 2025, we have a new overlay network that makes this flag obsolete.

sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ const sidebars = {
233233
'vendor/testing-cluster-addons',
234234
'vendor/compatibility-matrix-usage',
235235
'vendor/testing-how-to',
236+
'vendor/testing-vm-create',
236237
'vendor/testing-ingress',
237238
],
238239
},

0 commit comments

Comments
 (0)