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

runtimecfg: Add node-ip subcommand #57

Merged
merged 1 commit into from Apr 17, 2020

Conversation

celebdor
Copy link
Contributor

node-ip is a subcommand that allows the user to see which IP should the
node use in cases of multiple interface and multiple address nodes. This
is useful to prevent cases where Container Runtime related services bind
to an interface that is not reachable in the control plane.

It has two subcommands:

  • show: Takes one or more Virtual IPs of the control plane and it gives
    you one eligible IP on stdout.

  • set: Takes one or more Virtual IPs of the control plane and sets
    systemd service configuration for services like CRI-O or Kubelet that
    need to bind to the control plane.

In the process of making the commit, and to make runtimecfg less of a
monolith, I split its subcommands to separate files.

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 16, 2020
@celebdor
Copy link
Contributor Author

Moved the implementation from openshift/machine-config-operator#1564

@celebdor
Copy link
Contributor Author

/hold

Need to test a full deployment with the accompanying change in MCO that moves to use it.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 16, 2020
@celebdor
Copy link
Contributor Author

Need to add the retry on failure functionality from openshift/machine-config-operator#1601 to prevent a regression

cmd/runtimecfg/node-ip.go Outdated Show resolved Hide resolved
cmd/runtimecfg/node-ip.go Outdated Show resolved Hide resolved
@bcrochet
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 16, 2020
Copy link
Member

@cybertron cybertron left a comment

Choose a reason for hiding this comment

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

This failed in my local testing:

Apr 16 18:23:31 master-0.ostest.test.metalkube.org podman[1899]: time="2020-04-16T18:23:31Z" level=info msg="Parsed Virtual IP fd2e:6f44:5dd8:c956::5"
Apr 16 18:23:31 master-0.ostest.test.metalkube.org podman[1899]: time="2020-04-16T18:23:31Z" level=fatal msg="error in node-ip set: protocol not supported\n"

I'm trying again with some more logging added to see if I can figure out where the error is actually coming from.

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Apr 17, 2020
@celebdor
Copy link
Contributor Author

celebdor commented Apr 17, 2020

The binary works when copied to my IPv6 env:

INFO[0000] Parsed Virtual IP fd2e:6f44:5dd8:c956::2     
INFO[0000] Checking whether address fe80::3438:32ff:fe83:e265/64 contains VIP fd2e:6f44:5dd8:c956::2 
INFO[0000] Checking whether address fe80::ace7:39ff:fe5d:174e/64 contains VIP fd2e:6f44:5dd8:c956::2 
INFO[0000] Checking whether address fd00:1101::3/64 contains VIP fd2e:6f44:5dd8:c956::2 
INFO[0000] Checking whether address fe80::a2ec:1236:302:8010/64 contains VIP fd2e:6f44:5dd8:c956::2 
INFO[0000] Checking route {Ifindex: 3 Dst: fd2e:6f44:5dd8:c956::/64 Src: <nil> Gw: <nil> Flags: [] Table: 254} (mask ffffffffffffffff0000000000000000) for address fd2e:6f44:5dd8:c956::14/128 
INFO[0000] Checking whether address fd2e:6f44:5dd8:c956::14/128 with route {Ifindex: 3 Dst: fd2e:6f44:5dd8:c956::/64 Src: <nil> Gw: <nil> Flags: [] Table: 254} contains VIP fd2e:6f44:5dd8:c956::2 
INFO[0000] Address fd2e:6f44:5dd8:c956::14/128 with route {Ifindex: 3 Dst: fd2e:6f44:5dd8:c956::/64 Src: <nil> Gw: <nil> Flags: [] Table: 254} contains VIP fd2e:6f44:5dd8:c956::2 
INFO[0000] Checking whether address fe80::da45:8914:69a7:bc32/64 contains VIP fd2e:6f44:5dd8:c956::2 
INFO[0000] Checking whether address fe80::2c52:1fff:fe5e:455a/64 contains VIP fd2e:6f44:5dd8:c956::2 
INFO[0000] Checking whether address fe80::4c40:b9ff:fee9:a41e/64 contains VIP fd2e:6f44:5dd8:c956::2 
INFO[0000] Checking whether address 127.0.0.1/8 lo contains VIP fd2e:6f44:5dd8:c956::2 
INFO[0000] Checking whether address fe80::286e:2dff:feb1:3220/64 contains VIP fd2e:6f44:5dd8:c956::2 
INFO[0000] Checking whether address fd99::1/64 contains VIP fd2e:6f44:5dd8:c956::2 
INFO[0000] Checking whether address fe80::80dc:82ff:fe78:ba89/64 contains VIP fd2e:6f44:5dd8:c956::2 
INFO[0000] Checking whether address fe80::9c5b:dcff:fe76:18bd/64 contains VIP fd2e:6f44:5dd8:c956::2 
INFO[0000] Checking whether address fe80::ac65:aeff:fe29:c431/64 contains VIP fd2e:6f44:5dd8:c956::2 
INFO[0000] Checking whether address fe80::ac12:36ff:fee5:7260/64 contains VIP fd2e:6f44:5dd8:c956::2 
INFO[0000] Checking whether address fd01:0:0:3::2/64 contains VIP fd2e:6f44:5dd8:c956::2 
INFO[0000] Checking whether address fe80::e849:dcff:fe33:d045/64 contains VIP fd2e:6f44:5dd8:c956::2 
INFO[0000] Checking whether address fe80::fcf1:85ff:feb8:4518/64 contains VIP fd2e:6f44:5dd8:c956::2 
INFO[0000] Checking whether address fe80::90ba:12ff:fe5d:fc3b/64 contains VIP fd2e:6f44:5dd8:c956::2 
INFO[0000] Checking whether address fe80::24ed:9cff:fe4d:3b2b/64 contains VIP fd2e:6f44:5dd8:c956::2 
INFO[0000] Checking whether address fe80::c6f:3dff:fe6d:bfbe/64 contains VIP fd2e:6f44:5dd8:c956::2 
INFO[0000] Chosen Node IP fd2e:6f44:5dd8:c956::14       
INFO[0000] Opening Kubelet service override path /etc/systemd/system/kubelet.service.d/20-nodenet.conf 
INFO[0000] Writing Kubelet service override with content [Service]
Environment="KUBELET_NODE_IP=fd2e:6f44:5dd8:c956::14" 
INFO[0000] Opening CRI-O service override path /etc/systemd/system/crio.service.d/20-nodenet.conf 
INFO[0000] Writing CRI-O service override with content [Service]
Environment="CONTAINER_STREAM_ADDRESS=fd2e:6f44:5dd8:c956::14" 
[core@master-0 ~]$ ./runtimecfg node-ip show fd2e:6f44:5dd8:c956::2 2> /dev/null
fd2e:6f44:5dd8:c956::14
[core@master-0 ~]$ ```

node-ip is a subcommand that allows the user to see which IP should the
node use in cases of multiple interface and multiple address nodes. This
is useful to prevent cases where Container Runtime related services bind
to an interface that is not reachable in the control plane.

It has two subcommands:

* show: Takes one or more Virtual IPs of the control plane and it gives
  you one eligible IP on stdout.

* set: Takes one or more Virtual IPs of the control plane and sets
  systemd service configuration for services like CRI-O or Kubelet that
  need to bind to the control plane.

In the process of making the commit, and to make runtimecfg less of a
monolith, I split its subcommands to separate files.
@celebdor
Copy link
Contributor Author

verified to work on both masters and workers.

@celebdor
Copy link
Contributor Author

/retest

@celebdor
Copy link
Contributor Author

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 17, 2020
@celebdor
Copy link
Contributor Author

/retest

Copy link
Member

@cybertron cybertron left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bcrochet, celebdor, cybertron

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 [bcrochet,celebdor,cybertron]

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

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 17, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit dada6bf into openshift:master Apr 17, 2020
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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants