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

replace ipv6 targetgroup feature flag #29555

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import com.yahoo.vespa.curator.Lock;
import com.yahoo.vespa.flags.BooleanFlag;
import com.yahoo.vespa.flags.Dimension;
import com.yahoo.vespa.flags.Flags;
import com.yahoo.vespa.flags.IntFlag;
import com.yahoo.vespa.flags.PermanentFlags;
import com.yahoo.vespa.hosted.provision.Node;
Expand Down Expand Up @@ -68,15 +67,15 @@ public class LoadBalancerProvisioner {
private final CuratorDb db;
private final LoadBalancerService service;
private final BooleanFlag deactivateRouting;
private final BooleanFlag ipv6AwsTargetGroups;
private final BooleanFlag enclaveWithoutWireguard;
private final IntFlag preProvisionPoolSize;

public LoadBalancerProvisioner(NodeRepository nodeRepository, LoadBalancerService service) {
this.nodeRepository = nodeRepository;
this.db = nodeRepository.database();
this.service = service;
this.deactivateRouting = PermanentFlags.DEACTIVATE_ROUTING.bindTo(nodeRepository.flagSource());
this.ipv6AwsTargetGroups = Flags.IPV6_AWS_TARGET_GROUPS.bindTo(nodeRepository.flagSource());
this.enclaveWithoutWireguard = PermanentFlags.ENCLAVE_WITHOUT_WIREGUARD.bindTo(nodeRepository.flagSource());
this.preProvisionPoolSize = PermanentFlags.PRE_PROVISIONED_LB_COUNT.bindTo(nodeRepository.flagSource());

// Read and write all load balancers to make sure they are stored in the latest version of the serialization format
Expand Down Expand Up @@ -425,7 +424,7 @@ private boolean inAccount(CloudAccount cloudAccount, LoadBalancer loadBalancer)
/** Find IP addresses reachable by the load balancer service */
private Set<String> reachableIpAddresses(Node node, CloudAccount cloudAccount) {
Set<String> reachable = new LinkedHashSet<>(node.ipConfig().primary());
boolean forceIpv6 = ipv6AwsTargetGroups.with(Dimension.CLOUD_ACCOUNT, cloudAccount.account()).value();
boolean forceIpv6 = !enclaveWithoutWireguard.with(Dimension.CLOUD_ACCOUNT, cloudAccount.account()).value();
var protocol = forceIpv6 ? LoadBalancerService.Protocol.ipv6 :
service.protocol(node.cloudAccount().isExclave(nodeRepository.zone()));
// Remove addresses unreachable by the load balancer service
Expand Down