douhuiwan5141 2018-09-27 13:06
浏览 33

如何运行多步骤cron作业,但仍使其能够手动执行单个步骤?

I have a data pipeline in Go with steps A, B and C. Currently those are three binaries. They share the same database but write to different tables. When developing locally, I have been just running ./a && ./b && ./c. I'm looking to deploy this pipeline to our Kubernetes cluster.

I want A -> B -> C to run once a day, but sometimes (for debugging etc.) I may just want to manually run A or B or C in isolation.

Is there a simple way of achieving this in Kubernetes?

I haven't found many resources on this, so maybe that demonstrates an issue with my application's design?

  • 写回答

1条回答 默认 最新

  • douhui7136 2018-09-27 19:49
    关注

    Create a docker image that holds all three binaries and a wrapper script to run all three.

    Then deploy a Kubernetes CronJob that runs all three sequentially (using the wrapper script as entrypoint/command), with the appropriate schedule.

    For debugging you can then just run the the same image manually:

    kubectl -n XXX run debug -it --rm --image=<image> -- /bin/sh
    $ ./b
    ...
    
    评论

报告相同问题?

悬赏问题

  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题