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

Reconcile ipset when osnetconfig changes #1112

Merged

Conversation

stuggi
Copy link
Contributor

@stuggi stuggi commented Nov 20, 2024

When e.g. a network definition changes, the IPsets have to reconcile to update its information. This allows changing network definition, but needs to be done carefully and tests in a pre-prod env as it is an invasive change.

The process looks like this:

  • update the OpenStackNetConfig to do the network change
  • validate the IPSet for the role and the OpenStackNetConfig status reflects the new IPs for the nodes
172.18.3.20/24
  • Make sure you have a parameter file to allow update the network config for the role:
  network-environment.yaml: |
    parameter_defaults:
      ControllerNetworkConfigUpdate: True
      ComputeNetworkConfigUpdate: True
      ComputeLeaf1NetworkConfigUpdate: True
  • use the OpenStackConfigGenerator resource to create a new configversion
  • when config generator process finished, depending on the number of changed, the new created openstackconfigversion will show the diff (gets trunkated if it is too big)
  diff: |
    diff --git a/source-templates/environments/deployed-network-environment.yaml b/source-templates/environments/deployed-network-environment.yaml
    index 168a9242caa93630d17ade3d254604b967a3a3f0..d08508054b2fc8e01d8f6499b08fba25fbe84860 100644
    --- a/source-templates/environments/deployed-network-environment.yaml
    +++ b/source-templates/environments/deployed-network-environment.yaml
    @@ -99,2 +98,2 @@           storage_subnet:
    -            cidr: '172.18.3.0/24'
    -            gateway_ip: '172.18.3.1'
    +            cidr: '172.18.0.0/24'
    +            gateway_ip: '172.18.0.1'
    @@ -208 +207 @@       storage:
    -      - 172.18.3.0/24
    +      - 172.18.0.0/24
...
  • use the OpenStackDeploy resource to apply the generated configversion to the overcloud

Notes:

  • from checking the overcloud node, the /etc/os-net-config/config.yaml and /etc/sysconfig/network-scripts/ifcfg-enp5s0 are correct.
    When checking the running interface configuration we still see the old IP address 172.18.0.10. Reboot the node/if-down|if-up would fix it.
    This is not an OSPdO issue.
6: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc mq state UP group default qlen 1000
    link/ether 02:c8:20:00:00:04 brd ff:ff:ff:ff:ff:ff
    inet 172.18.0.10/32 brd 172.18.0.255 scope global enp5s0
       valid_lft forever preferred_lft forever
    inet 172.18.3.20/24 scope global enp5s0
       valid_lft forever preferred_lft forever
    inet 172.18.3.10/32 scope global enp5s0
       valid_lft forever preferred_lft forever
    inet6 fe80::c8:20ff:fe00:4/64 scope link
       valid_lft forever preferred_lft forever
  • General on changing networks. when e.g. removing a network from the openstackclient will still have a reservation on that network

Also restart openstackclient pod if network attachment list changes currently if a new network gets added to the openstackclient network list, the ipset and pod annotation gets updated, but the interface is not configured. Therefore this change makes sure that the openstackclient pod gets restarted when the network list changes

resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2325902

When e.g. a network definition changes, the IPsets have to
reconcile to update its information. This allows changing network
definition, but needs to be done carefully and tests in a pre-prod
env as it is an invasive change.

The process looks like this:
* update the OpenStackNetConfig to do the network change
* validate the IPSet for the role and the OpenStackNetConfig status reflects the new IPs for the nodes
```
172.18.3.20/24
```
* Make sure you have a parameter file to allow update the network config for the role:
```
  network-environment.yaml: |
    parameter_defaults:
      ControllerNetworkConfigUpdate: True
      ComputeNetworkConfigUpdate: True
      ComputeLeaf1NetworkConfigUpdate: True
```
* use the OpenStackConfigGenerator resource to create a new configversion
* when config generator process finished, depending on the number of changed, the new created openstackconfigversion will show the diff (gets trunkated if it is too big)
```
  diff: |
    diff --git a/source-templates/environments/deployed-network-environment.yaml b/source-templates/environments/deployed-network-environment.yaml
    index 168a9242caa93630d17ade3d254604b967a3a3f0..d08508054b2fc8e01d8f6499b08fba25fbe84860 100644
    --- a/source-templates/environments/deployed-network-environment.yaml
    +++ b/source-templates/environments/deployed-network-environment.yaml
    @@ -99,2 +98,2 @@           storage_subnet:
    -            cidr: '172.18.3.0/24'
    -            gateway_ip: '172.18.3.1'
    +            cidr: '172.18.0.0/24'
    +            gateway_ip: '172.18.0.1'
    @@ -208 +207 @@       storage:
    -      - 172.18.3.0/24
    +      - 172.18.0.0/24
...
```
* use the OpenStackDeploy resource to apply the generated configversion to the overcloud

Notes:
* from checking the overcloud node, the /etc/os-net-config/config.yaml and /etc/sysconfig/network-scripts/ifcfg-enp5s0 are correct.
  When checking the running interface configuration we still see the old IP address 172.18.0.10. Reboot the node/if-down|if-up would fix it.
  This is not an OSPdO issue.
6: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc mq state UP group default qlen 1000
    link/ether 02:c8:20:00:00:04 brd ff:ff:ff:ff:ff:ff
    inet 172.18.0.10/32 brd 172.18.0.255 scope global enp5s0
       valid_lft forever preferred_lft forever
    inet 172.18.3.20/24 scope global enp5s0
       valid_lft forever preferred_lft forever
    inet 172.18.3.10/32 scope global enp5s0
       valid_lft forever preferred_lft forever
    inet6 fe80::c8:20ff:fe00:4/64 scope link
       valid_lft forever preferred_lft forever
* General on changing networks. when e.g. removing a network from the openstackclient will still have a reservation on that network

resolved: https://bugzilla.redhat.com/show_bug.cgi?id=2325902
currently if a new network gets added to the openstackclient
network list, the ipset and pod annotation gets updated, but
the interface is not configured. Therefore this change makes
sure that the openstackclient pod gets restarted when the
network list changes

related https://bugzilla.redhat.com/show_bug.cgi?id=2325902

Signed-off-by: Martin Schuppert <mschuppert@redhat.com>
Copy link
Contributor

@olliewalsh olliewalsh left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Contributor

openshift-ci bot commented Nov 25, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: olliewalsh, stuggi

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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 3ac6cfd into openstack-k8s-operators:master Nov 25, 2024
10 checks passed
@stuggi
Copy link
Contributor Author

stuggi commented Nov 25, 2024

/cherry-pick v1.3.x

@openshift-cherrypick-robot

@stuggi: #1112 failed to apply on top of branch "v1.3.x":

Applying: Reconcile ipset when osnetconfig changes
Using index info to reconstruct a base tree...
M	main.go
Falling back to patching base and 3-way merge...
Auto-merging main.go
CONFLICT (content): Merge conflict in main.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 Reconcile ipset when osnetconfig changes

In response to this:

/cherry-pick v1.3.x

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants