-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
connectivity: add endpointslice clustermesh sync test
This adds endpointslice synchronization testing inside a clustermesh. It does that by checking that we can get a DNS answer with a global headless service with endpointslice synchronization enabled across two clusters. Testing it via DNS ensures that the created EndpointSlice are correctly linked to the headless service. Signed-off-by: Arthur Outhenin-Chalandre <[email protected]>
- Loading branch information
1 parent
6f49f30
commit 7d82a98
Showing
5 changed files
with
95 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright Authors of Cilium | ||
|
||
package tests | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/cilium/cilium-cli/connectivity/check" | ||
"github.com/cilium/cilium-cli/utils/features" | ||
|
||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
func EndpointSliceMesh() check.Scenario { | ||
return &endpointSliceMesh{} | ||
} | ||
|
||
type endpointSliceMesh struct{} | ||
|
||
func (s *endpointSliceMesh) Name() string { | ||
return "endpointslice-mesh" | ||
} | ||
|
||
func (s *endpointSliceMesh) Run(ctx context.Context, t *check.Test) { | ||
ct := t.Context() | ||
|
||
// Ping hosts (pod to host connectivity). Should not get masqueraded with egress IP | ||
i := 0 | ||
for _, client := range ct.ClientPods() { | ||
client := client // copy to avoid memory aliasing when using reference | ||
|
||
kubeService, err := ct.K8sClient().GetService(ctx, ct.Params().TestNamespace, "echo-other-node-headless", metav1.GetOptions{}) | ||
if err != nil { | ||
t.Fatal("Cannot get echo-other-node-headless service") | ||
} | ||
service := check.Service{Service: kubeService} | ||
fmt.Println("todo", kubeService) | ||
|
||
t.NewAction(s, fmt.Sprintf("dig-%d", i), &client, service, features.IPFamilyV4).Run(func(a *check.Action) { | ||
a.ExecInPod(ctx, ct.DigCommandService(service)) | ||
}) | ||
i++ | ||
} | ||
} |