Allow running cronjobs on k8s
Closed, ResolvedPublic

Description

We have built in cronjob support on kubernetes now (https://kubernetes.io/docs/user-guide/cron-jobs/). Make this easier to use for tool labs users.

Restricted Application added a project: Cloud-Services. · View Herald TranscriptFeb 15 2017, 4:52 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 337776 had a related patch set uploaded (by Yuvipanda):
tools: Enable cronjobs for tools k8s

https://gerrit.wikimedia.org/r/337776

Change 337776 merged by Yuvipanda:
tools: Enable cronjobs for tools k8s

https://gerrit.wikimedia.org/r/337776

scfc triaged this task as Normal priority.Feb 16 2017, 1:10 PM
scfc moved this task from Triage to Backlog on the Toolforge board.
scfc added a subscriber: scfc.

@yuvipanda: I successfully created a scheduled job by copying the example kubectl run hello --schedule="*/1 * * * *" --restart=OnFailure --image=busybox -- /bin/sh -c "date; echo Hello from the Kubernetes cluster", looked at it with kubectl get jobs and deleted it with kubectl delete scheduledjobs hello. Is there anything else that needs to be done to resolve this task?

Shouldn't image be something like docker-registry.tools.wmflabs.org/toollabs-python-web:latest?

To resolve this task I think we need documentation somewhere on wikitech mentioning the feature exists and what the current level of support is.

There are no plans to support this in the near future in any serious capacity.

To resolve this task I think we need documentation somewhere on wikitech mentioning the feature exists and what the current level of support is.

I think the feature exists, and there's no official levels of support from us. You can refer to upstream docs to use it right now, and there might be community documentation.

I think in some ways using kubectl is similar to using qsub directly - there's upstream docs, we have it installed and turned on, and you can do more powerful things with it than with jsub.

This might change in the future if we have more resources.

bd808 added a subscriber: bd808.Feb 17 2017, 9:19 PM

@Legoktm I think 'we' can create a page on wikitech that collects documentation about 'advanced' Kubernetes usage. There are some things I can contribute from the Stashbot config about setting up and running a continuous job using a custom deployment file. The page needs to be very clear however that using these kinds of features is for intrepid adventurers only, could break at any moment, and not officially supported in any way by the Tool Labs/Cloud Services team.

I really, really want to make using Kubernetes beyond a webservice backend common, but we have a list of more pressing issues for the Cloud Services team to work on that is going to keep it from being a goal for the foreseeable future. There was a hope at one point that we could 'transparently' migrate people from OGE to Kubernetes, but we have done enough work towards that at this point to have proven that it will not be possible. Building a lot of custom scripting for Kubernetes like we did for OGE would create even more tech debt for us to cleanup eventually. The blocker to moving forward properly is paying down enough of our existing tech debt in the OpenStack deployment to free up resources needed to move forward with net new projects like selecting and deploying an easy to use command and control system for running tools on Kubernetes.

scfc closed this task as Resolved.Feb 17 2017, 9:49 PM
scfc assigned this task to yuvipanda.

(This task was about allowing running cron jobs on Kubernetes, and that has been resolved; https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/Web/Kubernetes does not even mention kubectl or explain what pods are, so requiring documenting how to use advanced features for this task to be closed would IMHO be too much effort. Stashbot's configuration looks interesting for a blog post to make people aware and curious.)