Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Virtual IP configuration to set different address/port #986

Merged
merged 5 commits into from
Dec 11, 2024

Conversation

dkoshkin
Copy link
Contributor

@dkoshkin dkoshkin commented Dec 2, 2024

What problem does this PR solve?:
New configuration to support setting different virutalIP address from the external controlPlaneEndpoint. This is useful for Clusters like a Nutanix Cluster in a VPC where the virtual IP needs to be some IP from same Subnet as the VMs, but the conrtol-plane endpoint is a floating IP mapped to the virtual IP accessible from outside the VPC.

spec:
  topology:
    variables:
      - name: clusterConfig
        value:
          nutanix:
            controlPlaneEndpoint:
              host: x.x.x.x
              port: 6443
              virtualIP:
                configuration:
                  address: y.y.y.y

The "configuration" keyword comes from an existing API here

Configuration *ServiceLoadBalancerConfiguration `json:"configuration,omitempty"`

Which issue(s) this PR fixes:
Fixes #

How Has This Been Tested?:

  • New unit tests
  • Created a Nutanix Cluster inside a VPC

Assigned a floating IP 10.22.198.34 to an internal IP 172.16.0.101
image
One of the control-plane VMs got the internal VIP assigned.
image

And the Cluster is accessible outside of the VPC.

kubectl get nodes
NAME                                          STATUS   ROLES           AGE    VERSION
dkoshkin-floating-ip-k9d74-d8jxp              Ready    control-plane   122m   v1.30.5
dkoshkin-floating-ip-k9d74-fb5pb              Ready    control-plane   125m   v1.30.5
dkoshkin-floating-ip-k9d74-wtl5w              Ready    control-plane   123m   v1.30.5
dkoshkin-floating-ip-md-0-qkg7q-pm5z9-6zf8f   Ready    <none>          124m   v1.30.5

Special notes for your reviewer:

@dkoshkin dkoshkin force-pushed the dkoshkin/feat-virtualIP-configuration branch from ebad0e3 to f9b6bd0 Compare December 2, 2024 21:34
@dkoshkin dkoshkin force-pushed the dkoshkin/feat-virtualIP-configuration branch from f9b6bd0 to e4e2d76 Compare December 2, 2024 21:44
Copy link
Contributor

@supershal supershal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jimmidyson
Copy link
Member

@dkoshkin Do we know of other providers that would need to support this? If not, then I wonder if we should make it specific to Nutanix clusters somehow.

api/v1alpha1/common_types.go Show resolved Hide resolved
api/v1alpha1/common_types.go Outdated Show resolved Hide resolved
api/v1alpha1/common_types.go Outdated Show resolved Hide resolved
@dkoshkin dkoshkin requested a review from jimmidyson December 5, 2024 23:03
Copy link
Member

@jimmidyson jimmidyson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually just realised that Nutanix CCM handler will need updating in https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/blob/main/pkg/handlers/generic/lifecycle/ccm/nutanix/handler.go to pass in this VIP as well to be ignored as part of possible node IPs by Nutanix CCM.

@dkoshkin dkoshkin force-pushed the dkoshkin/feat-virtualIP-configuration branch from f04799b to dae3dae Compare December 9, 2024 18:28
@dkoshkin dkoshkin force-pushed the dkoshkin/feat-virtualIP-configuration branch from dae3dae to 9f3c8f7 Compare December 9, 2024 18:35
@dkoshkin dkoshkin requested a review from jimmidyson December 9, 2024 22:52
@dkoshkin dkoshkin merged commit e926d8d into main Dec 11, 2024
21 checks passed
@dkoshkin dkoshkin deleted the dkoshkin/feat-virtualIP-configuration branch December 11, 2024 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants