cluster-api-provider-aws
cluster-api-provider-aws copied to clipboard
Consider reflecting VPC DHCP dns options in machine status DNS addresses
/kind bug
What steps did you take and what happened:
Have a VPC with custom DNS DHCP options, e.g domainName agl.com https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html
Machine addresses do not reflect this additional DNS addresses as the node would do via the controller manager cloud provider https://github.com/kubernetes/kubernetes/blob/6b13befdfb3e30862dc86fd1c7739f58901f0bae/staging/src/k8s.io/legacy-cloud-providers/aws/aws.go#L1400-L1479: Node:
status:
addresses:
- address: 10.0.137.6
type: InternalIP
- address: ip-10-0-137-6.agl.com
type: Hostname
- address: ip-10-0-137-6.agl.com
type: InternalDNS
What did you expect to happen: We might want to consider honour this source, include the additional DNS addresses and be more consistent with cloud provider.
Accessing the metadata though would require to run the aws machine controller pod in the host network. Alternatively we could consider infer this information from the regular aws API and construct the ips known format, the likes of:
vpc, err := r.awsClient.DescribeVpcs(&ec2.DescribeVpcsInput{
VpcIds: []*string{newestInstance.VpcId},
})
if err != nil {
return err
}
dhcp, err := r.awsClient.DescribeDHCPOptions(&ec2.DescribeDhcpOptionsInput{
DhcpOptionsIds: []*string{vpc.Vpcs[0].DhcpOptionsId},
})
if err != nil {
return err
}
klog.Infof("DHCP %+v", dhcp.DhcpOptions[0].DhcpConfigurations[0])
for _, i := range dhcp.DhcpOptions[0].DhcpConfigurations {
if *i.Key == "domain-name" {
klog.Infof("Domain value %v", i.Values)
}
}
// construct additional DNS addresses
Anything else you would like to add: At some point having DHCP options awareness and reflecting it on the machine.status addresses might come in handy for scenarios where users wanting to adopt pre-existing vpcs.
Related to https://github.com/kubernetes-sigs/cluster-api-provider-aws/issues/70#issuecomment-614057170
Environment:
- Cluster-api-provider-aws version:
- Kubernetes version: (use
kubectl version): - OS (e.g. from
/etc/os-release):
/priority important-longterm
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale
/lifecycle frozen
/help
@detiber: This request has been marked as needing help from a contributor.
Please ensure the request meets the requirements listed here.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.
In response to this:
/help
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.
@enxebre this is ancient now, do we want to get this in for v1alpha4?
/remove-lifecycle frozen
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale - Mark this issue or PR as rotten with
/lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
Closing this due to age /close
@enxebre @richardcase Would it make sense to re-open this issue now that it appears a fix for it is in development?
This issue is currently awaiting triage.
If CAPA/CAPI contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.
The triage/accepted label can be added by org members by writing /triage accepted in a comment.
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.
Hey @enxebre, @ron1 I've fixed this Issue in this PR https://github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4841. could we close this?
/closed by https://github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4841