Skip to content

Commit

Permalink
deploying cronworkflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mrpbennett committed Jul 12, 2024
1 parent 4ddfc3c commit 815923d
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 1 deletion.
20 changes: 20 additions & 0 deletions boilerplates/kubernetes/cronworkflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: argoproj.io/v1alpha1
kind: CronWorkflow
metadata:
name: hello-world
spec:
schedule: "* * * * *"
timezone: "Europe/London" # Default to local machine timezone
startingDeadlineSeconds: 0
concurrencyPolicy: "Replace" # Default to "Allow"
successfulJobsHistoryLimit: 4 # Default 3
failedJobsHistoryLimit: 4 # Default 1
suspend: false # Set to "true" to suspend scheduling
workflowSpec:
entrypoint: whalesay
templates:
- name: whalesay
container:
image: docker/whalesay:latest
command: [cowsay]
args: ["🕓 hello world. Scheduled on: {{workflow.scheduledTime}}"]
3 changes: 2 additions & 1 deletion kubernetes/jobs/health-dashboard-cj.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
template:
spec:
containers:
- image: 192.168.7.210:5000/health-dashboard:0.0.6
- image: 192.168.7.210:5000/health-dashboard:0.0.7
imagePullPolicy: Always
name: health-dashboard
resources:
Expand All @@ -20,3 +20,4 @@ spec:
restartPolicy: OnFailure
terminationGracePeriodSeconds: 30
schedule: "0 7 * * *"
timezone: "Europe/London"
22 changes: 22 additions & 0 deletions kubernetes/jobs/user-etl-cj.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: users-etl
namespace: cron-jobs
spec:
concurrencyPolicy: Replace
failedJobsHistoryLimit: 5
jobTemplate:
spec:
template:
spec:
containers:
- image: 192.168.7.210:5000/user-etl:0.0.1
imagePullPolicy: Always
name: users-etl
resources:
requests:
memory: 256Mi
restartPolicy: OnFailure
terminationGracePeriodSeconds: 30
schedule: "0 0 * * *"
30 changes: 30 additions & 0 deletions kubernetes/registry/cron-workflows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: cron-workflows
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: "https://github.com/mrpbennett/home-ops.git"
path: kubernetes/workflows
targetRevision: HEAD
directory:
recurse: true
destination:
namespace: cron-jobs
server: "https://kubernetes.default.svc"
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
retry:
limit: 5
backoff:
duration: 5s
maxDuration: 5m0s
factor: 2
18 changes: 18 additions & 0 deletions kubernetes/workflows/cron-work-flow-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: cron-workflows
namespace: argocd
spec:
project: default
source:
repoURL: "https://github.com/mrpbennett/home-ops.git"
path: kubernetes/workflow/jobs
targetRevision: HEAD
destination:
server: "https://kubernetes.default.svc"
namespace: cron-jobs
syncPolicy:
automated:
prune: true
selfHeal: true
20 changes: 20 additions & 0 deletions kubernetes/workflows/jobs/hello-world.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: argoproj.io/v1alpha1
kind: CronWorkflow
metadata:
name: hello-world
spec:
schedule: "*/10 * * * *"
timezone: "Europe/London" # Default to local machine timezone
startingDeadlineSeconds: 0
concurrencyPolicy: "Replace" # Default to "Allow"
successfulJobsHistoryLimit: 4 # Default 3
failedJobsHistoryLimit: 4 # Default 1
suspend: false # Set to "true" to suspend scheduling
workflowSpec:
entrypoint: whalesay
templates:
- name: whalesay
container:
image: docker/whalesay:latest
command: [cowsay]
args: ["🕓 hello world. Scheduled on: {{workflow.scheduledTime}}"]

0 comments on commit 815923d

Please sign in to comment.