Upgrade vCluster
At any time, you can upgrade the version of your vCluster. During the upgrade, you can also apply configuration option changes.
Update vcluster.yaml​
Optionally, you can update your vcluster.yaml to change your configuration options during a vCluster version upgrade.
You cannot change distros or backing store once a virtual cluster is deployed, with one exception: starting with vCluster 0.25.0, migration from K3s to K8s distro is supported. For more details, see the K3s to K8s Migration.
Upgrade vCluster version​
These steps assume that you have been a vcluster.yaml, but there are variables in the code blocks for you to replace for:
- Name of the virtual cluster
- Namespace of where the virtual cluster is deployed
- Version to upgrade to
- vCluster CLI
- Helm
- Terraform
- Argo CD
- Cluster API
Upgrade your CLI to the version of vCluster that you want to upgrade your virtual cluster to.
vcluster upgrade --version 0.30.0
vcluster create --upgrade myvcluster -n vcluster -f vcluster.yaml
helm upgrade --install myvcluster vcluster \
--values vcluster.yaml \
--repo https://charts.loft.sh \
--namespace vcluster \
--repository-config='' \
--version 0.30.0
Generate a new plan.
terraform planVerify that the provider can access your cluster and that the proposed changes are correct.
Upgrade your vCluster.
terraform apply
Update ArgoCD
Applicationfile to update the version that you want to upgrade to.apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: myvcluster
namespace: argocd
spec:
project: default
source:
chart: vcluster
repoURL: https://charts.loft.sh
targetRevision: 0.30.0
helm:
releaseName: myvcluster
valueFiles:
- vcluster.yaml
destination:
server: https://kubernetes.default.svc
namespace:vclusterCommit and push this updated file to your configured ArgoCD repository.
(Optional) Commit and push an updated
vcluster.yamlfile 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.0Export 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.
export VCLUSTER_YAML=$(awk '{printf "%s\\n", $0}' vcluster.yaml)Regenerate the manifest and apply the updated manifest.
clusterctl generate cluster myvcluster \
--infrastructure vcluster \
--target-namespace vcluster \
| kubectl apply -f -Kubernetes VersionThe Kubernetes version for the vCluster is not set at the CAPI provider command. It is configured the
vcluster.yamlfile based on your Kubernetes distribution.Wait for vCluster to be updated by watching for the vCluster custom resource to report a
readystatus.kubectl wait --for=condition=ready vcluster -n vcluster myvcluster --timeout=300s