Instead of `exec`ing around, is it possible to run the backup command from
another container in the same pod? Possibly by mounting enough volumes into
both? Then you could just run the backup "cron" as part of the Gitlab pod,
using cron itself, some lightweight alternative, or even just a shell
script with a loop.

Looking at your YAML you are doing interesting things with "command" and
"args" that I'm not sure work the right way. A form that has worked well
for me is to use YAML's multiline strings to pass the script as a single
argument to `sh -c`:

command: /bin/sh
args:
- -c
- |
  POD=$(…)
  kubectl exec …

Hope this helps!
/MR



On Fri, Aug 24, 2018 at 4:39 PM Matthew Cooper <mwc...@build2c.org> wrote:

> Hello all,
>
> I need to get our Gitlab installation finalized. The final task is
> performing regular backups. According to the Gitlab dos, they recommend
> using "kubectl exec" to run the backup command in the pod. In order to make
> this more reliable, my only idea has been to exec from a Kubernetes
> CronJob. (If anyone can suggest a better idea that I can put into my Helm
> chart, I am all ears!)
>
> Unfortunately, I am really struggling to get the command invocation
> correct. A lot of trial and error here. I've attached my current attempt
> but imagine I could be pretty far off. All help greatly appreciated!!
>
>
> Blessings,
> Matt
>
> --
> 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.
>
>
>
>
> --
> 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.
>

-- 
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.
  • [kubernetes-u... Matthew Cooper
    • Re: [kub... 'Matthias Rampke' via Kubernetes user discussion and Q&A

Reply via email to