Skip to content

Commit

Permalink
feat: Support workflow level poddisruptionbudge for workflow pods arg…
Browse files Browse the repository at this point in the history
  • Loading branch information
sarabala1979 committed Feb 26, 2020
1 parent 8da88d7 commit aa05234
Show file tree
Hide file tree
Showing 24 changed files with 756 additions and 377 deletions.
49 changes: 22 additions & 27 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
],
"swagger": "2.0",
"info": {
"description": "Workflow Service API performs CRUD actions against application resources",
"title": "Argo",
"version": "latest"
},
Expand Down Expand Up @@ -2600,6 +2599,10 @@
"format": "int64",
"title": "Parallelism limits the max total parallel pods that can execute at the same time in a workflow"
},
"podDisruptionBudget": {
"title": "PodDisruptionBudget holds the number of concurrent disruptions that you allow for Workflow's Pods.\nController will automatically add the selector with workflow name, if selector is empty.\nOptional: Defaults to empty.\n+optional",
"$ref": "#/definitions/k8s.io.api.policy.v1beta1.PodDisruptionBudgetSpec"
},
"podGC": {
"title": "PodGC describes the strategy to use when to deleting completed pods",
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.PodGC"
Expand Down Expand Up @@ -5022,6 +5025,24 @@
}
}
},
"k8s.io.api.policy.v1beta1.PodDisruptionBudgetSpec": {
"description": "PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.",
"type": "object",
"properties": {
"maxUnavailable": {
"title": "An eviction is allowed if at most \"maxUnavailable\" pods selected by\n\"selector\" are unavailable after the eviction, i.e. even in absence of\nthe evicted pod. For example, one can prevent all voluntary evictions\nby specifying 0. This is a mutually exclusive setting with \"minAvailable\".\n+optional",
"$ref": "#/definitions/io.k8s.api.core.v1.IntOrString"
},
"minAvailable": {
"title": "An eviction is allowed if at least \"minAvailable\" pods selected by\n\"selector\" will still be available after the eviction, i.e. even in the\nabsence of the evicted pod. So for example you can prevent all voluntary\nevictions by specifying \"100%\".\n+optional",
"$ref": "#/definitions/io.k8s.api.core.v1.IntOrString"
},
"selector": {
"title": "Label query over pods whose evictions are managed by the disruption\nbudget.\n+optional",
"$ref": "#/definitions/io.k8s.api.core.v1.LabelSelector"
}
}
},
"io.k8s.api.core.v1.Quantity": {
"description": "Quantity is a fixed-point representation of a number.\nIt provides convenient marshaling/unmarshaling in JSON and YAML,\nin addition to String() and AsInt64() accessors.\n\nThe serialization format is:\n\n\u003cquantity\u003e ::= \u003csignedNumber\u003e\u003csuffix\u003e\n (Note that \u003csuffix\u003e may be empty, from the \"\" case in \u003cdecimalSI\u003e.)\n\u003cdigit\u003e ::= 0 | 1 | ... | 9\n\u003cdigits\u003e ::= \u003cdigit\u003e | \u003cdigit\u003e\u003cdigits\u003e\n\u003cnumber\u003e ::= \u003cdigits\u003e | \u003cdigits\u003e.\u003cdigits\u003e | \u003cdigits\u003e. | .\u003cdigits\u003e\n\u003csign\u003e ::= \"+\" | \"-\"\n\u003csignedNumber\u003e ::= \u003cnumber\u003e | \u003csign\u003e\u003cnumber\u003e\n\u003csuffix\u003e ::= \u003cbinarySI\u003e | \u003cdecimalExponent\u003e | \u003cdecimalSI\u003e\n\u003cbinarySI\u003e ::= Ki | Mi | Gi | Ti | Pi | Ei\n (International System of units; See: http:https://physics.nist.gov/cuu/Units/binary.html)\n\u003cdecimalSI\u003e ::= m | \"\" | k | M | G | T | P | E\n (Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\u003cdecimalExponent\u003e ::= \"e\" \u003csignedNumber\u003e | \"E\" \u003csignedNumber\u003e\n\nNo matter which of the three exponent forms is used, no quantity may represent\na number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal\nplaces. Numbers larger or more precise will be capped or rounded up.\n(E.g.: 0.1m will rounded up to 1m.)\nThis may be extended in the future if we require larger or smaller quantities.\n\nWhen a Quantity is parsed from a string, it will remember the type of suffix\nit had, and will use the same type again when it is serialized.\n\nBefore serializing, Quantity will be put in \"canonical form\".\nThis means that Exponent/suffix will be adjusted up or down (with a\ncorresponding increase or decrease in Mantissa) such that:\n a. No precision is lost\n b. No fractional digits will be emitted\n c. The exponent (or suffix) is as large as possible.\nThe sign will be omitted unless the number is negative.\n\nExamples:\n 1.5 will be serialized as \"1500m\"\n 1.5Gi will be serialized as \"1536Mi\"\n\nNote that the quantity will NEVER be internally represented by a\nfloating point number. That is the whole point of this exercise.\n\nNon-canonical values will still parse as long as they are well formed,\nbut will be re-emitted in their canonical form. (So always use canonical\nform, or don't diff.)\n\nThis format is intended to make it difficult to use these numbers without\nwriting some sort of special handling code in the hopes that that will\ncause implementors to also use a fixed point implementation.\n\n+protobuf=true\n+protobuf.embed=string\n+protobuf.options.marshal=false\n+protobuf.options.(gogoproto.goproto_stringer)=false\n+k8s:deepcopy-gen=true\n+k8s:openapi-gen=true",
"type": "object",
Expand Down Expand Up @@ -5578,31 +5599,5 @@
"description": "HTTP Basic authentication",
"type": "basic"
}
},
"x-stream-definitions": {
"io.argoproj.workflow.v1alpha1.LogEntry": {
"properties": {
"error": {
"$ref": "#/definitions/grpc.gateway.runtime.StreamError"
},
"result": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.LogEntry"
}
},
"title": "Stream result of io.argoproj.workflow.v1alpha1.LogEntry",
"type": "object"
},
"io.argoproj.workflow.v1alpha1.WorkflowWatchEvent": {
"properties": {
"error": {
"$ref": "#/definitions/grpc.gateway.runtime.StreamError"
},
"result": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.WorkflowWatchEvent"
}
},
"title": "Stream result of io.argoproj.workflow.v1alpha1.WorkflowWatchEvent",
"type": "object"
}
}
}
16 changes: 16 additions & 0 deletions examples/default-pdb-support.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: default-pdb-support-

spec:
entrypoint: pdbcreate
serviceaccountname: default
poddisruptionbudget:
minavailable: 100%
templates:
- name: pdbcreate
container:
image: alpine:latest
command: [sh, -c]
args: ["sleep 10"]
17 changes: 10 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/aws/aws-sdk-go v1.27.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/colinmarc/hdfs v1.1.4-0.20180805212432-9746310a4d31
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/evanphx/json-patch v4.2.0+incompatible
Expand All @@ -19,7 +20,7 @@ require (
github.com/go-ini/ini v1.51.1 // indirect
github.com/go-sql-driver/mysql v1.4.1
github.com/gogo/protobuf v1.3.1
github.com/golang/protobuf v1.3.2
github.com/golang/protobuf v1.3.3
github.com/google/go-querystring v1.0.0 // indirect
github.com/googleapis/gnostic v0.3.1 // indirect
github.com/gophercloud/gophercloud v0.7.0 // indirect
Expand All @@ -36,12 +37,13 @@ require (
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect
github.com/klauspost/compress v1.9.7 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/kr/pretty v0.2.0 // indirect
github.com/lib/pq v1.3.0 // indirect
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/minio/minio-go v6.0.14+incompatible // indirect
github.com/mitchellh/go-ps v0.0.0-20190716172923-621e5597135b
github.com/moul/http2curl v1.0.0 // indirect
github.com/pkg/errors v0.8.1
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.0.0
github.com/prometheus/client_model v0.1.0 // indirect
github.com/prometheus/common v0.7.0 // indirect
Expand All @@ -65,19 +67,20 @@ require (
github.com/yudai/gojsondiff v0.0.0-20170107030110-7b1b7adf999d // indirect
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
github.com/yudai/pp v2.0.1+incompatible // indirect
golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553
golang.org/x/oauth2 v0.0.0-20200107160858-eca82077e2d1 // indirect
golang.org/x/sys v0.0.0-20200107162124-548cf772de50 // indirect
golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb
google.golang.org/grpc v1.26.0
gopkg.in/gavv/httpexpect.v2 v2.0.0
gopkg.in/ini.v1 v1.51.1 // indirect
gopkg.in/ini.v1 v1.52.0 // indirect
gopkg.in/jcmturner/goidentity.v2 v2.0.0 // indirect
gopkg.in/jcmturner/gokrb5.v5 v5.3.0
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect
gopkg.in/src-d/go-git.v4 v4.13.1
gopkg.in/yaml.v2 v2.2.8 // indirect
k8s.io/api v0.0.0-20191219150132-17cfeff5d095
k8s.io/apimachinery v0.16.7-beta.0
k8s.io/client-go v0.0.0-20191225075139-73fd2ddc9180
Expand Down
Loading

0 comments on commit aa05234

Please sign in to comment.