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

Make CRR standalone workload #750

Merged
merged 1 commit into from
Mar 16, 2022
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions connectivity/check/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ type Parameters struct {
SkipIPCacheCheck bool
Perf bool
PerfDuration time.Duration
PerfCRR bool
jtaleric marked this conversation as resolved.
Show resolved Hide resolved
PerfSamples int
CiliumBaseVersion string
}
Expand Down
16 changes: 10 additions & 6 deletions connectivity/tests/perfpod.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,21 @@ func (s *netPerfPodtoPod) Name() string {
func (s *netPerfPodtoPod) Run(ctx context.Context, t *check.Test) {
samples := t.Context().Params().PerfSamples
duration := t.Context().Params().PerfDuration
crr := t.Context().Params().PerfCRR
for _, c := range t.Context().PerfClientPods() {
c := c
for _, server := range t.Context().PerfServerPod() {
action := t.NewAction(s, "iperf-tcp", &c, server)
action := t.NewAction(s, "netperf", &c, server)
twpayne marked this conversation as resolved.
Show resolved Hide resolved
action.CollectFlows = false
action.Run(func(a *check.Action) {
netperf(ctx, server.Pod.Status.PodIP, c.Pod.Name, "TCP_RR", a, t.Context().PerfResults, samples, duration)
netperf(ctx, server.Pod.Status.PodIP, c.Pod.Name, "TCP_CRR", a, t.Context().PerfResults, samples, duration)
netperf(ctx, server.Pod.Status.PodIP, c.Pod.Name, "TCP_STREAM", a, t.Context().PerfResults, samples, duration)
netperf(ctx, server.Pod.Status.PodIP, c.Pod.Name, "UDP_RR", a, t.Context().PerfResults, samples, duration)
netperf(ctx, server.Pod.Status.PodIP, c.Pod.Name, "UDP_STREAM", a, t.Context().PerfResults, samples, duration)
if crr {
netperf(ctx, server.Pod.Status.PodIP, c.Pod.Name, "TCP_CRR", a, t.Context().PerfResults, 1, 30)
} else {
netperf(ctx, server.Pod.Status.PodIP, c.Pod.Name, "TCP_RR", a, t.Context().PerfResults, samples, duration)
netperf(ctx, server.Pod.Status.PodIP, c.Pod.Name, "TCP_STREAM", a, t.Context().PerfResults, samples, duration)
netperf(ctx, server.Pod.Status.PodIP, c.Pod.Name, "UDP_RR", a, t.Context().PerfResults, samples, duration)
netperf(ctx, server.Pod.Status.PodIP, c.Pod.Name, "UDP_STREAM", a, t.Context().PerfResults, samples, duration)
}
})
}
}
Expand Down
8 changes: 2 additions & 6 deletions internal/cli/cmd/connectivity.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,7 @@ func newCmdConnectivityTest() *cobra.Command {

// Instantiate the test harness.
cc, err := check.NewConnectivityTest(k8sClient, params)
if params.PerfSamples > 3 {
cc.Warn("Having Performance Samples > 3 can cause issues")
}
if params.PerfDuration > 30*time.Second {
cc.Warn("Having Performance Duration > 30s can cause issues")
}

if err != nil {
return err
}
Expand Down Expand Up @@ -130,6 +125,7 @@ func newCmdConnectivityTest() *cobra.Command {
cmd.Flags().BoolVar(&params.Perf, "perf", false, "Run network Performance tests")
cmd.Flags().DurationVar(&params.PerfDuration, "perf-duration", 10*time.Second, "Duration for the Performance test to run")
cmd.Flags().IntVar(&params.PerfSamples, "perf-samples", 1, "Number of Performance samples to capture (how many times to run each test)")
cmd.Flags().BoolVar(&params.PerfCRR, "perf-crr", false, "Run Netperf CRR Test. --perf-samples and --perf-duration ignored")
cmd.Flags().MarkHidden("skip-ip-cache-check")
cmd.Flags().StringVar(&params.CiliumBaseVersion, "base-version", defaults.Version,
"Specify the base Cilium version for configuration purpose in case image tag doesn't indicate the actual Cilium version")
Expand Down