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

Bug 1788583: Node resolver: support IPv6 service IPs #151

Merged
merged 1 commit into from Dec 19, 2019

Conversation

ironcladlou
Copy link
Contributor

This is a quick fix to support IPv6 service IPs when processing services
for /etc/hosts on the node. If a service exists but no A record is found,
check for an AAAA record, and if found, use that instead.

The assumption is that no A record will exist in the IPv6 environment,
which seems to hold for now.

This should enable the container runtime to resolve internal image
registry names for image pulls.

@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 13, 2019
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 13, 2019
This is a quick fix to support IPv6 service IPs when processing services
for /etc/hosts on the node. If a service exists but no A record is found,
check for an AAAA record, and if found, use that instead.

The assumption is that no A record will exist in the IPv6 environment,
which seems to hold for now.

This should enable the container runtime to resolve internal image
registry names for image pulls.
@russellb
Copy link
Member

seems OK to me

@openshift-ci-robot openshift-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 13, 2019
@ironcladlou
Copy link
Contributor Author

In a followup sometime during the release it might be nice to port this function into a subcommand of the Go binary, it's beyond hairy at this point.

@ironcladlou
Copy link
Contributor Author

Result on a node:

sh-4.2# cat /etc/hosts
# Kubernetes-managed hosts file (host network).
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
fd02::d2c8 image-registry.openshift-image-registry.svc image-registry.openshift-image-registry.svc.cluster.local # openshift-generated-node-resolver

@@ -90,10 +90,16 @@ spec:
declare -A svc_ips
for svc in "${services[@]}"; do
# Fetch service IP from cluster dns if present
ips=($(dig @"${NAMESERVER}" +short "${svc}.${CLUSTER_DOMAIN}"))
ips=($(dig -t A @"${NAMESERVER}" +short "${svc}.${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.

How about dig "@$NAMESERVER" +short A "${svc}.${CLUSTER_DOMAIN}" AAAA "${svc}.${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.

Although that prints an extra line: ";; Warning, extra type option", which we would need to ignore (or maybe we shouldn't ignore it...).

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 avoid the warning: dig "@$NAMESERVER" +short "${svc}.${CLUSTER_DOMAIN}" AAAA "${svc}.${CLUSTER_DOMAIN}".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Refactor the whole thing to Go in a followup?

@Miciah
Copy link
Contributor

Miciah commented Dec 16, 2019

/lgtm

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

/retest

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

14 similar comments
@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@ironcladlou
Copy link
Contributor Author

I think something's up with the patch on AWS — seeing this in the node resolver container logs:

cmp: EOF on /etc/hosts

(That's the entirety of the logs.)

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Dec 17, 2019
@Miciah
Copy link
Contributor

Miciah commented Dec 17, 2019

I think something's up with the patch on AWS — seeing this in the node resolver container logs:

cmp: EOF on /etc/hosts

(That's the entirety of the logs.)

That suggests that /etc/hosts was initially empty, the script updated it, and no further changes were needed. How about catting /etc/hosts before the while loop so we can see whether that is the case? It would also make the output clearer to change cmp to diff -u (the exit codes are the same, but diff additionally gives output).

Another possibility is that something else is writing to /etc/hosts.tmp and is racing with the script and sometimes truncating /etc/hosts.tmp between when the script writes to it and when the script copies it over /etc/hosts. This seems unlikely, and catting /etc/hosts on startup would help us to rule that possibility out.

Edit: My last paragraph doesn't make sense. Substitute /etc/hosts for /etc/hosts.tmp (and substitute "when the script copies it to /etc/hosts.tmp" for "when the script writes to it") and it does.

@ironcladlou
Copy link
Contributor Author

Now I think we might be experiencing collateral damage from other CI issues. Need to go over the latest build cop communications, etc.

@Miciah
Copy link
Contributor

Miciah commented Dec 18, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 18, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ironcladlou, Miciah

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-bot
Copy link
Contributor

/retest

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

1 similar comment
@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 dc11895 into openshift:master Dec 19, 2019
@russellb
Copy link
Member

/cherry-pick release-4.3

@ironcladlou FYI

@openshift-cherrypick-robot

@russellb: new pull request created: #152

In response to this:

/cherry-pick release-4.3

@ironcladlou FYI

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.

@ironcladlou ironcladlou changed the title Node resolver: support IPv6 service IPs Bug 1788583: Node resolver: support IPv6 service IPs Jan 7, 2020
@openshift-ci-robot
Copy link
Contributor

@ironcladlou: Bugzilla bug 1788583 is in an unrecognized state (MODIFIED) and will not be moved to the MODIFIED state.

In response to this:

Bug 1788583: Node resolver: support IPv6 service IPs

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.

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. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants