Create and manage environments with CMX
This topic describes how to use Replicated Compatibility Matrix (CMX) to create and manage clusters and VMs.
This topic includes information about creating and managing environments with CMX using the Replicated Vendor Portal or the Replicated CLI. For information about creating and managing clusters with the Vendor API v3, see the clusters section in the Vendor API v3 documentation.
Prerequisites
-
Create an account in the Replicated Vendor Portal. See Create a Vendor Account.
-
Install the Replicated CLI and then authorize the CLI using your vendor account. See Install the Replicated CLI.
-
If you have a contract, you can purchase more credits by going to Compatibility Matrix > Buy additional credits. Otherwise, you can request credits by going to Compatibility Matrix > Request more credits in the Vendor Portal. For more information, see Billing and Credits.
-
Existing accounts must accept the TOS for the trial on the Compatibility Matrix page in the Replicated Vendor Portal.
Create environments
For information about how to create environments with the CLI, see replicated cluster create and replicated vm create.
To create an environment with CMX from the Vendor Portal:
-
In the Vendor Portal, go to Compatibility Matrix.
-
Click Create and choose Create Kubernetes cluster or Create VM:
-
Create Kubernetes cluster:
-
On the Create a cluster page, choose the Kubernetes distribution and version.
-
(Optional) Add a name for the cluster, add tags, and adjust the Time to Live (TTL).
-
(Optional) For Nodes & Nodes Groups, add and configure additional nodes and node groups for the cluster.
The following is an example of the Create a cluster page:
-
-
Create VM:
-
On the Create a Virtual Machine page, choose the OS distribution and version.
-
(Optional) Add a name for the VM, add tags, and adjust the Time to Live (TTL).
-
(Optional) For VM Config, choose the instance type and disk size. You can also create multiple VMs of the same type by increasing the Count.
noteYou can create TLS certs and DNS records in the Ingress & Ports tab after the VM has been created. See Expose Ports.
The following is an example of the Create a Virtual Machine page:
-
-
-
Click Create cluster or Create VM.
The environment is displayed in the list on the Compatibility Matrix Overview page with a status of Assigned. When the environment is ready, the status is changed to Running.
Create air-gapped environments
Using the airgap network policy to simulate an air-gapped environment is supported only for VMs and VM-based clusters. Clusters that use cloud-based distributions do not support the airgap network policy.
VMs and VM-based clusters created with CMX can use one of the following network policies:
| Network Policy | Description |
|---|---|
open | No restrictions on network traffic. |
airgap | Restrict all network traffic. |
By default, all VMs and VM-based clusters are created with an open network policy. You can change the network policy to airgap to block outbound network requests. This is useful for simulating an air-gapped environment with no outbound internet access so that you can test how your application performs.
Network policies are configured at the network level and apply to all VMs and environments connected to the network.
You can also use CMX to generate reports that track and summarize network activity on CMX networks. For more information, see Collect and View Network Reports.
VM-based cluster
To create an air-gapped cluster:
-
Create a cluster:
replicated cluster create --distribution VM_BASED_DISTRIBUTIONWhere
VM_BASED_DISTRIBUTIONis the target VM-based cluster distribution. For a list of supported distributions, see VM Clusters. -
Watch until the cluster status is
running:replicated cluster ls --watch -
Access the cluster in a shell:
replicated cluster shell CLUSTER_IDWhere
CLUSTER_IDis the ID of the cluster that you created from the output of thecluster lscommand. -
Change the network policy to
airgap:replicated network update NETWORK_ID --policy airgapWhere
NETWORK_IDis the ID of the network from the output of thecluster lscommand. -
Verify that the cluster's policy is
airgapand the status isrunning:replicated cluster lsID NAME STATUS CREATED EXPIRES POLICY HAS REPORTbdeb3515 gifted_antonelli running 2025-01-28 18:45 PST 2025-01-28 19:45 PST airgap off -
(Optional) Enable network reporting to track network activity. See Collect and View Network Reports.
VM
To create an air-gapped VM:
-
Create a VM:
replicated vm create --distribution ubuntu -
Wait until the VM status is running:
replicated vm ls -
SSH onto the VM:
Where
VM_IDis the ID of the VM from the output of thevm lscommand.For more information and additional options, see Connect to CMX VMs (SSH and File Transfer).
-
Set the network policy to
airgap:replicated network update NETWORK_ID --policy airgapWhere
NETWORK_IDis the ID of the network from the output of thevm lscommand.Example:
replicated network update 85eb50a8 --policy airgapID NAME STATUS CREATED EXPIRES POLICY HAS REPORT85eb50a8 silly_rosalind updating 2025-01-28 16:16 PST 2025-01-28 17:18 PST airgap off -
(Optional) Enable network reporting to track network activity. See Collect and View Network Reports.
Access environments
After a CMX cluster or VM is running, you can access the environment using the replicated cluster shell or ssh command that is available in the Compatibility Matrix UI.
-
To access a cluster with kubectl:
replicated cluster shell CLUSTER_IDWhere
CLUSTER_IDis the ID of the running cluster. -
To SSH into a VM:
-
If you have not done so already, set up SSH access using a public/private key pair. See Prerequisite: Set Up SSH in Connect to VMs (SSH and File Transfer).
-
Run the following command:
Where
VMIDis the ID of the running VM. -
Respond to the prompts to add the fingerprint for
replicatedvm.comand enter the passphrase for your SSH key.
-
Create environments on the same network
You can create VMs and clusters with CMX that use the same network.
Connect a VM with a cluster on the same network
You can make a CMX cluster available on the same network as a CMX VM.
Supported cluster distributions
Openshift, K3s, RKE2, EC, kURL, kind
Requirement
Replicated CLI 0.90.0 or later
To connect a VM with a cluster on the same network:
-
Create a cluster:
replicated cluster create --distribution K8S_DISTRIBUTIONFor example,
replicated cluster create --distribution k3s. -
In the output of the
cluster createcommand, underNETWORK, copy the network ID.Example:
ID NAME DISTRIBUTION VERSION STATUS NETWORK CREATED EXPIRES COST6b14376c ecstatic_raman k3s 1.33.2 queued accbd6a7 2025-08-04 13:20 PDT - $0.60In the example above, the network ID is
accbd6a7. -
Create a VM on the same network:
replicated vm create --distribution DISTRIBUTION --network NETWORK_IDWhere
NETWORK_IDis the network ID that you copied in the previous step.For example,
replicated vm create --distribution ubuntu --network accbd6a7.Example output:
ID NAME DISTRIBUTION VERSION STATUS NETWORK CREATED EXPIRES COST760a30b1 suspicious_poitras ubuntu 24.04 assigned accbd6a7 2025-08-04 13:24 PDT - $0.60
Create VMs on the same network
Use the --count flag to create multiple VMs with the same name, all running on the same Network ID.
replicated vm create --distribution ubuntu --count 3
Join VMs to an existing network
To join one or more new VMs to the network of an existing VM:
-
Run one of the following commands to get the ID of an existing VM network:
-
List VMs:
replicated vm ls -
List networks:
replicated network ls
-
-
In the output of the command, copy the network ID.
-
Use the
--networkflag to create a new VM on the same network:replicated vm create --distribution ubuntu --network NETWORK_IDWhere
NETWORK_IDis the network ID that you copied in the previous step.
Test installations behind an HTTP proxy
Some customers allow outbound internet traffic only through an HTTP or HTTPS proxy. You can use CMX to test that your application installs and runs in this kind of environment. Run a proxy on one VM, and install your application on a second VM on the same network that can reach the internet only through the proxy.
CMX network policies apply to every VM on a network. If you set the network policy to airgap, the proxy VM also loses internet access. Instead, leave the network policy set to open and block direct internet access on the installation VM with a host firewall.
The following procedure is an example. It uses Ubuntu VMs, the Squid proxy, nftables, and an Embedded Cluster installation. Squid and nftables are third-party tools that Replicated does not support, and their packages, defaults, and commands can change over time. You can use any proxy and firewall that you prefer, and adapt the steps to match the environments that your customers use.
To test an installation behind an HTTP proxy using Squid and nftables:
-
Create a VM for the proxy:
replicated vm create --distribution ubuntu --version 24.04 --name proxyIn the output of the command, copy the network ID.
-
Create a VM for the installation on the same network:
replicated vm create --distribution ubuntu --version 24.04 --instance-type INSTANCE_TYPE --name install --network NETWORK_IDWhere:
INSTANCE_TYPEis an instance type that meets the requirements for your application and for Embedded Cluster, such asr1.large.NETWORK_IDis the network ID that you copied in the previous step.
-
SSH into each VM and get its network interface and private IP address:
ip -4 -br addr show scope globalExample output:
eth1 UP 10.0.0.11/24In this example, the interface is
eth1, the private IP address is10.0.0.11, and the network CIDR is10.0.0.0/24. Both VMs use the same interface name and network CIDR. -
On the proxy VM, install Squid and allow requests from the CMX network. The default Squid configuration on Ubuntu denies requests from other hosts. For more information about configuring Squid, see the Squid documentation.
sudo apt-get update && sudo apt-get install -y squidsudo tee /etc/squid/conf.d/cmx.conf <<EOFacl cmx_network src NETWORK_CIDRhttp_access allow cmx_networkEOFsudo systemctl restart squidWhere
NETWORK_CIDRis the network CIDR, such as10.0.0.0/24.Squid listens on port 3128.
-
On the installation VM, install nftables, and then block outbound traffic to any address outside the CMX network. Install nftables first, because the package download needs direct internet access.
sudo apt-get update && sudo apt-get install -y nftablessudo nft -f - <<EOFtable inet block_egress {chain output {type filter hook output priority 0; policy accept;oifname "INTERFACE" ip daddr != NETWORK_CIDR drop}chain forward {type filter hook forward priority 0; policy accept;oifname "INTERFACE" ip daddr != NETWORK_CIDR drop}}EOFWhere:
INTERFACEis the network interface, such aseth1.NETWORK_CIDRis the network CIDR, such as10.0.0.0/24.
The
outputchain blocks traffic from the VM itself. Theforwardchain blocks traffic from Kubernetes pods, so that your application's pods also cannot bypass the proxy. -
On the installation VM, confirm that direct requests fail and that requests through the proxy succeed:
curl -sS -m 10 -o /dev/null -w "%{http_code}\n" https://replicated.appcurl -sS -m 10 -o /dev/null -w "%{http_code}\n" -x http://PROXY_IP:3128 https://replicated.appWhere
PROXY_IPis the private IP address of the proxy VM.The first command fails after 10 seconds. The second command returns
200. -
In the Vendor Portal, go to the page for the customer that you want to install with. Click Install instructions and select Embedded Cluster.
-
On the installation VM, run the commands from the dialog with the following changes:
- Add
-x http://PROXY_IP:3128to thecurlcommand that downloads the installation assets. - Add
--http-proxy http://PROXY_IP:3128 --https-proxy http://PROXY_IP:3128to theinstallcommand.
Embedded Cluster automatically excludes the node's network, the pod and service networks, and localhost from the proxy. Use the
--no-proxyflag only for other hosts that your customers reach without the proxy. For more information, see install. - Add
-
After the installation completes, on the proxy VM, review the requests that went through the proxy:
sudo tail -n 50 /var/log/squid/access.logThe log lists the requests from the installation VM, such as requests to
replicated.appandproxy.replicated.com, and to any other endpoints that your application uses. -
Confirm that the application is running, and that the instance appears on the customer's page in the Vendor Portal.
-
When you are done, delete both VMs. See Delete environments.
Application pods and preflight checks behind a proxy
Embedded Cluster passes the proxy settings to its own components and to the Replicated SDK. It does not pass them to your application's pods. If your application, or a preflight check that runs a pod, makes requests to the internet, pass the proxy settings to those pods. For example, set the HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables with the HTTPProxy, HTTPSProxy, and NoProxy template functions. For more information, see Proxy settings in Template Functions for Embedded Cluster.
Otherwise, those requests fail behind a proxy. In a proxy test, a request from your application or a preflight check that fails is a request that ignores the proxy.
Create a cluster and install a release with cluster prepare
The cluster prepare command reduces the number of steps required to provision a cluster and then deploy a release to the cluster. This is useful in continuous integration (CI) workflows that run multiple times a day. For an example workflow that uses the cluster prepare command, see Recommended CI/CD Workflows.
The cluster prepare command does the following:
- Creates a cluster
- Creates a release for your application based on either a Helm chart archive or a directory containing the application YAML files
- Creates a temporary customer of type
testnoteTest customers created by the
cluster preparecommand are not saved in your Vendor Portal team. - Installs the release in the cluster using either the Helm CLI or Replicated KOTS
The cluster prepare command requires either a Helm chart archive or a directory containing the application YAML files to be installed:
-
Install a Helm chart with the Helm CLI:
replicated cluster prepare \--distribution K8S_DISTRO \--version K8S_VERSION \--chart HELM_CHART_TGZThe following example creates a kind cluster and installs a Helm chart in the cluster using the
nginx-chart-0.0.14.tgzchart archive:replicated cluster prepare \--distribution kind \--version 1.27.0 \--chart nginx-chart-0.0.14.tgz \--set key1=val1,key2=val2 \--set-string s1=val1,s2=val2 \--set-json j1='{"key1":"val1","key2":"val2"}' \--set-literal l1=val1,l2=val2 \--values values.yaml -
Install with KOTS from a YAML directory:
replicated cluster prepare \--distribution K8S_DISTRO \--version K8S_VERSION \--yaml-dir PATH_TO_YAML_DIRThe following example creates a k3s cluster and installs an application in the cluster using the manifest files in a local directory named
config-validation:replicated cluster prepare \--distribution k3s \--version 1.26 \--namespace config-validation \--shared-password password \--app-ready-timeout 10m \--yaml-dir config-validation \--config-values-file conifg-values.yaml \--entitlements "num_of_queues=5"
For command usage, including additional options, see cluster prepare.
Edit environments
You can make changes to an environment after creating it. For example, you could extent to TTL or add DNS records to expose ports on a VM.
To edit environments:
-
In the Vendor Portal, go to Compatibility Matrix.
-
In the vertical dots menu for the target environment, click Edit [VM/cluster].
-
Make changes to the environment as needed.
Delete environments
For information about deleting environments using the Replicated CLI, see replicated cluster rm and replicated vm rm
To delete a cluster using the Vendor Portal:
-
In the Vendor Portal, go to Compatibility Matrix.
-
In the vertical dots menu for the target environment, click Delete [VM/cluster].
-
In the dialog, click Delete [VM/cluster] again to confirm.