Skip to content

Commit

Permalink
docs: Add workflow-count-resourcequota.yaml example (argoproj#6225)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Collins <[email protected]>
  • Loading branch information
alexec authored Jun 25, 2021
1 parent 056adf9 commit 097fe92
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
10 changes: 10 additions & 0 deletions docs/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,8 @@ WorkflowSpec is the specification of a Workflow.

- [`work-avoidance.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/work-avoidance.yaml)

- [`workflow-count-resourcequota.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/workflow-count-resourcequota.yaml)

- [`event-consumer-workfloweventbinding.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/workflow-event-binding/event-consumer-workfloweventbinding.yaml)

- [`event-consumer-workflowtemplate.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/workflow-event-binding/event-consumer-workflowtemplate.yaml)
Expand Down Expand Up @@ -1093,6 +1095,8 @@ CronWorkflowSpec is the specification of a CronWorkflow

- [`work-avoidance.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/work-avoidance.yaml)

- [`workflow-count-resourcequota.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/workflow-count-resourcequota.yaml)

- [`event-consumer-workfloweventbinding.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/workflow-event-binding/event-consumer-workfloweventbinding.yaml)

- [`event-consumer-workflowtemplate.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/workflow-event-binding/event-consumer-workflowtemplate.yaml)
Expand Down Expand Up @@ -1452,6 +1456,8 @@ WorkflowTemplateSpec is a spec of WorkflowTemplate.

- [`work-avoidance.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/work-avoidance.yaml)

- [`workflow-count-resourcequota.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/workflow-count-resourcequota.yaml)

- [`event-consumer-workfloweventbinding.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/workflow-event-binding/event-consumer-workfloweventbinding.yaml)

- [`event-consumer-workflowtemplate.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/workflow-event-binding/event-consumer-workflowtemplate.yaml)
Expand Down Expand Up @@ -4635,6 +4641,8 @@ ObjectMeta is metadata that all persisted resources must have, which includes al

- [`work-avoidance.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/work-avoidance.yaml)

- [`workflow-count-resourcequota.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/workflow-count-resourcequota.yaml)

- [`event-consumer-workfloweventbinding.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/workflow-event-binding/event-consumer-workfloweventbinding.yaml)

- [`event-consumer-workflowtemplate.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/workflow-event-binding/event-consumer-workflowtemplate.yaml)
Expand Down Expand Up @@ -5886,6 +5894,8 @@ PersistentVolumeClaimSpec describes the common attributes of storage devices and

- [`work-avoidance.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/work-avoidance.yaml)

- [`workflow-count-resourcequota.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/workflow-count-resourcequota.yaml)

- [`event-consumer-workfloweventbinding.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/workflow-event-binding/event-consumer-workfloweventbinding.yaml)

- [`event-consumer-workflowtemplate.yaml`](https://github.com/argoproj/argo-workflows/blob/master/examples/workflow-event-binding/event-consumer-workflowtemplate.yaml)
Expand Down
24 changes: 24 additions & 0 deletions examples/workflow-count-resourcequota.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v1
kind: ResourceQuota
metadata:
name: workflow-count
annotations:
workflows.argoproj.io/description: |
This resource quota prevents creation of more than a certain number of workflows being created in a namespace.
The user will get an error when they try to create more. As the count includes both completed and incomplete
workflows, and complete workflows do not make any significant demands of your cluster, you probably want to use it
with a workflow GC strategy, so that a build up of completed workflows does not prevent you from creating and
running new workflows.
Argo Workflowws has feature called "parallelism" that limits the number of running workflows, ignoring completed
workflows.
<= v3.1 you can configure a global limit to the total number of running workflows in the cluster. This is suitable
for single-tenancy set-up.
For multi-tenancy set-up, where each tenant own a single namespace, then in >= v3.1 you can globaly configure a
limit for the total number of running workflows within each namespace.
spec:
hard:
count/workflows.argoproj.io: "100"
8 changes: 3 additions & 5 deletions hack/capture-pprof.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ cd $(dirname $0)/..

n=$(date +%s)

go tool pprof -png -output dist/heap-$n.png http://localhost:6060/debug/pprof/heap
go tool pprof -png -output dist/allocs-$n.png http://localhost:6060/debug/pprof/allocs
go tool pprof -png -output dist/block-$n.png http://localhost:6060/debug/pprof/block
go tool pprof -png -output dist/mutex-$n.png http://localhost:6060/debug/pprof/mutex
go tool pprof -png -output dist/profile-$n.png http://localhost:6060/debug/pprof/profile
go tool pprof -web http://localhost:6060/debug/pprof/allocs
go tool pprof -web http://localhost:6060/debug/pprof/heap
go tool pprof -web http://localhost:6060/debug/pprof/profile

0 comments on commit 097fe92

Please sign in to comment.