Skip to content

Commit

Permalink
schema update for repeat strategy and add includedHours (#9)
Browse files Browse the repository at this point in the history
* schema update for repeat strategy and add includedHours

Signed-off-by: Sanjay Nathani <[email protected]>

* updating crd and removing instanceCount field from spec

Signed-off-by: Sanjay Nathani <[email protected]>
  • Loading branch information
Sanjay1611 authored Sep 14, 2020
1 parent 3cdea5c commit a2e849a
Show file tree
Hide file tree
Showing 10 changed files with 447 additions and 145 deletions.
17 changes: 10 additions & 7 deletions deploy/crds/chaosschedule_cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ metadata:
name: schedule-nginx
spec:
schedule:
type: "now"
executionTime: "2020-05-11T20:30:00Z" #should be set for type=once
startTime: "2020-05-12T05:47:00Z" #should be modified according to current UTC Time, for type=repeat
endTime: "2020-05-12T05:52:00Z" #should be modified according to current UTC Time, for type=repeat
minChaosInterval: "2m" #format should be like "10m" or "2h" accordingly for minutes and hours, for type=repeat
instanceCount: "2" #should be set for type=repeat
includedDays: "mon,tue,wed" #should be set for type=repeat
repeat:
timeRange:
# startTime: "2020-05-12T05:47:00Z" #should be modified according to current UTC Time, for type=repeat
endTime: "2020-09-13T02:58:00Z" #should be modified according to current UTC Time, for type=repeat
properties:
minChaosInterval: "2m" #format should be like "10m" or "2h" accordingly for minutes and hours, for type=repeat
workHours:
includedHours: 0-12
workDays:
includedDays: "Mon,Tue,Wed,Sat,Sun" #should be set for type=repeat
engineTemplateSpec:
appinfo:
appns: 'default'
Expand Down
240 changes: 193 additions & 47 deletions deploy/crds/chaosschedule_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,88 +29,212 @@ spec:
spec:
type: object
properties:
chaosServiceAccount:
type: string
engineTemplateSpec:
type: object
properties:
monitoring:
type: boolean
jobCleanUpPolicy:
type: string
pattern: "^(delete|retain)$"
annotationCheck:
pattern: ^(true|false)$
type: string
pattern: "^(true|false)$"
appinfo:
type: object
properties:
appkind:
pattern: ^(deployment|statefulset|daemonset)$
type: string
pattern: "^(deployment|statefulset|daemonset|deploymentconfig)$"
applabel:
pattern: "([a-z0-9A-Z_\\.-/]+)=([a-z0-9A-Z_\\.-/_]+)"
type: string
appns:
type: string
type: object
auxiliaryAppInfo:
type: string
engineState:
type: string
pattern: "^(active|stop|initialized|stopped)$"
chaosServiceAccount:
type: string
components:
type: object
properties:
monitor:
properties:
image:
type: string
type: object
runner:
type: object
properties:
image:
type: string
type:
pattern: ^(go|ansible)$
type: string
type: object
type: object
pattern: "^(go)$"
runnerannotation:
type: object
additionalProperties:
type: string
properties:
key:
type: string
minLength: 1
allowEmptyValue: false
value:
type: string
minLength: 1
allowEmptyValue: false
experiments:
type: array
items:
type: object
properties:
name:
type: string
spec:
type: object
properties:
components:
properties:
configMaps:
items:
k8sProbe:
type: array
items:
type: object
properties:
name:
type: string
inputs:
type: object
properties:
mountPath:
command:
type: object
properties:
group:
type: string
version:
type: string
resource:
type: string
namespace:
type: string
fieldSelector:
type: string
expectedResult:
type: string
name:
runProperties:
type: object
properties:
probeTimeout:
type: integer
interval:
type: integer
retry:
type: integer
mode:
type: string
cmdProbe:
type: array
items:
type: object
properties:
name:
type: string
inputs:
type: object
properties:
command:
type: string
expectedResult:
type: string
source:
type: string
runProperties:
type: object
type: array
properties:
probeTimeout:
type: integer
interval:
type: integer
retry:
type: integer
mode:
type: string
httpProbe:
type: array
items:
type: object
properties:
name:
type: string
inputs:
type: object
properties:
url:
type: string
expectedResponseCode:
type: string
runProperties:
type: object
properties:
probeTimeout:
type: integer
interval:
type: integer
retry:
type: integer
mode:
type: string
components:
type: object
properties:
statusCheckTimeouts:
type: object
properties:
delay:
type: integer
timeout:
type: integer
nodeSelector:
type: object
minLength: 1
experimentImage:
type: string
env:
type: array
items:
type: object
properties:
name:
type: string
value:
type: string
type: object
configMaps:
type: array
secrets:
items:
type: object
properties:
name:
type: string
mountPath:
type: string
secrets:
type: array
items:
type: object
properties:
name:
type: string
type: object
type: array
type: object
type: object
type: object
type: array
jobCleanUpPolicy:
pattern: ^(delete|retain)$
type: string
monitoring:
type: boolean
mountPath:
type: string
experimentannotation:
type: object
additionalProperties:
type: string
properties:
key:
type: string
minLength: 1
allowEmptyValue: false
value:
type: string
minLength: 1
allowEmptyValue: false
schedule:
oneOf:
- required:
Expand All @@ -130,21 +254,43 @@ spec:
type: object
repeat:
properties:
endTime:
format: date-time
type: date
includedDays:
pattern: ((Mon|Tue|Wed|Thu|Fri|Sat|Sun)(,))*(Mon|Tue|Wed|Thu|Fri|Sat|Sun)
type: string
instances:
type: number
minChaosInterval:
pattern: (([1-6][0-9]|[1-9])m)|(\d+h)
type: string
startTime:
format: date-time
type: date
timeRange:
properties:
endTime:
format: date-time
type: date
startTime:
format: date-time
type: date
type: object
workkHours:
properties:
includedHours:
type: string
type: object
required:
- includedHours
workDays:
properties:
includedDays:
pattern: ((Mon|Tue|Wed|Thu|Fri|Sat|Sun)(,))*(Mon|Tue|Wed|Thu|Fri|Sat|Sun)
type: string
type: object
required:
- includedDays
properties:
properties:
minChaosInterval:
pattern: (([1-6][0-9]|[1-9])m)|(\d+h)
type: string
random:
type: boolean
type: object
required:
- minChaosInterval
type: object
required:
- properties
type: object
status:
type: object
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ require (
github.com/operator-framework/operator-sdk v0.15.2
github.com/robfig/cron/v3 v3.0.1
github.com/spf13/pflag v1.0.5
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/tools v0.0.0-20200911193555-6422fca01df9 // indirect
k8s.io/api v0.0.0
k8s.io/apimachinery v0.0.0
k8s.io/client-go v12.0.0+incompatible
Expand Down
Loading

0 comments on commit a2e849a

Please sign in to comment.