Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
deniseschannon committed Jun 24, 2024
1 parent 7588af1 commit 93f2b14
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions vcluster/deploy/topologies/high-availability.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ sidebar_label: High Availability
sidebar_position: 1
---

By default, `vCluster` runs one instance of each of its components. That’s fine for many use cases, like ones that are very ephemeral (dev environments, CI/CD, etc.).
Suppose your situation requires `vCluster` instances with more redundancy. In that case, you can use the High Availability (HA) feature
to run multiple copies of the `vCluster` components so that the cluster is more resistant to partial failures.
By default, vCluster runs one instance of each of its components. This deployment method is recommended for any uses cases that are very ephemeral (e.g. dev environments, CI/CD, etc.), but for most production
use cases, you will want to run vCluster with more redundancy. We recommend deploying vCluster in High Availability (HA) mode
to run multiple copies of the vCluster components so that the virtual cluster is more resistant to partial failures.

## Create the HA virtual cluster

To create a `vCluster` instance using the `vCluster` CLI, we run the `vcluster create` command. To enable HA, we’ll need to specify the distro and the `vcluster.yaml` file to use:
To create a vCluster using the vCluster CLI, we run the `vcluster create` command. To enable HA, we’ll need to specify the distro and the `vcluster.yaml` file to use:

```yaml
controlPlane:
Expand All @@ -32,20 +32,20 @@ controlPlane:
vcluster create ha-tutorial --connect=false -f vcluster.yaml
```

We’ve named the virtual cluster `ha-tutorial`. By default, the `vcluster create` command connects to the `vCluster` instance,
but for the purposes of this tutorial, we’ve disabled that with the `--connect=false` flag.
We’ve named the vCluster `ha-tutorial`. By default, the `vcluster create` command connects to the vCluster after creation,
but for the purposes of this tutorial, we’ve disabled this automatic connection by adding in the `--connect=false` flag.

You should see output like this:
```
info Creating namespace vcluster-ha-tutorial
...
- Use 'vcluster connect ha-tutorial --namespace vcluster-ha-tutorial' to access the vCluster instance
- Use 'vcluster connect ha-tutorial --namespace vcluster-ha-tutorial' to access the vCluster
```
:::note
Some of your output may differ depending on whether you use a local or remote cluster.
:::

As you can see, `vcluster` has created a `namespace` called `vcluster-ha-tutorial`. The `vCluster` instance lives inside that `namespace` on the host cluster. Next, let’s see what `pods` are running in that `namespace`.
As you can see, the creation of a vCluster has created a namespace called `vcluster-ha-tutorial` in the host cluster, and the components of the vCluster lives inside this namespace. Next, let’s see what pods are running in that namespace.

```
kubectl get pods -n vcluster-ha-tutorial
Expand All @@ -59,18 +59,18 @@ ha-tutorial-etcd-0 0/1 Running 0 20s
ha-tutorial-etcd-1 0/1 Running 0 20s
ha-tutorial-etcd-2 0/1 Running 0 20s
```
There are now three replicas of each component of the `vCluster` instance running. If one API server `pod` were down, the `vCluster` instance would continue functioning.
There are now three replicas of each component of the vCluster running. If one API server pod went down, the vCluster would continue functioning.

If you’d like more information about how the `pods` were scheduled in the `vCluster` instance, add the `-o wide` flag to that previous command.
If you’d like more information about how the pods were scheduled in the vCluster, add the `-o wide` flag to the `kubectl get pods` command:

```
kubectl get pods -n vcluster-ha-tutorial -o wide
```
The hostnames of the `nodes` will be listed in the NODES column.
The hostnames of the nodes will be listed in the NODES column.

# Connect to the vCluster instance
# Connect to vCluster

We can connect to the `vCluster` instance using the `vcluster connect` command.
We can connect to the vCluster using the `vcluster connect` command.

```
vcluster connect ha-tutorial
Expand All @@ -81,7 +81,7 @@ done √ Switched active kube context to vcluster_ha-tutorial_vcluster-ha-tutori
- Use `vcluster disconnect` to return to your previous kube context
- Use `kubectl get namespaces` to access the vcluster
```
`vcluster connect` automatically switches our kube context for `kubectl` to the `vCluster` instance. Now we can see the `namespaces` inside of the `vCluster` instance by running this command:
`vcluster connect` automatically switches our kube context for `kubectl` to the vCluster. Now, we can list the namespaces inside of the vCluster by running this command:
```
kubectl get namespaces
Copy
Expand All @@ -91,9 +91,9 @@ kube-node-lease Active 33s
kube-public Active 33s
kube-system Active 33s
```
Our `vCluster` instance only contains the default `namespaces` that were created by Kubernetes.
Our vCluster only contains the default namespaces that were created by Kubernetes.

Now let’s disconnect from the `vCluster` instance.
Now let’s disconnect from the vCluster.

```
vcluster disconnect
Expand All @@ -102,10 +102,10 @@ This will switch your kube context back to the host cluster.

# Cleanup

One of the great things about `vcluster` is that it’s very fast and easy to clean up the `vCluster` instances when you’re done using them.
One of the great things about running vCluster is that it’s very fast and easy to clean up all the components of the vCluster when you’re done using them.

```
vcluster delete ha-tutorial
```
That will delete the `vCluster` instance and the `namespace` it was in.
That will delete all components of the vCluster and the namespace it was in.

0 comments on commit 93f2b14

Please sign in to comment.