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

re-factor lib/networking #170

Merged

Conversation

hjensas
Copy link
Contributor

@hjensas hjensas commented Apr 10, 2024

When trying to re-use this for a DT I had to duplicate everything in lib/networking because the netconfig requires values for an external network.

I think splitting to separate subdirectories/kustomization files in lib/networking will allow me to re-use the metallb and nad bits.

Copy link
Contributor

@fultonj fultonj left a comment

Choose a reason for hiding this comment

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

Thank you @hjensas

In general I think this is good so that the lib directory is more usable. I understand you need this so that you can still use the common nad and metallb directories while adding an IPv6 controlplane with Ironic (PR 168). I'd like to merge this after we are sure it will not break anything.

A few questions:

  • With this patch kustomize build control-plane in architecture/examples/va/hci produces networks with CamelCase names (e.g. InternalApi) while prior to this patch they were all lower case (e.g. internalapi). Is this intentional?

  • @Jaganathancse do you see any issues with this that might affect VA2?

I did some quick testing of this PR and saw that the kustomize build commands as described in the VA1 readme and it seemed to produce the correct CRs. However, I think we need to see results of a fully automated VA1 deployment triggered by something like this:

ansible-playbook reproducer.yml \
    -i custom/inventory.yml \
    -e cifmw_target_host=hypervisor-1 \
    -e @scenarios/reproducers/va-hci.yml \
    -e @scenarios/reproducers/networking-definition.yml \
    -e @custom/secrets.yml \
    -e @custom/default-vars.yaml \
    [-e @custom/hci.yaml] \
    -e cifmw_deploy_architecture=true

@hjensas hjensas marked this pull request as draft April 10, 2024 12:58
@hjensas
Copy link
Contributor Author

hjensas commented Apr 10, 2024

A few questions:

* With this patch `kustomize build control-plane` in `architecture/examples/va/hci` produces networks with CamelCase names (e.g. InternalApi) while prior to this patch they were all lower case (e.g. internalapi). Is this intentional?

This was not intentional - I moved this to Draft. I will look into why that changed.

@Jaganathancse
Copy link
Contributor

Thank you @hjensas

In general I think this is good so that the lib directory is more usable. I understand you need this so that you can still use the common nad and metallb directories while adding an IPv6 controlplane with Ironic (PR 168). I'd like to merge this after we are sure it will not break anything.

A few questions:

  • With this patch kustomize build control-plane in architecture/examples/va/hci produces networks with CamelCase names (e.g. InternalApi) while prior to this patch they were all lower case (e.g. internalapi). Is this intentional?
  • @Jaganathancse do you see any issues with this that might affect VA2?
    @fultonj Looks like fine only code refactoring, will also try this PR locally and confirm it.

I did some quick testing of this PR and saw that the kustomize build commands as described in the VA1 readme and it seemed to produce the correct CRs. However, I think we need to see results of a fully automated VA1 deployment triggered by something like this:

ansible-playbook reproducer.yml \
    -i custom/inventory.yml \
    -e cifmw_target_host=hypervisor-1 \
    -e @scenarios/reproducers/va-hci.yml \
    -e @scenarios/reproducers/networking-definition.yml \
    -e @custom/secrets.yml \
    -e @custom/default-vars.yaml \
    [-e @custom/hci.yaml] \
    -e cifmw_deploy_architecture=true

@hjensas hjensas self-assigned this Apr 10, 2024
@hjensas
Copy link
Contributor Author

hjensas commented Apr 10, 2024

A few questions:

* With this patch `kustomize build control-plane` in `architecture/examples/va/hci` produces networks with CamelCase names (e.g. InternalApi) while prior to this patch they were all lower case (e.g. internalapi). Is this intentional?

This was not intentional - I moved this to Draft. I will look into why that changed.

So I tried locally - and I get the same result with/without the patch:

$ git branch 
* main
  re-stucture-lib-networking
$ kustomize build control-plane > pre-lib-refactor-control-plane.yaml
$ git checkout re-stucture-lib-networking 
Switched to branch 're-stucture-lib-networking'
Your branch is up to date with 'origin/re-stucture-lib-networking'.
$ kustomize build control-plane > post-lib-refactor-control-plane.yaml
 diff -s pre-lib-refactor-control-plane.yaml post-lib-refactor-control-plane.yaml
Files pre-lib-refactor-control-plane.yaml and post-lib-refactor-control-plane.yaml are identical

@hjensas hjensas marked this pull request as ready for review April 10, 2024 15:13
@hjensas hjensas force-pushed the re-stucture-lib-networking branch 2 times, most recently from e67b781 to 5bb41ac Compare April 10, 2024 17:21
When trying to re-use this for a DT I had to duplicate everything
in lib/networking because the netconfig requires values for an
external network.

I think splitting to separate subdirectories/kustomization files in
lib/networking will allow me to re-use the metallb and nad bits.
Copy link
Contributor

@abays abays left a comment

Choose a reason for hiding this comment

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

Tested in a fully-automated VA1 deployment and it succeeded

/lgtm

@fultonj fultonj merged commit 07a3bc5 into openstack-k8s-operators:main Apr 11, 2024
2 checks passed
@hjensas hjensas deleted the re-stucture-lib-networking branch April 12, 2024 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants