generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #612 from googs1025/add_argo_workflow_example
docs: add argo workflow example for jobset
- Loading branch information
Showing
2 changed files
with
149 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: argo-jobset | ||
namespace: argo | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: argo-jobset-role | ||
namespace: argo | ||
rules: | ||
- apiGroups: | ||
- batch | ||
resources: | ||
- jobs | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- batch | ||
resources: | ||
- jobs/status | ||
verbs: | ||
- get | ||
- patch | ||
- update | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- jobset.x-k8s.io | ||
resources: | ||
- jobsets | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- jobset.x-k8s.io | ||
resources: | ||
- jobsets/finalizers | ||
verbs: | ||
- update | ||
- apiGroups: | ||
- jobset.x-k8s.io | ||
resources: | ||
- jobsets/status | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: argo-jobset-binding | ||
namespace: argo | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: argo-jobset-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: argo-jobset | ||
namespace: argo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
namespace: argo | ||
generateName: argo-workflow-jobset- | ||
spec: | ||
serviceAccountName: argo-jobset | ||
entrypoint: jobset-example | ||
templates: | ||
- name: jobset-example | ||
resource: # indicates that this is a resource template | ||
# can be any kubectl action (e.g. create, delete, apply, patch) | ||
action: create | ||
# The successCondition and failureCondition are optional expressions. | ||
# If failureCondition is true, the step is considered failed. | ||
# If successCondition is true, the step is considered successful. | ||
# They use kubernetes label selection syntax and can be applied against any field | ||
# of the resource (not just labels). Multiple AND conditions can be represented by comma | ||
# delimited expressions. | ||
# For more details: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ | ||
successCondition: status.terminalState == Completed | ||
failureCondition: status.terminalState == Failed | ||
# put your kubernetes spec here | ||
manifest: | | ||
apiVersion: jobset.x-k8s.io/v1alpha2 | ||
kind: JobSet | ||
metadata: | ||
name: paralleljobs | ||
namespace: argo | ||
spec: | ||
replicatedJobs: | ||
- name: workers | ||
template: | ||
spec: | ||
parallelism: 4 | ||
completions: 4 | ||
backoffLimit: 0 | ||
template: | ||
spec: | ||
containers: | ||
- name: sleep | ||
image: busybox | ||
command: | ||
- sleep | ||
args: | ||
- 100s | ||
- name: driver | ||
template: | ||
spec: | ||
parallelism: 1 | ||
completions: 1 | ||
backoffLimit: 0 | ||
template: | ||
spec: | ||
containers: | ||
- name: sleep | ||
image: busybox | ||
command: | ||
- sleep | ||
args: | ||
- 100s |