kubernetes-sigs / cluster-api-provider-openstack

Cluster API implementation for OpenStack
https://cluster-api-openstack.sigs.k8s.io/
Apache License 2.0
283 stars 253 forks source link

feat: add configurable loadbalancer network #1922

Closed oblazek closed 5 months ago

oblazek commented 6 months ago

Previously when loadbalacer was created it used the same network/subnet as the control plane nodes for the VIP. This was not always the right assumption as some users might want to be able to customize this according to their env.

This commit fixes the above by adding two fields into OpenStackClusterSpec/Status two fields network and subnets under APIServerLoadBalancer so that user can define which network/subnet to use for allocation of the loadbalancer.

apiVersion: infrastructure.cluster.x-k8s.io/v1alpha8
kind: OpenStackCluster
metadata:
  name: {{ capi_cluster_name }}
spec:
  cloudName: {{ capi_cluster_os_cloud }}
  identityRef:
    kind: Secret
    name: test3-cloud-config
  managedSecurityGroups: true
  apiServerLoadBalancer:
    enabled: true
    network:
      name: vip-net-ulab1
    subnets:
      - name: ulab1-ipv4-1
status:
  apiServerLoadBalancer:
    id: 808239dc-064f-402e-bd7d-ca667157a76c
    internalIP: 10.248.11.161
    ip: ""
    loadBalancerNetwork:
      id: 65f6a910-3968-46c0-8f72-e4f171476670
      name: vip-net-ulab1
      subnets:
      - id: 5b4e2c9b-1ab9-4510-87a4-6d2301e16e77
    name: k8s-clusterapi-cluster-test3-test3-kubeapi

Fixes: #1809

Signed-off-by: Ondrej Blazek ondrej.blazek@firma.seznam.cz

linux-foundation-easycla[bot] commented 6 months ago

CLA Signed

The committers listed above are authorized under a signed CLA.

k8s-ci-robot commented 6 months ago

Welcome @oblazek!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-openstack 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-openstack has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot commented 6 months ago

Hi @oblazek. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
netlify[bot] commented 6 months ago

Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!

Name Link
Latest commit e2897fb1fe495a2c7697c6e926717da7264868ab
Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-openstack/deploys/6613961c7573080009e8254f
Deploy Preview https://deploy-preview-1922--kubernetes-sigs-cluster-api-openstack.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

dulek commented 6 months ago

/ok-to-test

oblazek commented 5 months ago

this should be ready for another round

mdbooth commented 5 months ago

/approve

k8s-ci-robot commented 5 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dulek, mdbooth

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/OWNERS)~~ [mdbooth] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment