alexellis/run-job

[Feature] Add Command and Args to job YAML file

alexellis opened this issue ยท 6 comments

[Feature] Add Command and Args to job YAML file

Work-type / day job type use-cases:

  • Checking curl from within the cluster
  • Checking inter-pod DNS is working
  • Think of DB index clean-up
  • A network scan with nmap
  • Tasks that you'd usually run on cron
  • Dynamic DNS updates
  • Generating a weekly feed / report / update / sync
  • Running a build with Kaniko

Assuming you had an image with curl installed like the openfaas store functions you should be able to write this to override the default command to start the openfaas watchdog, and to instead just run curl to your favourite website and exit.

name: curl
image: ghcr.io/openfaas/curl:latest
command:
- "/bin/curl"
args:
 - "-s"
 - "https://inlets.dev"

@Jasstkn what do you think of giving this a shot? I'm not sure if you've worked with the K8s API from Go yet, but if you haven't, could be fun? Also seems like something an SRE could use (someone, somewhere)

@Jasstkn what do you think of giving this a shot? I'm not sure if you've worked with the K8s API from Go yet, but if you haven't, could be fun? Also seems like something an SRE could use (someone, somewhere)

Looks amazing tho. I've been using Kubernetes mostly from Ops side but I would like to get more experience with coding for it too ๐Ÿš€

Would you like to try taking this one on?

Would you like to try taking this one on?

Yes!

Quick question @Jasstkn could you adapt my kubectl example to take command/args instead of being hard-coded in the Dockerfile? And then update the README to show off the neat new feature too?

Quick question @Jasstkn could you adapt my kubectl example to take command/args instead of being hard-coded in the Dockerfile? And then update the README to show off the neat new feature too?

Yes, I'll do it.