Deploy Changes in Configuration Options
You can always introduce or update your vcluster.yaml
and deploy new configuration options.
The vCluster control plane pod will be re-deployed.
Remember that you can't change distros or backing store once a vCluster is deployed.
- vCluster CLI
- Helm
- Terraform
- Argo CD
- Cluster API
To keep the same version of your vCluster, your CLI needs to be the same version as your virtual cluster.
vcluster create --upgrade <VCLUSTER_NAME> -n <VCLUSTER_NAMESPACE> -f vcluster.yaml
Replace:
<VCLUSTER_NAME>
with the name of the vCluster instance to update.<VCLUSTER_NAMESPACE>
with the namespace where the vCluster instance is deployed.
helm upgrade --install <VCLUSTER_NAME> vcluster \
--values vcluster.yaml \
--repo https://charts.loft.sh \
--namespace <VCLUSTER_NAMESPACE> \
--repository-config=''
Replace:
<VCLUSTER_NAME>
with the name of the vCluster instance to update.<VCLUSTER_NAMESPACE>
with the namespace where the vCluster instance is deployed.
Generate a new plan with your updated
vcluster.yaml
.terraform plan
Verify that the provider can access your cluster and that the proposed changes are correct.
Apply your new changes.
terraform apply
The steps assume that you have the terraform file that you initially deployed your terraform resource from.
Commit and push your updated
vcluster.yaml
to your configured ArgoCD repository.Synchronize your ArgoCD repository with your configured cluster.
Learn more about Cluster API Provider for vCluster.
Install the vCluster provider.
clusterctl init --infrastructure vcluster:v0.2.0
Export environment variables to be used by the cluster API provider to create an updated manifest. The manifest will be applied to your Kubernetes cluster, which will update your vCluster with the updated configuration options.
# Replace <VCLUSTER_NAME> and <VCLUSTER_NAMESPACE> with values of the vCluster that you are updating
export CLUSTER_NAME=<VCLUSTER_NAME>
export CLUSTER_NAMESPACE=<VCLUSTER_NAMESPACE>
# Since the vcluster.yaml has changed, you'll need to re-export it to the updated vcluster.yaml
export VCLUSTER_YAML=$(awk '{printf "%s\\n", $0}' vcluster.yaml)Replace:
<VCLUSTER_NAME>
with the name of the vCluster instance to update.<VCLUSTER_NAMESPACE>
with the namespace where the vCluster instance is deployed.
Regenerate the manifest and apply the updated manifest.
clusterctl generate cluster ${CLUSTER_NAME} \
--infrastructure vcluster \
--target-namespace ${CLUSTER_NAMESPACE} \
| kubectl apply -f -Kubernetes VersionThe Kubernetes version for the vCluster is not set at the CAPI provider command. It is configured the
vcluster.yaml
file based on your Kubernetes distribution.Wait for vCluster to be updated by watching for the vCluster custom resource to report a
ready
status.kubectl wait --for=condition=ready vcluster -n $CLUSTER_NAMESPACE $CLUSTER_NAME --timeout=300s