-
Notifications
You must be signed in to change notification settings - Fork 29
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
System Test, RDS Core: metalLB traffic segregation test suite was added #392
base: main
Are you sure you want to change the base?
System Test, RDS Core: metalLB traffic segregation test suite was added #392
Conversation
2c2a2bd
to
d420990
Compare
f072214
to
e230adf
Compare
@yprokule PTAL |
c764ac0
to
e0a8667
Compare
|
||
glog.V(100).Infof("Setting Replicas count") | ||
|
||
replicasCnt := len(scheduleOnHosts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather expose replica count as a parameter to cover a use case where a pod(s) can ran on multiple nodes but different amount of replicas is required (for e.g. a pod could run on node-x, node-y, node-z, but app requires only 2 instances).
Anyway that's only a suggestion so leaving it up to U
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry, but I'm not sure it's a good idea. different nodes/pods count is not exactly our case.
Also, the question is, why provide more nodes than you need pods?
In our case, for both tcpdump and traceroute scenarios, we provide precisely the nodes list where we need to deploy the support tools pods; I mean, we need to monitor a specific node => we need a pod on this node.
I would leave it like this right now if you don't mind.
If we have any future use cases with different requirements, we can modify it. But without a specific proposal for different nodes and pod counts, it's hard to understand how it would be better to change it.
Skip("One of the capture interfaces not specified or are empty") | ||
} | ||
|
||
By("Ensure LB application deployment created for the first bgp route") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: BGP is abbreviation so should user uppercase
By("Ensure LB application deployment created for the first bgp route") | |
By("Ensure LB application deployment created for the first BGP route") |
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Searching for pods in %q namespace", | ||
RDSCoreConfig.MetalLBLoadBalancerOneNamespace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Searching for pods in %q namespace", | |
RDSCoreConfig.MetalLBLoadBalancerOneNamespace) | |
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Searching for pods in %q namespace with label %q", | |
RDSCoreConfig.MetalLBLoadBalancerOneNamespace, lbDeploymentLabel) |
|
||
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Getting node name for the loadbalancer one application") | ||
|
||
lbOneNodeName = lbOnePodsList[0].Object.Spec.NodeName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if application expects only 1 pod - I suggest adding extra check that there's exactly one pod running
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Searching for pods in %q namespace", | ||
RDSCoreConfig.MetalLBLoadBalancerTwoNamespace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Searching for pods in %q namespace", | |
RDSCoreConfig.MetalLBLoadBalancerTwoNamespace) | |
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Searching for pods in %q namespace with label %q", | |
RDSCoreConfig.MetalLBLoadBalancerTwoNamespace, lbDeploymentLabel) |
|
||
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Getting node name for the loadbalancer two application") | ||
|
||
lbTwoNodeName = lbTwoPodsList[0].Object.Spec.NodeName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto, if only 1 pod expected - then worth checking only 1 pod exists
captureScript, | ||
[]string{lbOneNodeName}) | ||
Expect(err).ToNot(HaveOccurred(), | ||
fmt.Sprintf("Failed to create supporttools deployment for the node %v in namespace %s from image %s: %v", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Sprintf("Failed to create supporttools deployment for the node %v in namespace %s from image %s: %v", | |
fmt.Sprintf("Failed to create tcpdump deployment for the node %v in namespace %s from image %s: %v", |
Expect(len(stPodsList)).ToNot(Equal(0), "No tcpdump pods found in namespace %s", | ||
stNamespace) | ||
|
||
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Found %d 'traceRoute' pods", len(stPodsList)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Found %d 'traceRoute' pods", len(stPodsList)) | |
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Found %d 'tcpdump' pods", len(stPodsList)) |
By("Check the traffic flows for the first FRR through the expected interface") | ||
|
||
for _, _pod := range stPodsList { | ||
searchString := "10.18.126.21" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this probably should be parameterized
for _, _pod := range stPodsList { | ||
searchString := "10.18.126.21" | ||
|
||
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Making sure that the traffic flows for the first FRR "+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it be from
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Making sure that the traffic flows for the first FRR "+ | |
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Making sure that the traffic flows from the first FRR "+ |
captureScript, | ||
[]string{lbTwoNodeName}) | ||
Expect(err).ToNot(HaveOccurred(), | ||
fmt.Sprintf("Failed to create supporttools deployment for the node %v in namespace %s from image %s: %v", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Sprintf("Failed to create supporttools deployment for the node %v in namespace %s from image %s: %v", | |
fmt.Sprintf("Failed to create tcpdump deployment for the node %v in namespace %s from image %s: %v", |
Expect(len(stPodsList)).ToNot(Equal(0), "No tcpdump pods found in namespace %s", | ||
stNamespace) | ||
|
||
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Found %d 'traceRoute' pods", len(stPodsList)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Found %d 'traceRoute' pods", len(stPodsList)) | |
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Found %d 'tcpdump' pods", len(stPodsList)) |
By("Check the traffic flows for the second FRR through the expected interface") | ||
|
||
for _, _pod := range stPodsList { | ||
searchString := "10.18.124.21" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto, isn't this environment specific?
for _, _pod := range stPodsList { | ||
searchString := "10.18.124.21" | ||
|
||
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Making sure that the traffic flows for the second FRR "+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto, from ?
Skip("One of the capture interfaces not specified or are empty") | ||
} | ||
|
||
By("Ensure LB application deployment created for the first bgp route") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By("Ensure LB application deployment created for the first bgp route") | |
By("Ensure LB application deployment created for the first BGP route") |
Skip("FRR One Load Balance app not found deployed") | ||
} | ||
|
||
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Getting node name for the loadbalancer one application") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where's the code to get the node name? assume smth like:
lbOneNodeName = lbOnePodsList[0].Object.Spec.NodeName
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Searching for pods in %q namespace", | ||
RDSCoreConfig.MetalLBLoadBalancerTwoNamespace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Searching for pods in %q namespace", | |
RDSCoreConfig.MetalLBLoadBalancerTwoNamespace) | |
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Searching for pods in %q namespace with %q label", | |
RDSCoreConfig.MetalLBLoadBalancerTwoNamespace, lbDeploymentLabel) |
|
||
glog.V(rdscoreparams.RDSCoreLogLevel).Infof("Getting node name for the loadbalancer two application") | ||
|
||
lbTwoNodeName = lbTwoPodsList[0].Object.Spec.NodeName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto, what happens if 2 pods found? is it safe to ignore all other pods and always use 1st one?
glog.V(100).Infof(fmt.Sprintf("the IP routes %s were found on the FRR container %s: %s", | ||
lbIP, containerName, result)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the command is show ip(v6) route bgp
so not sure why it's stated that route for requested IP address was present in the output of the aforementioned command:
glog.V(100).Infof(fmt.Sprintf("the IP routes %s were found on the FRR container %s: %s", | |
lbIP, containerName, result)) | |
glog.V(100).Infof(fmt.Sprintf("BGP routes were found in the FRR container %s\n: %s", | |
containerName, result)) |
}) | ||
|
||
if err != nil { | ||
glog.V(100).Infof("Failed to verify IP route bgp on the FRR container %s: %v", containerName, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
glog.V(100).Infof("Failed to verify IP route bgp on the FRR container %s: %v", containerName, err) | |
glog.V(100).Infof("Failed to verify BGP routes in the FRR container %s: %v", containerName, err) |
if err != nil { | ||
glog.V(100).Infof("Failed to verify IP route bgp on the FRR container %s: %v", containerName, err) | ||
|
||
return fmt.Errorf("failed to verify IP route bgp on the FRR container %s: %w", containerName, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Errorf("failed to verify IP route bgp on the FRR container %s: %w", containerName, err) | |
return fmt.Errorf("failed to verify BGP routes in the FRR container %s: %w", containerName, err) |
} | ||
|
||
if !strings.Contains(result, lbIP) { | ||
glog.V(100).Infof("No IP route bgp %s on the FRR container %s was found", lbIP, containerName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
glog.V(100).Infof("No IP route bgp %s on the FRR container %s was found", lbIP, containerName) | |
glog.V(100).Infof("No BGP route %s in the FRR container %s was found", lbIP, containerName) |
if !strings.Contains(result, lbIP) { | ||
glog.V(100).Infof("No IP route bgp %s on the FRR container %s was found", lbIP, containerName) | ||
|
||
return fmt.Errorf("no IP route bgp %s on the FRR container %s was found", lbIP, containerName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Errorf("no IP route bgp %s on the FRR container %s was found", lbIP, containerName) | |
return fmt.Errorf("no BGP route %s in the FRR container %s was found", lbIP, containerName) |
time.Second*3, | ||
true, | ||
func(ctx context.Context) (bool, error) { | ||
for i := 0; i < 3; i++ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the function is already retried so why this extra for loop?
No description provided.