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

netdog: remove IP string formatting when setting as hostname #1693

Merged
merged 1 commit into from
Aug 4, 2021

Conversation

etungsten
Copy link
Contributor

@etungsten etungsten commented Aug 4, 2021

Issue number:
N/A

Description of changes:

Author: Erikson Tung <[email protected]>
Date:   Tue Aug 3 17:50:05 2021 -0700

    netdog: remove ip string formatting when setting as hostname
    
    This removes the "ip-X-X-X-X" formatting of the IP address when we're
    using it to set as our hostname. This fixes upgrades and downgrades to
    and from versions of Bottlerocket that uses their plain IP as their
    hostname when registering with the K8s control plane.

Testing done:
Built OVAs for vmware-k8s-1.20, vmware-k8s-1.21 fine.
Launched VMs and observed that the hostnames were being set to the VM IP address as expected:

bash-5.0# apiclient -u /settings?keys=settings.network.hostname
{"network":{"hostname":"198.19.32.14"}}

Tried upgrading from a v1.1.4 VM and the VM comes back fine. Node shows up in cluster fine.
Ran upgrade downgrading testing on the VMs, the quick tests pass.

* Phase 2a: launch Bottlerocket v1.1.4 instances
Importing OVA and creating a template out of it...
Launching 3 Bottlerocket v1.1.4 nodes
Cloning VM for worker node '1-20-test-updown-node-1'...
Powering on VirtualMachine:vm-1206... OK
Cloning VM for worker node '1-20-test-updown-node-2'...
Powering on VirtualMachine:vm-1207... OK
Cloning VM for worker node '1-20-test-updown-node-3'...
Powering on VirtualMachine:vm-1208... OK
Waiting for launched Bottlerocket nodes to become 'Ready' in 1-20-test cluster
198.19.128.59   Ready      <none>   37s   v1.20.8
198.19.128.60   NotReady   <none>   15s   v1.20.8
198.19.64.30    NotReady   <none>   0s    v1.20.8

198.19.128.59   Ready      <none>   43s   v1.20.8
198.19.128.60   Ready      <none>   21s   v1.20.8
198.19.64.30    NotReady   <none>   6s    v1.20.8

198.19.128.59   Ready      <none>   49s   v1.20.8
198.19.128.60   Ready      <none>   27s   v1.20.8
198.19.64.30    NotReady   <none>   12s   v1.20.8

198.19.128.59   Ready      <none>   55s   v1.20.8
198.19.128.60   Ready      <none>   33s   v1.20.8
198.19.64.30    NotReady   <none>   18s   v1.20.8

198.19.128.59   Ready   <none>   61s   v1.20.8
198.19.128.60   Ready   <none>   39s   v1.20.8
198.19.64.30    Ready   <none>   24s   v1.20.8

Waiting for the SSM agent on the nodes to be ready for up to 5 minutes

* Phase 2b: change the update repository
Changing TUF repository endpoints via the Bottlerocket API to the following:
Metadata base url: https://blah.cloudfront.net/migration-testing/vmware-k8s-1.20/x86_64/
Targets base url: https://blah.cloudfront.net/migration-testing/targets/

* Phase 3: Initiate the update to Bottlerocket v1.2.0
Initiating upgrade to v1.2.0 on 'mi-07cfae4d4e9b25d5b mi-0e2c8b8f65a1fd3f3 mi-057bbeee76d209213'
Waiting for the instances to reboot into v1.2.0

* Phase 4: test the instances after the upgrade to version v1.2.0
Waiting for launched Bottlerocket nodes to become 'Ready' in 1-20-test cluster
198.19.128.59   Ready   <none>   2m32s   v1.20.9
198.19.128.60   Ready   <none>   2m10s   v1.20.9
198.19.64.30    Ready   <none>   115s    v1.20.9

Built aws-k8s-1.20 AMI and launched an instance with it. Node comes up fine without problem with a resolved hostname:

[ec2-user@ip-192-168-15-218 ~]$ apiclient -u /settings?keys=settings.network.hostname
{"network":{"hostname":"ip-192-168-15-218.us-west-2.compute.internal"}}

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

This removes the "ip-X-X-X-X" formatting of the IP address when we're
using it to set as our hostname. This fixes upgrades and downgrades to
and from versions of Bottlerocket that uses their plain IP as their
hostname when registering with the K8s control plane.
Copy link
Contributor

@tjkirch tjkirch left a comment

Choose a reason for hiding this comment

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

LGTM pending testing. 🍪

@etungsten etungsten marked this pull request as ready for review August 4, 2021 02:35
@etungsten etungsten requested a review from tjkirch August 4, 2021 02:35
tjkirch added a commit to tjkirch/bottlerocket that referenced this pull request Aug 4, 2021
Copy link
Contributor

@zmrow zmrow left a comment

Choose a reason for hiding this comment

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

🥗

@etungsten etungsten merged commit 3cd2da4 into bottlerocket-os:develop Aug 4, 2021
tjkirch added a commit that referenced this pull request Aug 4, 2021
Update CHANGELOG with hostname fix #1693
@etungsten etungsten deleted the hostname-format branch August 4, 2021 17:18
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.

5 participants