Updated descriptions in kubectl create deployment help , added example for multiple images

Signed-off-by: Ritikaa96 <ritika@india.nec.com>

Kubernetes-commit: 76919e9569746e4e1ae0ec190892af3a142553c9
This commit is contained in:
Ritikaa96 2023-09-04 13:53:57 +09:00 committed by Kubernetes Publisher
parent 3bdfe98073
commit b32cbdf03a
1 changed files with 6 additions and 3 deletions

View File

@ -53,7 +53,10 @@ var (
kubectl create deployment my-dep --image=nginx --replicas=3
# Create a deployment named my-dep that runs the busybox image and expose port 5701
kubectl create deployment my-dep --image=busybox --port=5701`))
kubectl create deployment my-dep --image=busybox --port=5701
# Create a deployment named my-dep that runs multiple containers
kubectl create deployment dep --image=busybox:latest --port=5701 --image=ubuntu:latest --image=nginx`))
)
// CreateDeploymentOptions is returned by NewCmdCreateDeployment
@ -112,9 +115,9 @@ func NewCmdCreateDeployment(f cmdutil.Factory, ioStreams genericiooptions.IOStre
cmdutil.AddApplyAnnotationFlags(cmd)
cmdutil.AddValidateFlags(cmd)
cmdutil.AddDryRunFlag(cmd)
cmd.Flags().StringSliceVar(&o.Images, "image", o.Images, "Image names to run.")
cmd.Flags().StringSliceVar(&o.Images, "image", o.Images, "Image names to run. A deployment can have multiple images set for multi-container pod. It is to be noted that command can't be mentioned along with list of images. ")
cmd.MarkFlagRequired("image")
cmd.Flags().Int32Var(&o.Port, "port", o.Port, "The port that this container exposes.")
cmd.Flags().Int32Var(&o.Port, "port", o.Port, "The containerPort that this deployment exposes.")
cmd.Flags().Int32VarP(&o.Replicas, "replicas", "r", o.Replicas, "Number of replicas to create. Default is 1.")
cmdutil.AddFieldManagerFlagVar(cmd, &o.FieldManager, "kubectl-create")