cluster-api-provider-aws icon indicating copy to clipboard operation
cluster-api-provider-aws copied to clipboard

Consider reflecting VPC DHCP dns options in machine status DNS addresses

Open enxebre opened this issue 5 years ago • 13 comments
trafficstars

/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):

enxebre avatar Apr 15 '20 14:04 enxebre

/priority important-longterm

detiber avatar Apr 20 '20 17:04 detiber

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

fejta-bot avatar Jul 19 '20 17:07 fejta-bot

/lifecycle frozen

detiber avatar Jul 20 '20 16:07 detiber

/help

detiber avatar Jul 20 '20 16:07 detiber

@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.

k8s-ci-robot avatar Jul 20 '20 16:07 k8s-ci-robot

@enxebre this is ancient now, do we want to get this in for v1alpha4?

randomvariable avatar Mar 11 '21 18:03 randomvariable

/remove-lifecycle frozen

richardcase avatar Jul 08 '22 22:07 richardcase

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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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

k8s-triage-robot avatar Oct 06 '22 23:10 k8s-triage-robot

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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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

k8s-triage-robot avatar Nov 05 '22 23:11 k8s-triage-robot

Closing this due to age /close

enxebre avatar Jun 30 '23 12:06 enxebre

@enxebre @richardcase Would it make sense to re-open this issue now that it appears a fix for it is in development?

ron1 avatar Mar 07 '24 15:03 ron1

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.

k8s-ci-robot avatar Mar 08 '24 09:03 k8s-ci-robot

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?

jparrill avatar Apr 01 '24 10:04 jparrill

/closed by https://github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4841

enxebre avatar Jun 04 '24 12:06 enxebre