From 8a26a1428c78d3bf91344e9a185c8e388090a34c Mon Sep 17 00:00:00 2001 From: Oleksandr Krutko Date: Wed, 24 Sep 2025 23:49:20 +0300 Subject: [PATCH 1/8] add option allows multiple Pods creation Signed-off-by: Oleksandr Krutko --- cmd/podman/kube/play.go | 3 +++ pkg/domain/entities/play.go | 2 ++ pkg/domain/infra/abi/play.go | 46 +++++++++++++++++++++++------------- 3 files changed, 35 insertions(+), 16 deletions(-) diff --git a/cmd/podman/kube/play.go b/cmd/podman/kube/play.go index 04b0cd01e4d..ae6fa3c7972 100644 --- a/cmd/podman/kube/play.go +++ b/cmd/podman/kube/play.go @@ -210,6 +210,9 @@ func playFlags(cmd *cobra.Command) { exitFlagName := "service-exit-code-propagation" flags.StringVar(&playOptions.ExitCodePropagation, exitFlagName, "", "Exit-code propagation of the service container") _ = flags.MarkHidden(exitFlagName) + + multiplePods := "multiple-pods" + flags.BoolVar(&playOptions.MultiplePods, multiplePods, false, "Allows creating of multiple Pods") } } diff --git a/pkg/domain/entities/play.go b/pkg/domain/entities/play.go index 9df0dbda468..fd9eb71a829 100644 --- a/pkg/domain/entities/play.go +++ b/pkg/domain/entities/play.go @@ -83,6 +83,8 @@ type PlayKubeOptions struct { SystemContext *types.SystemContext // Do not prefix container name with pod name NoPodPrefix bool + // MultiplePods - allows creating of multiple Pods + MultiplePods bool } // PlayKubePod represents a single pod and associated containers created by play kube diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index bf41e73a440..959cbecc26e 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -276,6 +276,7 @@ func (ic *ContainerEngine) PlayKube(ctx context.Context, body io.Reader, options ipIndex := 0 var configMaps []v1.ConfigMap + var numReplicas int32 ranContainers := false // set the ranContainers bool to true if at least one container was successfully started. @@ -404,15 +405,36 @@ func (ic *ContainerEngine) PlayKube(ctx context.Context, body io.Reader, options return nil, fmt.Errorf("unable to read YAML as Kube Deployment: %w", err) } - r, proxies, err := ic.playKubeDeployment(ctx, &deploymentYAML, options, &ipIndex, configMaps, serviceContainer) - if err != nil { - return nil, err + numReplicas = 1 + if deploymentYAML.Spec.Replicas != nil { + numReplicas = *deploymentYAML.Spec.Replicas } - notifyProxies = append(notifyProxies, proxies...) - report.Pods = append(report.Pods, r.Pods...) + if numReplicas > 1 && options.MultiplePods { + for i := numReplicas; i != 0; i-- { + podName := fmt.Sprintf("%s-pod-%d", deploymentYAML.ObjectMeta.Name, i) + r, proxies, err := ic.playKubeDeployment(ctx, &deploymentYAML, options, &ipIndex, configMaps, serviceContainer, podName) + if err != nil { + return nil, err + } + notifyProxies = append(notifyProxies, proxies...) + + report.Pods = append(report.Pods, r.Pods...) + setRanContainers(r) + } + } else if numReplicas > 1 && !options.MultiplePods { + logrus.Warnf("Limiting replica count to 1, more than one replica is not supported by Podman") + podName := fmt.Sprintf("%s-pod", deploymentYAML.ObjectMeta.Name) + r, proxies, err := ic.playKubeDeployment(ctx, &deploymentYAML, options, &ipIndex, configMaps, serviceContainer, podName) + if err != nil { + return nil, err + } + notifyProxies = append(notifyProxies, proxies...) + + report.Pods = append(report.Pods, r.Pods...) + setRanContainers(r) + } validKinds++ - setRanContainers(r) case "Job": var jobYAML v1.Job @@ -563,11 +585,10 @@ func (ic *ContainerEngine) playKubeDaemonSet(ctx context.Context, daemonSetYAML return &report, proxies, nil } -func (ic *ContainerEngine) playKubeDeployment(ctx context.Context, deploymentYAML *v1apps.Deployment, options entities.PlayKubeOptions, ipIndex *int, configMaps []v1.ConfigMap, serviceContainer *libpod.Container) (*entities.PlayKubeReport, []*notifyproxy.NotifyProxy, error) { +func (ic *ContainerEngine) playKubeDeployment(ctx context.Context, deploymentYAML *v1apps.Deployment, options entities.PlayKubeOptions, ipIndex *int, configMaps []v1.ConfigMap, serviceContainer *libpod.Container, podName string) (*entities.PlayKubeReport, []*notifyproxy.NotifyProxy, error) { var ( deploymentName string podSpec v1.PodTemplateSpec - numReplicas int32 report entities.PlayKubeReport ) @@ -575,16 +596,9 @@ func (ic *ContainerEngine) playKubeDeployment(ctx context.Context, deploymentYAM if deploymentName == "" { return nil, nil, errors.New("deployment does not have a name") } - numReplicas = 1 - if deploymentYAML.Spec.Replicas != nil { - numReplicas = *deploymentYAML.Spec.Replicas - } - if numReplicas > 1 { - logrus.Warnf("Limiting replica count to 1, more than one replica is not supported by Podman") - } + podSpec = deploymentYAML.Spec.Template - podName := fmt.Sprintf("%s-pod", deploymentName) podReport, proxies, err := ic.playKubePod(ctx, podName, &podSpec, options, ipIndex, deploymentYAML.Annotations, configMaps, serviceContainer) if err != nil { return nil, nil, fmt.Errorf("encountered while bringing up pod %s: %w", podName, err) From fcb054e1d8ec0541dbce2b4e21ec1116ea90e704 Mon Sep 17 00:00:00 2001 From: Oleksandr Krutko Date: Sat, 27 Sep 2025 17:19:27 +0300 Subject: [PATCH 2/8] add a publish ports logic for multiple pods Signed-off-by: Oleksandr Krutko --- pkg/domain/infra/abi/play.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index 959cbecc26e..82a4a5ffb5a 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -411,7 +411,15 @@ func (ic *ContainerEngine) PlayKube(ctx context.Context, body io.Reader, options } if numReplicas > 1 && options.MultiplePods { + if len(options.PublishPorts) > 0 && len(options.PublishPorts) != int(numReplicas) { + return nil, fmt.Errorf("number of Pod replics aren't equal to number of published ports: %d replicas, %d published ports", numReplicas, len(options.PublishPorts)) + } + + var portToPublish []string = make([]string, numReplicas) + copy(portToPublish, options.PublishPorts) + options.PublishPorts = make([]string, 1) for i := numReplicas; i != 0; i-- { + options.PublishPorts[0] = (portToPublish[(len(portToPublish) - int(i))]) podName := fmt.Sprintf("%s-pod-%d", deploymentYAML.ObjectMeta.Name, i) r, proxies, err := ic.playKubeDeployment(ctx, &deploymentYAML, options, &ipIndex, configMaps, serviceContainer, podName) if err != nil { @@ -422,8 +430,10 @@ func (ic *ContainerEngine) PlayKube(ctx context.Context, body io.Reader, options report.Pods = append(report.Pods, r.Pods...) setRanContainers(r) } - } else if numReplicas > 1 && !options.MultiplePods { - logrus.Warnf("Limiting replica count to 1, more than one replica is not supported by Podman") + } else { + if numReplicas > 1 { + logrus.Warnf("Limiting replica count to 1, more than one replica is not supported by Podman") + } podName := fmt.Sprintf("%s-pod", deploymentYAML.ObjectMeta.Name) r, proxies, err := ic.playKubeDeployment(ctx, &deploymentYAML, options, &ipIndex, configMaps, serviceContainer, podName) if err != nil { From f3e4dcda05fa09a3e5dd8d4573f62fbfed2e7d40 Mon Sep 17 00:00:00 2001 From: Oleksandr Krutko Date: Sat, 27 Sep 2025 21:20:24 +0300 Subject: [PATCH 3/8] fix linter's warning Signed-off-by: Oleksandr Krutko --- pkg/domain/infra/abi/play.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index 82a4a5ffb5a..edd4436a7a9 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -415,7 +415,7 @@ func (ic *ContainerEngine) PlayKube(ctx context.Context, body io.Reader, options return nil, fmt.Errorf("number of Pod replics aren't equal to number of published ports: %d replicas, %d published ports", numReplicas, len(options.PublishPorts)) } - var portToPublish []string = make([]string, numReplicas) + var portToPublish = make([]string, numReplicas) copy(portToPublish, options.PublishPorts) options.PublishPorts = make([]string, 1) for i := numReplicas; i != 0; i-- { From 15a7300175e0d04d305cc648dbc1158e98e84466 Mon Sep 17 00:00:00 2001 From: Oleksandr Krutko Date: Mon, 6 Oct 2025 21:20:49 +0300 Subject: [PATCH 4/8] rename replica option, improve a loop, add manual page Signed-off-by: Oleksandr Krutko --- cmd/podman/kube/play.go | 4 ++-- docs/source/markdown/podman-kube-play.1.md.in | 6 ++++++ pkg/domain/entities/play.go | 2 ++ pkg/domain/infra/abi/play.go | 10 +++++----- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/cmd/podman/kube/play.go b/cmd/podman/kube/play.go index ae6fa3c7972..e984361c3b5 100644 --- a/cmd/podman/kube/play.go +++ b/cmd/podman/kube/play.go @@ -211,8 +211,8 @@ func playFlags(cmd *cobra.Command) { flags.StringVar(&playOptions.ExitCodePropagation, exitFlagName, "", "Exit-code propagation of the service container") _ = flags.MarkHidden(exitFlagName) - multiplePods := "multiple-pods" - flags.BoolVar(&playOptions.MultiplePods, multiplePods, false, "Allows creating of multiple Pods") + replicas := "replicas" + flags.BoolVar(&playOptions.Replicas, replicas, false, "Replicas allows multiple Pods creation") } } diff --git a/docs/source/markdown/podman-kube-play.1.md.in b/docs/source/markdown/podman-kube-play.1.md.in index 9876af730f8..5e9fa797ca7 100644 --- a/docs/source/markdown/podman-kube-play.1.md.in +++ b/docs/source/markdown/podman-kube-play.1.md.in @@ -271,6 +271,8 @@ Define or override a port definition in the YAML file. The lists of ports in the YAML file and the command line are merged. Matching is done by using the **containerPort** field. If **containerPort** exists in both the YAML file and the option, the latter takes precedence. +In case this options is used with **--replicas** option then number of published ports should be equal to the number of replicas in container spec, e.g. Deployment.spec.replicas is 3, then **--publish** is set to "8080:80,8081:80,8082:80" + #### **--publish-all** Setting this option to `true` will expose all ports to the host, @@ -289,6 +291,10 @@ Suppress output information when pulling images Tears down the pods created by a previous run of `kube play` and recreates the pods. This option is used to keep the existing pods up to date based upon the Kubernetes YAML. +#### **--replicas** + +Only one Pod replica is created by default, despite the desired number of Pods in the Kubernetes Deployment resource. This setting overrides the default behavior, allowing the desired number of Pods to be created. + #### **--seccomp-profile-root**=*path* Directory path for seccomp profiles (default: "/var/lib/kubelet/seccomp"). (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines) diff --git a/pkg/domain/entities/play.go b/pkg/domain/entities/play.go index fd9eb71a829..6f2ee54abf7 100644 --- a/pkg/domain/entities/play.go +++ b/pkg/domain/entities/play.go @@ -85,6 +85,8 @@ type PlayKubeOptions struct { NoPodPrefix bool // MultiplePods - allows creating of multiple Pods MultiplePods bool + // Replicas allows multiple Pods creation + Replicas bool } // PlayKubePod represents a single pod and associated containers created by play kube diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index edd4436a7a9..6286be7013d 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -410,16 +410,16 @@ func (ic *ContainerEngine) PlayKube(ctx context.Context, body io.Reader, options numReplicas = *deploymentYAML.Spec.Replicas } - if numReplicas > 1 && options.MultiplePods { + if numReplicas > 1 && options.Replicas { if len(options.PublishPorts) > 0 && len(options.PublishPorts) != int(numReplicas) { - return nil, fmt.Errorf("number of Pod replics aren't equal to number of published ports: %d replicas, %d published ports", numReplicas, len(options.PublishPorts)) + return nil, fmt.Errorf("number of Pod replics aren't equal to the number of published ports: %d replicas, %d published ports", numReplicas, len(options.PublishPorts)) } var portToPublish = make([]string, numReplicas) copy(portToPublish, options.PublishPorts) options.PublishPorts = make([]string, 1) - for i := numReplicas; i != 0; i-- { - options.PublishPorts[0] = (portToPublish[(len(portToPublish) - int(i))]) + for i := range numReplicas { + options.PublishPorts[0] = portToPublish[i] podName := fmt.Sprintf("%s-pod-%d", deploymentYAML.ObjectMeta.Name, i) r, proxies, err := ic.playKubeDeployment(ctx, &deploymentYAML, options, &ipIndex, configMaps, serviceContainer, podName) if err != nil { @@ -432,7 +432,7 @@ func (ic *ContainerEngine) PlayKube(ctx context.Context, body io.Reader, options } } else { if numReplicas > 1 { - logrus.Warnf("Limiting replica count to 1, more than one replica is not supported by Podman") + logrus.Warnf("Limiting replica count to 1, use `--replicas` to enable more than one replica") } podName := fmt.Sprintf("%s-pod", deploymentYAML.ObjectMeta.Name) r, proxies, err := ic.playKubeDeployment(ctx, &deploymentYAML, options, &ipIndex, configMaps, serviceContainer, podName) From 658bf144e68701f2f2ec442d4d509864d23f2a82 Mon Sep 17 00:00:00 2001 From: Oleksandr Krutko Date: Wed, 8 Oct 2025 21:11:27 +0300 Subject: [PATCH 5/8] add test for multiple Pod replicas Signed-off-by: Oleksandr Krutko --- test/e2e/play_kube_test.go | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go index 30b7cc264b7..502254d28e8 100644 --- a/test/e2e/play_kube_test.go +++ b/test/e2e/play_kube_test.go @@ -507,6 +507,28 @@ spec: periodSeconds: 1 ` +var replicasPodYaml = ` +apiVersion: apps/v1 +kind: Deployment +metadata: + name: replicas-pods-test + labels: + app: testimage +spec: + replicas: 2 + selector: + matchLabels: + app: testimage + template: + metadata: + labels: + app: testimage + spec: + containers: + - name: testimage + image: ` + NGINX_IMAGE + ` +` + var selinuxLabelPodYaml = ` apiVersion: v1 kind: Pod @@ -6481,4 +6503,16 @@ spec: inspect := podmanTest.PodmanExitCleanly("inspect", "simpleWithoutPodPrefix") Expect(inspect.InspectContainerToJSON()[0].Name).Should(Equal("simpleWithoutPodPrefix")) }) + + It("multiple Pod replicas", func() { + err := writeYaml(replicasPodYaml, kubeYaml) + Expect(err).ToNot(HaveOccurred()) + + kube := podmanTest.Podman([]string{"kube", "play", "--replicas", "--publish", "8080:80,8081:80", kubeYaml}) + kube.WaitWithDefaultTimeout() + + podsCount := podmanTest.PodmanExitCleanly("pod", "ps", "-n") + podsCount.WaitWithDefaultTimeout() + Expect(podsCount.OutputToStringArray()).To(HaveLen(2)) + }) }) From 684eafa83cf3f1c0405567acc8e156a0825b0378 Mon Sep 17 00:00:00 2001 From: Oleksandr Krutko Date: Wed, 8 Oct 2025 21:16:35 +0300 Subject: [PATCH 6/8] fix the man for podman kube play Signed-off-by: Oleksandr Krutko --- docs/source/markdown/podman-kube-play.1.md.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/markdown/podman-kube-play.1.md.in b/docs/source/markdown/podman-kube-play.1.md.in index 5e9fa797ca7..0ba1c25978a 100644 --- a/docs/source/markdown/podman-kube-play.1.md.in +++ b/docs/source/markdown/podman-kube-play.1.md.in @@ -271,7 +271,7 @@ Define or override a port definition in the YAML file. The lists of ports in the YAML file and the command line are merged. Matching is done by using the **containerPort** field. If **containerPort** exists in both the YAML file and the option, the latter takes precedence. -In case this options is used with **--replicas** option then number of published ports should be equal to the number of replicas in container spec, e.g. Deployment.spec.replicas is 3, then **--publish** is set to "8080:80,8081:80,8082:80" +In case this options is used with **--replicas** option then number of published ports should be qual to the number of replicas in container spec, e.g. Deployment.spec.replicas is 3, then **--publish** is set to "8080:80,8081:80,8082:80" #### **--publish-all** From f07f55dec3581d87d9c23a41fbeea7ddd743eed2 Mon Sep 17 00:00:00 2001 From: Oleksandr Krutko Date: Wed, 8 Oct 2025 23:10:57 +0300 Subject: [PATCH 7/8] fix tests which are related to multiple Pods creation Signed-off-by: Oleksandr Krutko --- test/e2e/play_kube_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go index 502254d28e8..98aff08cf1d 100644 --- a/test/e2e/play_kube_test.go +++ b/test/e2e/play_kube_test.go @@ -3651,7 +3651,7 @@ spec: if IsRemote() { Expect(kube.ErrorToString()).To(BeEmpty()) } else { - Expect(kube.ErrorToString()).To(ContainSubstring("Limiting replica count to 1, more than one replica is not supported by Podman")) + Expect(kube.ErrorToString()).To(ContainSubstring("Limiting replica count to 1, use `--replicas` to enable more than one replica")) } podName := getPodNameInDeployment(deployment) @@ -3709,7 +3709,7 @@ spec: if IsRemote() { Expect(kube.ErrorToString()).To(BeEmpty()) } else { - Expect(kube.ErrorToString()).To(ContainSubstring("Limiting replica count to 1, more than one replica is not supported by Podman")) + Expect(kube.ErrorToString()).To(ContainSubstring("Limiting replica count to 1, use `--replicas` to enable more than one replica")) } podName := getPodNameInDeployment(deployment) @@ -4192,7 +4192,7 @@ spec: if IsRemote() { Expect(kube.ErrorToString()).To(BeEmpty()) } else { - Expect(kube.ErrorToString()).To(ContainSubstring("Limiting replica count to 1, more than one replica is not supported by Podman")) + Expect(kube.ErrorToString()).To(ContainSubstring("Limiting replica count to 1, use `--replicas` to enable more than one replica")) } correctLabels := expectedLabelKey + ":" + expectedLabelValue @@ -4233,7 +4233,7 @@ spec: if IsRemote() { Expect(kube.ErrorToString()).To(BeEmpty()) } else { - Expect(kube.ErrorToString()).To(ContainSubstring("Limiting replica count to 1, more than one replica is not supported by Podman")) + Expect(kube.ErrorToString()).To(ContainSubstring("Limiting replica count to 1, use `--replicas` to enable more than one replica")) } pod := getPodNameInDeployment(deployment) @@ -5833,7 +5833,7 @@ spec: // warnings are only propagated to local clients if !IsRemote() { - Expect(kube.ErrorToString()).Should(ContainSubstring("Limiting replica count to 1, more than one replica is not supported by Podman")) + Expect(kube.ErrorToString()).Should(ContainSubstring("Limiting replica count to 1, use `--replicas` to enable more than one replica")) } Expect(strings.Count(kube.OutputToString(), "Pod:")).To(Equal(1)) From eff25f8cd88464e72d6b70bdaa251fd9af1dd130 Mon Sep 17 00:00:00 2001 From: Oleksandr Krutko Date: Sat, 18 Oct 2025 12:01:04 +0300 Subject: [PATCH 8/8] fix remote API for multiple pod replicas Signed-off-by: Oleksandr Krutko --- cmd/podman/kube/play.go | 6 +++--- pkg/api/handlers/libpod/kube.go | 2 ++ pkg/bindings/kube/types.go | 2 ++ pkg/bindings/kube/types_play_options.go | 15 +++++++++++++++ pkg/domain/infra/tunnel/kube.go | 1 + 5 files changed, 23 insertions(+), 3 deletions(-) diff --git a/cmd/podman/kube/play.go b/cmd/podman/kube/play.go index e984361c3b5..b5404fba0d2 100644 --- a/cmd/podman/kube/play.go +++ b/cmd/podman/kube/play.go @@ -181,6 +181,9 @@ func playFlags(cmd *cobra.Command) { noPodPrefix := "no-pod-prefix" flags.BoolVar(&playOptions.NoPodPrefix, noPodPrefix, false, "Do not prefix container name with pod name") + replicas := "replicas" + flags.BoolVar(&playOptions.Replicas, replicas, false, "Replicas allows multiple Pods creation") + if !registry.IsRemote() { certDirFlagName := "cert-dir" flags.StringVar(&playOptions.CertDir, certDirFlagName, "", "`Pathname` of a directory containing TLS certificates and keys") @@ -210,9 +213,6 @@ func playFlags(cmd *cobra.Command) { exitFlagName := "service-exit-code-propagation" flags.StringVar(&playOptions.ExitCodePropagation, exitFlagName, "", "Exit-code propagation of the service container") _ = flags.MarkHidden(exitFlagName) - - replicas := "replicas" - flags.BoolVar(&playOptions.Replicas, replicas, false, "Replicas allows multiple Pods creation") } } diff --git a/pkg/api/handlers/libpod/kube.go b/pkg/api/handlers/libpod/kube.go index 6b6a47e2d0e..a9c4a91ef44 100644 --- a/pkg/api/handlers/libpod/kube.go +++ b/pkg/api/handlers/libpod/kube.go @@ -124,6 +124,7 @@ func KubePlay(w http.ResponseWriter, r *http.Request) { Wait bool `schema:"wait"` Build bool `schema:"build"` NoPodPrefix bool `schema:"noPodPrefix"` + Replicas bool `schema:"replicas"` }{ TLSVerify: true, Start: true, @@ -200,6 +201,7 @@ func KubePlay(w http.ResponseWriter, r *http.Request) { Wait: query.Wait, ContextDir: contextDirectory, NoPodPrefix: query.NoPodPrefix, + Replicas: query.Replicas, } if _, found := r.URL.Query()["build"]; found { options.Build = types.NewOptionalBool(query.Build) diff --git a/pkg/bindings/kube/types.go b/pkg/bindings/kube/types.go index 38c22b1c607..76118a76091 100644 --- a/pkg/bindings/kube/types.go +++ b/pkg/bindings/kube/types.go @@ -64,6 +64,8 @@ type PlayOptions struct { Wait *bool ServiceContainer *bool NoPodPrefix *bool + // Replicas allows multiple Pods creation + Replicas *bool } // ApplyOptions are optional options for applying kube YAML files to a k8s cluster diff --git a/pkg/bindings/kube/types_play_options.go b/pkg/bindings/kube/types_play_options.go index 2323df08f0c..8c9c54b7889 100644 --- a/pkg/bindings/kube/types_play_options.go +++ b/pkg/bindings/kube/types_play_options.go @@ -422,3 +422,18 @@ func (o *PlayOptions) GetNoPodPrefix() bool { } return *o.NoPodPrefix } + +// WithReplicas set field Replicas to given value +func (o *PlayOptions) WithReplicas(value bool) *PlayOptions { + o.Replicas = &value + return o +} + +// GetReplicas returns value of field Replicas +func (o *PlayOptions) GetReplicas() bool { + if o.Replicas == nil { + var z bool + return z + } + return *o.Replicas +} diff --git a/pkg/domain/infra/tunnel/kube.go b/pkg/domain/infra/tunnel/kube.go index e9198590dcf..16fc2d526b6 100644 --- a/pkg/domain/infra/tunnel/kube.go +++ b/pkg/domain/infra/tunnel/kube.go @@ -76,6 +76,7 @@ func (ic *ContainerEngine) PlayKube(_ context.Context, body io.Reader, opts enti options.WithPublishAllPorts(opts.PublishAllPorts) options.WithNoTrunc(opts.UseLongAnnotations) options.WithNoPodPrefix(opts.NoPodPrefix) + options.WithReplicas(opts.Replicas) return play.KubeWithBody(ic.ClientCtx, body, options) }