Skip to content

Instantly share code, notes, and snippets.

View knil-sama's full-sized avatar
💭
Nothing really

Clement Demonchy knil-sama

💭
Nothing really
View GitHub Profile
kind: CronJob
metadata:
name: example
spec:
schedule: "10 3,15,20 * * *"
concurrencyPolicy: "Forbid"
failedJobsHistoryLimit: 10
startingDeadlineSeconds: 1800 # 30 min
suspend: false
jobTemplate:

Keybase proof

I hereby claim:

  • I am knil-sama on github.
  • I am knil (https://keybase.io/knil) on keybase.
  • I have a public key ASBPF0NdX6Epnotjfi0k05yry5ba09VXfedf0cII3QaBwQo

To claim this, I am signing this object:

select 'drop table if exists "' || tablename || '" cascade;'
from pg_tables
where schemaname = 'public';
?column?
cronjob_log() {
echo $(kubectl get pods --selector=job-name="${1}" --output=jsonpath={.items..metadata.name})
}
job_log() {
echo $( kubectl get job | grep "${1}" | tail -n 1 | cut -d" " -f 1 | xargs kubectl describe job | grep SuccessfulCreate | tr -s ' ' | cut -d" " -f 8 | xargs kubectl logs)
}
FROM amazonlinux:latest
### PRE-REQUISITES ###
# install pre-requisites
RUN yum -y groupinstall development
RUN yum install -y zlib-devel \
openssl-devel \
wget
import s3fs
import sys
# Expect aws credentials to exist in path
def fetch_filtered_filekeys(bucket_name: str, dir_name: str, prefix_file: str="",suffix_file: str="") -> list:
S3 = s3fs.S3FileSystem()
s3_dataset_path = "/".join([bucket_name, dir_name])
list_available_file = [p for p in S3.walk(s3_dataset_path)
if p.endswith(suffix_file) and p.startswith(prefix_file)]
return list_available_file
spec:
concurrencyPolicy: Allow
failedJobsHistoryLimit: 1
jobTemplate:
spec:
template:
spec:
containers:
- command:
- echo
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: test
spec:
schedule: "30 16,17,18,19 * * *"
concurrencyPolicy: "Forbid"
failedJobsHistoryLimit: 10
startingDeadlineSeconds: 600 # 10 min
jobTemplate:
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: batch/v1beta1
kind: CronJob
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"batch/v1beta1","kind":"CronJob","metadata":{"annotations":{},"name":"test","namespace":"default"},"spec":{"jobTemplate":{"spec":{"template":{"spec":{"containers":[{"command":["echo","hello wolrd"],"image":"bash","name":"hello"}],"restartPolicy":"Never"}}}},"schedule":"*/5 * * * *"}}
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: test
spec:
schedule: "*/5 * * * *"
jobTemplate:
spec:
template:
spec: