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

[occm] consider private network names when node contains IPs from other private networks #1041

Merged
merged 8 commits into from
May 1, 2020

Conversation

kayrus
Copy link
Contributor

@kayrus kayrus commented Apr 20, 2020

What this PR does / why we need it:

If there is a private network name specified for nodes and the IP list contains IPs from a different private network, they have to be ignored by OCCM.

Which issue this PR fixes(if applicable):
fixes #1039

Special notes for reviewers:
Cherry-pick candidate for branch release-1.18

Release note:

None

@gdetal try this PR in your environment and let me know if it works fine for your case.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 20, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @kayrus. Thanks for your PR.

I'm waiting for a kubernetes 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. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 20, 2020
@kayrus
Copy link
Contributor Author

kayrus commented Apr 20, 2020

/assign @lingxiankong

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 20, 2020

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 20, 2020

Build failed.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 20, 2020

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 20, 2020

Build failed.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 20, 2020

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 20, 2020

Build failed.

@gdetal
Copy link

gdetal commented Apr 20, 2020

@kayrus I can confirm that this fixes #1039

I0420 13:17:47.881870       1 openstack.go:754] Node 'openstack-md-0-h6z75' address '10.8.0.235' ignored due to 'internal-network-name' option
I0420 13:17:47.881886       1 openstack.go:754] Node 'openstack-md-0-h6z75' address '10.7.0.74' ignored due to 'internal-network-name' option
I0420 13:17:47.881890       1 openstack.go:754] Node 'openstack-md-0-h6z75' address '10.9.0.94' ignored due to 'internal-network-name' option
I0420 13:17:47.881896       1 openstack_instances.go:90] NodeAddresses(openstack-md-0-h6z75) => [{InternalIP 10.6.0.199}]

Thanks !

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 20, 2020

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 20, 2020

Build succeeded.

@ramineni
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 21, 2020
@k8s-ci-robot
Copy link
Contributor

@kayrus: The /retest command does not accept any targets.
The following commands are available to trigger jobs:

  • /test pull-cloud-provider-openstack-check
  • /test pull-cloud-provider-openstack-test

Use /test all to run all jobs.

In response to this:

/retest cloud-provider-openstack-acceptance-test-csi-cinder

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/test-infra repository.

@k8s-ci-robot
Copy link
Contributor

@kayrus: The /retest command does not accept any targets.
The following commands are available to trigger jobs:

  • /test pull-cloud-provider-openstack-check
  • /test pull-cloud-provider-openstack-test

Use /test all to run all jobs.

In response to this:

/retest cloud-provider-openstack-unittest

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/test-infra repository.

@kayrus
Copy link
Contributor Author

kayrus commented Apr 21, 2020

test cloud-provider-openstack-acceptance-test-csi-cinder

@kayrus
Copy link
Contributor Author

kayrus commented Apr 21, 2020

test cloud-provider-openstack-unittest

@kayrus
Copy link
Contributor Author

kayrus commented Apr 21, 2020

retest cloud-provider-openstack-acceptance-test-csi-cinder

@kayrus
Copy link
Contributor Author

kayrus commented Apr 21, 2020

/retest cloud-provider-openstack-unittest

@k8s-ci-robot
Copy link
Contributor

@kayrus: The /retest command does not accept any targets.
The following commands are available to trigger jobs:

  • /test pull-cloud-provider-openstack-check
  • /test pull-cloud-provider-openstack-test

Use /test all to run all jobs.

In response to this:

/retest cloud-provider-openstack-unittest

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/test-infra repository.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 25, 2020

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 25, 2020

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 25, 2020

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 25, 2020

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 25, 2020

Build failed.

@kayrus
Copy link
Contributor Author

kayrus commented Apr 25, 2020

/test cloud-provider-openstack-acceptance-test-e2e-conformance

@k8s-ci-robot
Copy link
Contributor

@kayrus: The specified target(s) for /test were not found.
The following commands are available to trigger jobs:

  • /test pull-cloud-provider-openstack-check
  • /test pull-cloud-provider-openstack-test

Use /test all to run all jobs.

In response to this:

/test cloud-provider-openstack-acceptance-test-e2e-conformance

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/test-infra repository.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 25, 2020

Build succeeded.

addressType = v1.NodeExternalIP
} else if util.Contains(networkingOpts.PublicNetworkName, network) {
addressType = v1.NodeExternalIP
RemoveFromNodeAddresses(&addrs,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the address is removed here if the network name is included in PublicNetworkName?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zuzzas could you please explain your test case?

Copy link
Contributor

Choose a reason for hiding this comment

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

It may be present in the fixed IPs and erroneously counted as an InternalIP. We remove it and add again as a proper ExternalIP address.

Copy link
Contributor

Choose a reason for hiding this comment

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

@zuzzas I'm still confused, in which case It may be present in the fixed IPs and erroneously counted as an InternalIP?

Copy link
Contributor

@zuzzas zuzzas Apr 26, 2020

Choose a reason for hiding this comment

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

Without the proposed patch, in the following situation, 10.220.213.38 will be counted both as InternalIP and ExternalIP. It does not look right, since we've explicitly designated in the CCM's configuration the network BGP-VLAN-3894 with this IP as public.

$ openstack --debug server show f4a319e6-95fb-445a-ac2d-a6374264d6c1

{
  "server": {
    "addresses": {
      "BGP-VLAN-3894": [
        {
          "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:42:95:9f",
          "version": 4,
          "addr": "10.220.213.157",
          "OS-EXT-IPS:type": "fixed"
        }
      ],
      "e2e": [
        {
          "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:6c:f6:bb",
          "version": 4,
          "addr": "192.168.199.52",
          "OS-EXT-IPS:type": "fixed"
        }
      ]
    }
  }
}

$ nova --debug interface-list f4a319e6-95fb-445a-ac2d-a6374264d6c1

{
  "interfaceAttachments": [
    {
      "port_id": "08368bb9-1021-4f08-a318-44bade127942",
      "port_state": "ACTIVE",
      "tag": null,
      "mac_addr": "fa:16:3e:42:95:9f",
      "fixed_ips": [
        {
          "subnet_id": "728ca9da-da11-4076-ac32-c47a18693c5c",
          "ip_address": "10.220.213.157"
        }
      ],
      "net_id": "a30dbaf7-dd86-4c67-aaa5-42c4fdf33e2a"
    },
    {
      "port_id": "8cc3d233-89ae-4e06-aed8-5b92cea3b5a4",
      "port_state": "ACTIVE",
      "tag": null,
      "mac_addr": "fa:16:3e:6c:f6:bb",
      "fixed_ips": [
        {
          "subnet_id": "b33a5f97-3924-4f8d-ad8c-10d5b08f81aa",
          "ip_address": "192.168.199.52"
        }
      ],
      "net_id": "847533ef-13bd-4655-a9b3-812b5ba1e3e0"
    }
  ]
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Does BGP-VLAN-3894 exist in the output of openstack network list --external command?

Copy link
Contributor

Choose a reason for hiding this comment

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

aks@aks-ThinkPad-X230:~$ openstack network list --external
+--------------------------------------+---------------+--------------------------------------+
| ID                                   | Name          | Subnets                              |
+--------------------------------------+---------------+--------------------------------------+
| a30dbaf7-dd86-4c67-aaa5-42c4fdf33e2a | BGP-VLAN-3894 | 728ca9da-da11-4076-ac32-c47a18693c5c |
| c153f6b2-c186-4828-b98c-9cbd79f13621 | VLAN-3502     | 6dc455a0-f44c-4d9a-9d10-8557c4d38f53 |
+--------------------------------------+---------------+--------------------------------------+```

Copy link
Contributor

Choose a reason for hiding this comment

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

@zuzzas that's pretty weird, according to the console output you provided above,

      "BGP-VLAN-3894": [
        {
          "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:42:95:9f",
          "version": 4,
          "addr": "10.220.213.157",
          "OS-EXT-IPS:type": "fixed"
        }
      ],

BGP-VLAN-3894 should be an internal Neutron network.

Nevermind, it's not harmful to add that logic, do you mind adding some comments for Line 751 before we merge this PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd launch a full-blown investigation into this peculiarity. Alas, it is a public OpenStack from Mail.ru Cloud Solutions.

Sure.

Copy link
Contributor

Choose a reason for hiding this comment

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

It is done.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 30, 2020

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 30, 2020

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 30, 2020

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 30, 2020

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Apr 30, 2020

Build succeeded.

@lingxiankong
Copy link
Contributor

/lgtm

Thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 30, 2020
@ramineni
Copy link
Contributor

ramineni commented May 1, 2020

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ramineni

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 1, 2020
@k8s-ci-robot k8s-ci-robot merged commit c544421 into kubernetes:master May 1, 2020
@kayrus kayrus deleted the handle-net-names branch May 1, 2020 08:59
@kayrus
Copy link
Contributor Author

kayrus commented May 1, 2020

@zuzzas, thanks for this PR

powellchristoph pushed a commit to powellchristoph/cloud-provider-openstack that referenced this pull request Jan 19, 2022
…er private networks (kubernetes#1041)

* OCCM: consider network names, when specified

* Move v1 helper functions into openstack_instances.go

* [occm] Address detection logic fixes

Signed-off-by: Andrey Klimentyev <andrey.klimentyev@flant.com>

* Typo fix

* Move LB related helpers into occm package

* Added comment

Co-authored-by: Andrey Klimentyev <andrey.klimentyev@flant.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[occm] 'internal-network-name' broken since release 1.18
6 participants