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

Validate DHCP server status before reusing existing DHCP network #1933

Closed
Karthik-K-N opened this issue Aug 30, 2024 · 6 comments · Fixed by #2040
Closed

Validate DHCP server status before reusing existing DHCP network #1933

Karthik-K-N opened this issue Aug 30, 2024 · 6 comments · Fixed by #2040
Assignees
Labels
area/provider/ibmcloud Issues or PRs related to ibmcloud provider kind/feature Categorizes issue or PR as related to a new feature.
Milestone

Comments

@Karthik-K-N
Copy link
Contributor

Karthik-K-N commented Aug 30, 2024

/kind feature
/area provider/ibmcloud

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

Today, If user sets spec.dhcpServer.name and while checking for network we assume that there might exist a network associated with the server. If the network exist we are simply considering it. Code ref: https://github.com/Karthik-K-N/cluster-api-provider-ibmcloud/blob/3eb2b524c65167565c595d01e475497b066ef22a/cloud/scope/powervs_cluster.go#L884-L891

The request is to validate the DHCP server status before considering the associated network.

Reconcile Network workflow

  1. spec.DHCPserver.id is set - BUG, This case is not hanlded
    Comments: Need to discuss what should be done on how to select network, may be expect network id to be set?

  2. spec.DHCPServer.name is set
    a. if spec.network.id is set - Fetch for network with id and use
    Comments: DHCPServer name is ignored and network id got preference,
    b. Try to find network with name DHCPSERVER<spec.DHCPServer.name>_Private and if found use

  3. spec.DHCPServer.name is not set
    a. if spec.network.id is set - Fetch for network with id and use
    Comments: DHCPServer name is ignored and network id got preference,

    *. if spec.network.name is set
    a. Try to find network with name spec.network.name

    *. if spec.network.name is not set
    a. Try to find network with name DHCPSERVER<cluster_name>_Private and if found use

  4. If the network is not found, Create DHCP server with name spec.DHCPServer.Name if set else with clustername
    set both dhcpserverid and network id in status.

  5. status.DHCPServer.id is set, then the dhcp server will be created by controller and status.network.id will also be set by controller

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

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. area/provider/ibmcloud Issues or PRs related to ibmcloud provider labels Aug 30, 2024
@Karthik-K-N
Copy link
Contributor Author

@Amulyam24 @dharaneeshvrd also we cannot check DHCP server status when user provides name of existing network right, Because no where we can know, if it has associated DHCP server or not.
Just wanted to know is there any way we can validate a network is functional?

@Karthik-K-N
Copy link
Contributor Author

@Amulyam24 we also need to check whats the flow when we set spec.network.name.

@Amulyam24 Amulyam24 removed their assignment Oct 29, 2024
@Amulyam24
Copy link
Contributor

/cc @dharaneeshvrd

@dharaneeshvrd
Copy link
Contributor

/assign

@Karthik-K-N
Copy link
Contributor Author

What will happen when a user sets a network name in spec say "capiNetwork" and which does not exist in cloud,

I think currently controller does following things,

  1. Tries to fetch network in cloud with name "capiNetwork", Which does not exist so returns nil
  2. The dhcp network will be created, but the dhcp network name wont be same as user provided as we dont have control over full network name created by DHCP server.

@dharaneeshvrd I think we need to handle this case right?

@dharaneeshvrd
Copy link
Contributor

Yes Agree. We have to handle that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/provider/ibmcloud Issues or PRs related to ibmcloud provider kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants