loft-sh / cluster-api-provider-vcluster

Mozilla Public License 2.0
73 stars 21 forks source link

How can I know what the latest supported kubernetes version is and which latest vcluster helm chart is compatible? #41

Closed lknite closed 5 months ago

lknite commented 11 months ago
$ cat vc-test.yaml 
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
  name: vc-test
  namespace: vc-test
spec:
  controlPlaneRef:
    apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
    kind: VCluster
    name: vc-test
  infrastructureRef:
    apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
    kind: VCluster
    name: vc-test
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: VCluster
metadata:
  name: vc-test
  namespace: vc-test
  labels:
    addons-external-dns: "true"
    addons-metrics-server: "true"
    addons-pinniped-concierge: "true"
spec:
  controlPlaneEndpoint:
    host: ""
    port: 0
  helmRelease:
    chart:
      name: vcluster
      repo: https://charts.loft.sh
      version: v0.15.7
    values: |
      service:
        type: "LoadBalancer"
      storage:
        className: cephfs
      init:
        manifests: |
          apiVersion: storage.k8s.io/v1
          kind: StorageClass
          metadata:
            annotations:
            labels:
              argocd.argoproj.io/instance: root-rook-ceph-external
              storageclass.kubernetes.io/is-default-class: "true"
            name: cephfs
            resourceVersion: "44708598"
            uid: 042c5cdc-fb21-47d3-aab7-098013d94ad8
          parameters:
            clusterID: rook-ceph
            csi.storage.k8s.io/controller-expand-secret-name: rook-csi-cephfs-provisioner
            csi.storage.k8s.io/controller-expand-secret-namespace: rook-ceph
            csi.storage.k8s.io/node-stage-secret-name: rook-csi-cephfs-node
            csi.storage.k8s.io/node-stage-secret-namespace: rook-ceph
            csi.storage.k8s.io/provisioner-secret-name: rook-csi-cephfs-provisioner
            csi.storage.k8s.io/provisioner-secret-namespace: rook-ceph
            fsName: cephfs
            pool: cephfs-data0
          provisioner: rook-ceph.cephfs.csi.ceph.com
          reclaimPolicy: Delete
          volumeBindingMode: Immediate
          allowVolumeExpansion: true
  kubernetesVersion: 1.27.6
helm upgrade vc-test vcluster --repo https://charts.loft.sh --version 0.15.7 --kubeconfig /tmp/3436601470 --namespace vc-test --install --values /tmp/324889076
E1012 17:28:52.144873       1 helm.go:98] Error executing helm upgrade vc-test vcluster --repo https://charts.loft.sh --version 0.15.7 --kubeconfig /tmp/3436601470 --namespace vc-test --install --values /tmp/324889076: Release "vc-test" does not exist. Installing it now.
Error: parse error at (vcluster/templates/_helpers.tpl:28): unclosed action
1.6971317321450126e+09  INFO    vcluster-controller     error during virtual cluster deploy vc-test/vc-test: error installing / upgrading vcluster: error executing helm upgrade: Release "vc-test" does not exist. Installing it now.
Error: parse error at (vcluster/templates/_helpers.tpl:28): unclosed action

1.6971317321453404e+09  ERROR   Reconciler error        {"controller": "vcluster", "controllerGroup": "infrastructure.cluster.x-k8s.io", "controllerKind": "VCluster", "vCluster": {"name":"vc-test","namespace":"vc-test"}, "namespace": "vc-test", "name": "vc-test", "reconcileID": "4b11d213-843c-4356-82a8-0d06c3ec12d0", "error": "error installing / upgrading vcluster: error executing helm upgrade: Release \"vc-test\" does not exist. Installing it now.\nError: parse error at (vcluster/templates/_helpers.tpl:28): unclosed action\n"}
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
        /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.12.1/pkg/internal/controller/controller.go:273
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
        /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.12.1/pkg/internal/controller/controller.go:234
1.6971317321453958e+09  DEBUG   vcluster-controller     Reconcile vc-test/vc-test
1.6971317321454782e+09  DEBUG   vcluster-controller     upgrade virtual cluster helm chart vc-test/vc-test
1.6971317321455257e+09  INFO    vcluster-controller     vclusters vc-test/vc-test patch version defined in .spec.kubernetesVersion field will be ignored, latest supported patch version will be used
1.697131732145606e+09   INFO    vcluster-controller     officially unsupported host server version 1.27, will fallback to virtual cluster version v1.24
1.6971317321457157e+09  INFO    vcluster-controller     Deploy virtual cluster vc-test/vc-test with values: init:
  manifests: |
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      annotations:
      labels:
        argocd.argoproj.io/instance: root-rook-ceph-external
        storageclass.kubernetes.io/is-default-class: "true"
      name: cephfs
      resourceVersion: "44708598"
      uid: 042c5cdc-fb21-47d3-aab7-098013d94ad8
    parameters:
      clusterID: rook-ceph
      csi.storage.k8s.io/controller-expand-secret-name: rook-csi-cephfs-provisioner
      csi.storage.k8s.io/controller-expand-secret-namespace: rook-ceph
      csi.storage.k8s.io/node-stage-secret-name: rook-csi-cephfs-node
      csi.storage.k8s.io/node-stage-secret-namespace: rook-ceph
      csi.storage.k8s.io/provisioner-secret-name: rook-csi-cephfs-provisioner
      csi.storage.k8s.io/provisioner-secret-namespace: rook-ceph
      fsName: cephfs
      pool: cephfs-data0
    provisioner: rook-ceph.cephfs.csi.ceph.com
    reclaimPolicy: Delete
    volumeBindingMode: Immediate
    allowVolumeExpansion: true
service:
  type: LoadBalancer
storage:
  className: cephfs
vcluster:
  image: rancher/k3s:v1.24.1-k3s1

helm upgrade vc-test vcluster --repo https://charts.loft.sh --version 0.15.7 --kubeconfig /tmp/2642901320 --namespace vc-test --install --values /tmp/21778710
lknite commented 11 months ago

I can see in the logs version 1.27, will fallback to virtual cluster version v1.24, but it would be nice to know ahead of time what the latest and great version is, or to be able to just select the newest available. Also, the above is failing, but if I go back to vcluster v0.13.0 it works. How can I know these two values ahead of time rather that by trial and error?

everflux commented 10 months ago

This is probably a duplicate of https://github.com/loft-sh/cluster-api-provider-vcluster/issues/39 - right?

lknite commented 8 months ago

This issue is more around knowing what to put in the yaml, than asking for a new version (though I am interested in newer versions as everyone else).

Potential solutions would be to allow no versions in the yaml and the latest will be selected automatically or a chart at github with supported versions.

Otherwise, it seems like just selecting a very high version would be a good "hack", but I'd rather not guess, and am will to go somewhere to look it up.

narcis96 commented 5 months ago

Fixed by https://github.com/loft-sh/cluster-api-provider-vcluster/pull/62. Please also check the new version of the README: https://github.com/loft-sh/cluster-api-provider-vcluster/pull/63