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

[upi][vsphere] applicable static IP changes #1480

Closed
wants to merge 5 commits into from
Closed

[upi][vsphere] applicable static IP changes #1480

wants to merge 5 commits into from

Conversation

dav1x
Copy link
Contributor

@dav1x dav1x commented Mar 27, 2019

  1. Adds network module to allocate static IP addresses from machine_cidr
  2. Adds ignition config to set static IP address.
  3. Add systemd unit file to reboot the VM on firstboot when idle to apply static IP.

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dav1x
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: hardys

If they are not already assigned, you can assign the PR to them by writing /assign @hardys in a comment when ready.

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-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 27, 2019
@abhinavdahiya abhinavdahiya changed the title applicable static IP changes [upi][vsphere] applicable static IP changes Mar 27, 2019
@openshift-ci-robot
Copy link
Contributor

@dav1x: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/prow/shellcheck f48896e link /test shellcheck

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

for ETCD in 0 1 2
do

DNS_RECORDS+="$(dig +short etcd-$ETCD.${cluster_domain}) "
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mind rebuilding on top of #1492? Then we can search for control-plane-{0,1,2}.${cluster_domain} and compute-{0,1,2}.${cluster_domain} instead of etcd.

w_count=0

# check cluster_domain DNS first
for ETCD in 0 1 2
Copy link
Contributor

Choose a reason for hiding this comment

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

The iteration should not be hard-coded to 0 1 2. It needs to be based on the number of control-plane instances (and the number of compute instances).


query = {
cidr = "${var.machine_cidr}"
master_count = "${var.master_count}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Use the terms control-plane and compute instead of master and worker.

then
worker_ips+="$IPADDR "
w_count=$((w_count+1))
elif [[ $bs_count -eq 1 ]] && [[ $m_count -eq $master_count ]] && [[ $w_count -eq $worker_count ]]
Copy link
Contributor

Choose a reason for hiding this comment

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

This should not be in an elif. It should be its own if. Otherwise, it will need to do an additional ping after finding all of the IP addresses. This would cause it to fail if the last IP address in the block is one that is going to be assigned.

My preference would be to break out of the for loop when we find the last compute IP address. And then put the jq after the for loop.

w_count=$((w_count+1))
elif [[ $bs_count -eq 1 ]] && [[ $m_count -eq $master_count ]] && [[ $w_count -eq $worker_count ]]
then
jq -n \
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we do this without requiring jq?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry. I glossed over the use of jq earlier in the script. We can leave the jq here.

}

output "bootstrap_ip" {
value = "${split(" ", trimspace(data.external.ping.result.bootstrap_ip))}"
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer to keep this as a string instead of a list, unless it is terribly difficult otherwise. Would it work to just omit the split?

@dav1x
Copy link
Contributor Author

dav1x commented Mar 29, 2019

Closed in favor of : #1502

@dav1x dav1x closed this Mar 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

4 participants