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 1809345: Add the machine's name as a known NodeInternalDNS #88

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions pkg/cloud/gcp/actuators/machine/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,13 @@ func (r *Reconciler) reconcileMachineWithCloudState(failedCondition *v1beta1.GCP
Type: corev1.NodeInternalDNS,
Address: fmt.Sprintf("%s.c.%s.internal", r.machine.Name, r.projectID),
})
// Add the machine's name as a known NodeInternalDNS because GCP platform
// provides search paths to resolve those.
// https://cloud.google.com/compute/docs/internal-dns#resolv.conf
nodeAddresses = append(nodeAddresses, corev1.NodeAddress{
Type: corev1.NodeInternalDNS,
Copy link
Member

Choose a reason for hiding this comment

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

do we need to also include this as NodeHostName?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really, this VM name is resolvable internal DNS name for the machine on GCP. We can't say what the hostname will be.

Address: r.machine.GetName(),
})

r.machine.Spec.ProviderID = &r.providerID
r.machine.Status.Addresses = nodeAddresses
Expand Down