mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 04:52:08 +00:00
Merge pull request #120393 from Ritikaa96/kubectl-create-deploy
Improvements added in kubectl create deployment help
This commit is contained in:
commit
012f0b85ab
@ -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 my-dep --image=busybox:latest --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.")
|
||||
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")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user