kubernetes-sigs / cluster-api-provider-kubevirt

Cluster API Provider for KubeVirt
Apache License 2.0
108 stars 61 forks source link

controlPlaneEndpoint not used by kubevirtcluster controller #218

Closed aamoyel closed 1 year ago

aamoyel commented 1 year ago

What steps did you take and what happened: I've tried to bootstrap a new cluster with a specific Control Plane endpoint (for testing purpose) and contrary to the "KubevirtCluster" CRD, My static endpoint is not used and ClusterIP Service address appear in controllers logs. Here is my configuration:

apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: KubevirtCluster
metadata:
  name: sailor-test
  namespace: sailor-test
spec:
  # Remote Kubevirt Cluster
  infraClusterSecretRef:
    apiVersion: v1
    kind: Secret
    name: kubevirt-kubeconfig
  controlPlaneEndpoint:
    host: 10.132.0.29
    port: 32443

What did you expect to happen: I expect that the bootstrap controller use my host and port (10.132.0.23:32443) to reach api-server of the new cluster. But currently controllers used ClusterIP addr.

This line in your code replace controlPlaneEndpoint values with LB external IP : https://github.com/kubernetes-sigs/cluster-api-provider-kubevirt/blob/main/controllers/kubevirtcluster_controller.go#L164

Environment:

/kind bug

pjaton commented 1 year ago

Thank you Alan for your issue,

We discussed it today during the bi-weekly community meeting and we agree that the KubevirtCluster’s controlPlaneEndpoint should not be overridden if it is set by the user. It looks like this would require making this field a pointer and then checking for nil before setting it in both:

Is this a fix you would be willing to contribute?

Thanks

aamoyel commented 1 year ago

Thank you Alan for your issue,

We discussed it today during the bi-weekly community meeting and we agree that the KubevirtCluster’s controlPlaneEndpoint should not be overridden if it is set by the user. It looks like this would require making this field a pointer and then checking for nil before setting it in both:

* The LoadBalancer case you indicated [controllers/kubevirtcluster_controller.go#L164](https://github.com/kubernetes-sigs/cluster-api-provider-kubevirt/blob/main/controllers/kubevirtcluster_controller.go#L164)

* The CusterIP case right bellow [controllers/kubevirtcluster_controller.go#L176](https://github.com/kubernetes-sigs/cluster-api-provider-kubevirt/blob/main/controllers/kubevirtcluster_controller.go#L176)

Is this a fix you would be willing to contribute?

Thanks

Hi, Thanks for your reply. Yes, i would be very happy to contribute to your project. There is a particular way to contribute to this repo ? I haven't seen any specific instructions in the main Readme.

Thanks

pjaton commented 1 year ago

Thanks Alan, that would be awesome.

The instructions are described in the CONTRIBUTING.md doc and, effectively follow the CNCF guidelines.

I am only a contributor and not a maintainer of the project, but I'm sure @davidvossel or @agradouski , can help if needed.

Thanks

k8s-triage-robot commented 1 year ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale