If the command you want to execute in the pod has any flags in common
(e.g. -i),

  # you must use two dashes (--) to separate your command's flags/arguments.

  # Also note, do not surround your command and its flags/arguments with
quotes

  # unless that is how you would execute it normally (i.e., do ls -t /usr,
not "ls -t /usr").

  kubectl exec 123456-7890 -i -t -- ls -t /usr
Its all in the help :)
Try:
kubectl exec -n monitoring prometheus-core-5948ff9f7d-zpkt6  -- rm -rf
/prometheus/data/snapshots

On Fri, May 25, 2018 at 12:29 PM, <suyog.kulka...@gslab.com> wrote:

> Hi all ,
>
> I am getting trouble to delete the directory in kubectl exec command i
> have tried following command but getting error
>
> kubectl exec -n monitoring prometheus-core-5948ff9f7d-zpkt6  rm -rf
> /prometheus/data/snapshots
>
> Error
>
> Error: unknown shorthand flag: 'r' in -rf
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Kubernetes user discussion and Q&A" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to kubernetes-users+unsubscr...@googlegroups.com.
> To post to this group, send email to kubernetes-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/kubernetes-users.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Thanks,

Mayur

-- 
You received this message because you are subscribed to the Google Groups 
"Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to kubernetes-users+unsubscr...@googlegroups.com.
To post to this group, send email to kubernetes-users@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to