mirror of https://github.com/kubernetes/kops.git
Merge pull request #12878 from olemarkus/ipv6-protokube
If RBN, use IPv6 address instead of IPv4
This commit is contained in:
commit
1c9d374140
|
|
@ -31,6 +31,7 @@ import (
|
|||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
"github.com/aws/aws-sdk-go/service/ec2"
|
||||
"k8s.io/klog/v2"
|
||||
|
||||
"k8s.io/kops/protokube/pkg/etcd"
|
||||
"k8s.io/kops/protokube/pkg/gossip"
|
||||
gossipaws "k8s.io/kops/protokube/pkg/gossip/aws"
|
||||
|
|
@ -125,7 +126,11 @@ func (a *AWSVolumes) discoverTags() error {
|
|||
|
||||
a.clusterTag = clusterID
|
||||
|
||||
a.internalIP = net.ParseIP(aws.StringValue(instance.PrivateIpAddress))
|
||||
if *instance.PrivateDnsNameOptions.HostnameType == ec2.HostnameTypeResourceName {
|
||||
a.internalIP = net.ParseIP(aws.StringValue(instance.Ipv6Address))
|
||||
} else {
|
||||
a.internalIP = net.ParseIP(aws.StringValue(instance.PrivateIpAddress))
|
||||
}
|
||||
if a.internalIP == nil {
|
||||
return fmt.Errorf("Internal IP not found on this instance (%q)", a.instanceId)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue