Fix ipv6 ip allocation method for standard lb

This commit is contained in:
Anish Ramasekar
2019-09-11 11:17:57 -07:00
parent 001f2cd2b5
commit 5f46567262

View File

@@ -546,8 +546,12 @@ func (az *Cloud) ensurePublicIPExists(service *v1.Service, pipName string, domai
if ipv6 {
pip.PublicIPAddressVersion = network.IPv6
klog.V(2).Infof("service(%s): pip(%s) - creating as ipv6 for clusterIP:%v", serviceName, *pip.Name, service.Spec.ClusterIP)
// static allocation on IPv6 on Azure is not allowed
pip.PublicIPAddressPropertiesFormat.PublicIPAllocationMethod = network.Dynamic
if az.useStandardLoadBalancer() {
// standard sku must have static allocation method for ipv6
pip.PublicIPAddressPropertiesFormat.PublicIPAllocationMethod = network.Static
}
} else {
pip.PublicIPAddressVersion = network.IPv4
klog.V(2).Infof("service(%s): pip(%s) - creating as ipv4 for clusterIP:%v", serviceName, *pip.Name, service.Spec.ClusterIP)