kubernetes-retired / cluster-api-provider-nested

Cluster API Provider for Nested Clusters
Apache License 2.0
301 stars 67 forks source link

Cannot create a VirtualCluster #235

Closed eightzero closed 2 years ago

eightzero commented 2 years ago

What steps did you take and what happened: [A clear and concise description on how to REPRODUCE the bug.]

[root@master ~]# kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-nested/master/virtualcluster/config/sampleswithspec/clusterversion_v1_nodeport.yaml
clusterversion.tenancy.x-k8s.io/cv-sample-np created
[root@master ~]# kubectl vc create -f https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-nested/master/virtualcluster/config/sampleswithspec/virtualcluster_1_nodeport.yaml -o vc-1.kubeconfig

2021/12/05 23:56:04 etcd is ready
cannot find sts/apiserver in ns default-56325d-vc-sample-1: default-56325d-vc-sample-1/apiserver is not ready in 120 seconds

What did you expect to happen:

$ kubectl vc create -f https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-nested/master/virtualcluster/config/sampleswithspec/virtualcluster_1_nodeport.yaml -o vc-1.kubeconfig
2020/11/15 11:13:26 etcd is ready
2020/11/15 11:13:46 apiserver is ready
2020/11/15 11:14:12 controller-manager is ready
2020/11/15 11:14:12 VirtualCluster default/vc-sample-1 setup successfully

Anything else you would like to add: [Miscellaneous information that will assist in solving the issue.]

[root@master ~]# kubectl get pod -ndefault-56325d-vc-sample-1
NAME          READY   STATUS              RESTARTS   AGE
apiserver-0   0/1     ContainerCreating   0          3m16s
etcd-0        1/1     Running             0          4m6s
[root@master ~]# kubectl describe pod -ndefault-56325d-vc-sample-1 apiserver-0
Name:           apiserver-0
Namespace:      default-56325d-vc-sample-1
...
...
Events:
  Type     Reason       Age                  From               Message
  ----     ------       ----                 ----               -------
  Normal   Scheduled    3m29s                default-scheduler  Successfully assigned default-56325d-vc-sample-1/apiserver-0 to node1
  Warning  FailedMount  86s                  kubelet            Unable to attach or mount volumes: unmounted volumes=[front-proxy-ca], unattached volumes=[default-token-8xcwl apiserver-ca front-proxy-ca root-ca serviceaccount-rsa]: timed out waiting for the condition
  Warning  FailedMount  81s (x9 over 3m29s)  kubelet            MountVolume.SetUp failed for volume "front-proxy-ca" : secret "front-proxy-ca" not found

Environment:

/kind bug [One or more /area label. See https://github.com/kubernetes-sigs/cluster-api-provider-nested/labels?q=area for the list of labels]

eightzero commented 2 years ago

There is no front-proxy-ca secret

[root@master ~]# kubectl get secret -n default-56325d-vc-sample-1
NAME                            TYPE                                  DATA   AGE
admin-kubeconfig                Opaque                                1      5h52m
apiserver-ca                    kubernetes.io/tls                     2      5h52m
controller-manager-kubeconfig   Opaque                                1      5h52m
default-token-8xcwl             kubernetes.io/service-account-token   3      5h52m
etcd-ca                         kubernetes.io/tls                     2      5h52m
root-ca                         kubernetes.io/tls                     2      5h52m
serviceaccount-rsa              kubernetes.io/tls                     2      5h52m
Fei-Guo commented 2 years ago

Sorry for the late reply. I think the problem should be the vc-manager image is outdated in docker hub. I just uploaded the latest image. Can you try again?

Thanks

eightzero commented 2 years ago

Thanks for your reply