Skip to content

Commit

Permalink
Moves base vcluster.yaml explanation into a partial for reuse.
Browse files Browse the repository at this point in the history
Reorganizes pro vcluster.yaml docs to be more like the OSS docs.
  • Loading branch information
zerbitx committed Jul 22, 2024
1 parent 68106eb commit 9753191
Show file tree
Hide file tree
Showing 10 changed files with 132 additions and 88 deletions.
70 changes: 70 additions & 0 deletions _partials/what-is-vcluster-yaml.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@

import Deploy from '@site/vcluster/_partials/deploy/deploy-beta.mdx'
import DeployChanges from '@site/vcluster/_partials/deploy/deploy-changes-beta.mdx'


The `vcluster.yaml` file contains all configurations when deploying and upgrading virtual clusters. It's optionally passed to the CLI or as the values file for deployments using Helm. It is also possible to create a vCluster without a vcluster.yaml file which will be created with a set of default values.

Example configurations include the vCluster control plane's [backing store](../configure/vcluster-yaml/control-plane/components/backing-store/), resource syncing behavior [from](../configure/vcluster-yaml/sync/from-host/) and [to](../configure/vcluster-yaml/sync/to-host/) the host cluster, and exporting the virtual cluster's [kubeconfig](../configure/vcluster-yaml/export-kube-config) file.

- **Unified Configuration:** All settings for vCluster in one place, simplifying management.
- **Schema Validation:** Automatically validate the configuration when using the vCluster CLI.
- **IDE Support:** Integrated schema with popular IDEs for autocompletion and validation.

#### Example `vcluster.yaml` file

```yaml
controlPlane:
backingStore:
etcd:
embedded:
enabled: true
ingress:
enabled: true
host: vcluster-k8s-api.example.com
sync:
toHost:
serviceAccounts:
enabled: true
fromHost:
nodes:
enabled: true
clearImageStatus: true
exportKubeConfig:
context: my-vcluster-context
server: https://vcluster-k8s-api.example.com
secret:
name: my-vcluster-kubeconfig
```
This example configuration defines:
1. [Embedded etcd](../configure/vcluster-yaml/control-plane/components/backing-store/etcd/embedded) as the vCluster control plane's backing store to reduce management overhead (Pro feature).
1. Syncing [ServiceAccount](../configure/vcluster-yaml/sync/to-host/advanced/service-accounts) resources from the virtual to the host cluster, to support, for example, AWS IRSA.
1. Deploying an [Ingress](../configure/vcluster-yaml/control-plane/deployment/ingress) resource on the host cluster to expose the vCluster control plane's API server at a hostname.
1. Syncing real [node](../configure/vcluster-yaml/sync/from-host/nodes) data, rather than the default "pseudo" nodes, but clears the `ImageStatuses` field within the `NodeStatus` of the synced nodes.
1. How to export the [kubeconfig](../configure/vcluster-yaml/export-kube-config) file to a secret, so you can use it, for example, in your ArgoCD or Terraform pipelines.

## How to Use `vcluster.yaml`
### Creating a New Virtual Cluster
- Define your configurations in the `vcluster.yaml` file.
- Deploy your virtual cluster.

<Deploy/>

### Updating Existing Virtual Clusters
- Simply update your `vcluster.yaml` file with the new configurations.
- Apply the updates.

<DeployChanges/>


## FAQs

### How do I upgrade my 0.19.x and earlier virtual cluster configurations?
If you have existing 0.19.x virtual clusters, you can convert the old configuration values to the new v0.20 format. [View the guide](../reference/migrations/0-20-migration) for more details.

### Is it required to provide a `vcluster.yaml` file?
No, if a `vcluster.yaml` file isn't provided, the vCluster will be created using a set of default values.

### Can I change the configuration for existing virtual clusters?
Yes, you can run `vcluster create VCLUSTER_NAME --upgrade -f vcluster.yaml`
20 changes: 0 additions & 20 deletions platform/api/resources/vcluster-yaml/README.mdx

This file was deleted.

5 changes: 5 additions & 0 deletions platform/virtual-clusters/configure/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"label": "Configure",
"collapsible": false
}

19 changes: 19 additions & 0 deletions platform/virtual-clusters/configure/vcluster-yaml/README.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: What is vcluster.yaml (w/Pro)?
sidebar_label: vcluster.yaml
---

import External from '@site/platform/api/_partials/resources/config/external.mdx'
import WhatIsVclusterYaml from '@site/_partials/what-is-vcluster-yaml.mdx'

<WhatIsVclusterYaml />

## Pro Features

All the OSS features are applicable in any `vcluster.yaml`. Below are the Pro features only available on the vCluster Platform.

### Config reference

<External />


8 changes: 8 additions & 0 deletions platform/virtual-clusters/configure/what-is-vcluster-yaml.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: What is vcluster.yaml
sidebar_position: 1
---

import WhatIsVclusterYaml from '@site/vcluster/configure/what-is-vcluster-yaml.mdx';

<WhatIsVclusterYaml />
28 changes: 28 additions & 0 deletions vcluster/configure/vcluster-yaml/external/README.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: External Configuration
sidebar_label: external
---

import ProAdmonition from '@site/vcluster/_partials/admonitions/pro-admonition.mdx'
import Platform from '@site/platform/api/_partials/resources/config/external/platform.mdx'

<ProAdmonition />

The external section is for configuring tools external to vCluster.

## Platform

In the platform section you can configure vCluster Platform features like autoSleep

### Example

```yaml
external:
platform:
autoSleep:
afterInactivity: 600 # 10 minutes
```
## Config reference
<Platform />
70 changes: 2 additions & 68 deletions vcluster/configure/what-is-vcluster-yaml.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,72 +5,6 @@ sidebar_position: 1
description: Intro to the vcluster.yaml configuration file
---

import Deploy from '@site/vcluster/_partials/deploy/deploy-beta.mdx'
import DeployChanges from '@site/vcluster/_partials/deploy/deploy-changes-beta.mdx'
import WhatIsVclusterYaml from '@site/_partials/what-is-vcluster-yaml.mdx'


The `vcluster.yaml` file contains all configurations when deploying and upgrading virtual clusters. It's optionally passed to the CLI or as the values file for deployments using Helm. It is also possible to create a vCluster without a vcluster.yaml file which will be created with a set of default values.

Example configurations include the vCluster control plane's [backing store](../configure/vcluster-yaml/control-plane/components/backing-store/), resource syncing behavior [from](../configure/vcluster-yaml/sync/from-host/) and [to](../configure/vcluster-yaml/sync/to-host/) the host cluster, and exporting the virtual cluster's [kubeconfig](../configure/vcluster-yaml/export-kube-config) file.

- **Unified Configuration:** All settings for vCluster in one place, simplifying management.
- **Schema Validation:** Automatically validate the configuration when using the vCluster CLI.
- **IDE Support:** Integrated schema with popular IDEs for autocompletion and validation.

#### Example `vcluster.yaml` file

```yaml
controlPlane:
backingStore:
etcd:
embedded:
enabled: true
ingress:
enabled: true
host: vcluster-k8s-api.example.com
sync:
toHost:
serviceAccounts:
enabled: true
fromHost:
nodes:
enabled: true
clearImageStatus: true
exportKubeConfig:
context: my-vcluster-context
server: https://vcluster-k8s-api.example.com
secret:
name: my-vcluster-kubeconfig
```
This example configuration defines:
1. [Embedded etcd](../configure/vcluster-yaml/control-plane/components/backing-store/etcd/embedded) as the vCluster control plane's backing store to reduce management overhead (Pro feature).
1. Syncing [ServiceAccount](../configure/vcluster-yaml/sync/to-host/advanced/service-accounts) resources from the virtual to the host cluster, to support, for example, AWS IRSA.
1. Deploying an [Ingress](../configure/vcluster-yaml/control-plane/deployment/ingress) resource on the host cluster to expose the vCluster control plane's API server at a hostname.
1. Syncing real [node](../configure/vcluster-yaml/sync/from-host/nodes) data, rather than the default "pseudo" nodes, but clears the `ImageStatuses` field within the `NodeStatus` of the synced nodes.
1. How to export the [kubeconfig](../configure/vcluster-yaml/export-kube-config) file to a secret, so you can use it, for example, in your ArgoCD or Terraform pipelines.

## How to Use `vcluster.yaml`
### Creating a New Virtual Cluster
- Define your configurations in the `vcluster.yaml` file.
- Deploy your virtual cluster.

<Deploy/>

### Updating Existing Virtual Clusters
- Simply update your `vcluster.yaml` file with the new configurations.
- Apply the updates.

<DeployChanges/>


## FAQs

### How do I upgrade my 0.19.x and earlier virtual cluster configurations?
If you have existing 0.19.x virtual clusters, you can convert the old configuration values to the new v0.20 format. [View the guide](../reference/migrations/0-20-migration) for more details.

### Is it required to provide a `vcluster.yaml` file?
No, if a `vcluster.yaml` file isn't provided, the vCluster will be created using a set of default values.

### Can I change the configuration for existing virtual clusters?
Yes, you can run `vcluster create VCLUSTER_NAME --upgrade -f vcluster.yaml`
<WhatIsVclusterYaml />

0 comments on commit 9753191

Please sign in to comment.