loft-sh / cluster-api-provider-vcluster

Mozilla Public License 2.0
73 stars 21 forks source link

sync values stop successful provisioning #36

Closed lknite closed 11 months ago

lknite commented 1 year ago

These lines apparently break things:

      sync:
        persistentvolumes:
          enabled: "true"

Without those lines the provisioning succeeds.

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
spec:
  controlPlaneEndpoint:
    host: ""
    port: 0
  helmRelease:
    chart:
      name: vcluster
      repo: https://charts.loft.sh
      version: v0.13.0
    values: |
      storage:
        className: cephfs
#      sync:
#        persistentvolumes:
#          enabled: "true"
      ingress:
        enabled: "true"
        ingressClassName: "nginx"
        host: vc-test.root.k.home.net
#        annotations:
#          cert-manager\.io\/issuer: "cluster-adcs-issuer"
#          cert-manager\.io\/issuer-kind: "ClusterAdcsIssuer"
#          cert-manager\.io\/issuer-group: "adcs.certmanager.csf.nokia.com"

  kubernetesVersion: 1.24.0
lknite commented 1 year ago

k describe vclusters.infrastructure.cluster.x-k8s.io vc-test

...
Spec:
  Control Plane Endpoint:
    Host:  
    Port:  0
  Helm Release:
    Chart:
      Name:     vcluster
      Repo:     https://charts.loft.sh
      Version:  v0.13.0
    Values:     storage:
  className: cephfs
sync:
  persistentvolumes:
    enabled: true
ingress:
  enabled: "true"
  ingressClassName: "nginx"
  host: vc-test.root.k.home.net

  Kubernetes Version:  1.24.0
Status:
  Conditions:
    Last Transition Time:  2023-07-23T02:18:59Z
    Message:               error installing / upgrading vcluster: error executing helm upgrade: Release "vc-test" does not exist. Installing it now.
Error: rendered manifests contain a resource that already exists. Unable to continue with install: existing resource conflict: namespace: , name: vc-vc-test-v-vc-test, existing_kind: rbac.authorization.k8s.io/v1, Kind=ClusterRoleBinding, new_kind: rbac.authorization.k8s.io/v1, Kind=ClusterRoleBinding

    Reason:    HelmDeployFailed
    Severity:  Error
    Status:    False
    Type:      HelmChartDeployed
  Message:     error installing / upgrading vcluster: error executing helm upgrade: Release "vc-test" does not exist. Installing it now.
Error: rendered manifests contain a resource that already exists. Unable to continue with install: existing resource conflict: namespace: , name: vc-vc-test-v-vc-test, existing_kind: rbac.authorization.k8s.io/v1, Kind=ClusterRoleBinding, new_kind: rbac.authorization.k8s.io/v1, Kind=ClusterRoleBinding

  Phase:   Failed
  Reason:  HelmDeployFailed
Events:    <none>
ishankhare07 commented 12 months ago

Hi @lknite as the error message reports that its possible trying to create the namespace which already exists – and hence failing. Can you probably delete the entire thing – including the namespace – and retry from scratch?

Ideally there should be a check for this existence in case it exists but just trying to get to the root of the problem here

lknite commented 11 months ago

It's been awhile since I filed this, redeploying infrastructure and not seeing this issue. Closing.