Skip to content

Commit

Permalink
Add probe and BackupBatch api (#890)
Browse files Browse the repository at this point in the history
- Add Prebackup & PostBackup hooks to BackupConfiguration  …
- Add BackupBatch type

Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha authored Oct 9, 2019
1 parent 149cf02 commit 675769a
Show file tree
Hide file tree
Showing 29 changed files with 6,205 additions and 109 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ gen-crds:
$(CRD_OPTIONS) \
paths="./apis/..." \
output:crd:artifacts:config=api/crds
@rm -rf api/crds/stash.appscode.com_backupconfigurationtemplates.yaml

.PHONY: label-crds
label-crds: $(BUILD_DIRS)
Expand Down
3,791 changes: 3,791 additions & 0 deletions api/crds/stash.appscode.com_backupbatches.yaml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions api/crds/stash.appscode.com_backupblueprints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3883,6 +3883,8 @@ spec:
- value
type: object
type: array
required:
- name
type: object
tempDir:
description: Temp directory configuration for functions/sidecar An `EmptyDir`
Expand Down
172 changes: 172 additions & 0 deletions api/crds/stash.appscode.com_backupconfigurations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,175 @@ spec:
the target. Supported values are "Restic", "VolumeSnapshotter". Default
value is "Restic".
type: string
hooks:
description: Actions that Stash should take in response to backup sessions.
Cannot be updated.
properties:
postBackup:
description: PostBackup is called immediately after a backup session
is complete.
properties:
exec:
description: One and only one of the following should be specified.
Exec specifies the action to take.
properties:
command:
description: Command is the command line to execute inside
the container, the working directory for the command is
root ('/') in the container's filesystem. The command
is simply exec'd, it is not run inside a shell, so traditional
shell instructions ('|', etc) won't work. To use a shell,
you need to explicitly call out to that shell. Exit status
of 0 is treated as live/healthy and non-zero is unhealthy.
items:
type: string
type: array
type: object
httpGet:
description: HTTPGet specifies the http request to perform.
properties:
host:
description: Host name to connect to, defaults to the pod
IP. You probably want to set "Host" in httpHeaders instead.
type: string
httpHeaders:
description: Custom headers to set in the request. HTTP
allows repeated headers.
items:
description: HTTPHeader describes a custom header to be
used in HTTP probes
properties:
name:
description: The header field name
type: string
value:
description: The header field value
type: string
required:
- name
- value
type: object
type: array
path:
description: Path to access on the HTTP server.
type: string
port:
anyOf:
- type: string
- type: integer
description: Name or number of the port to access on the
container. Number must be in the range 1 to 65535. Name
must be an IANA_SVC_NAME.
scheme:
description: Scheme to use for connecting to the host. Defaults
to HTTP.
type: string
required:
- port
type: object
tcpSocket:
description: 'TCPSocket specifies an action involving a TCP
port. TCP hooks not yet supported TODO: implement a realistic
TCP lifecycle hook'
properties:
host:
description: 'Optional: Host name to connect to, defaults
to the pod IP.'
type: string
port:
anyOf:
- type: string
- type: integer
description: Number or name of the port to access on the
container. Number must be in the range 1 to 65535. Name
must be an IANA_SVC_NAME.
required:
- port
type: object
type: object
preBackup:
description: PreBackup is called immediately before a backup session
is initiated.
properties:
exec:
description: One and only one of the following should be specified.
Exec specifies the action to take.
properties:
command:
description: Command is the command line to execute inside
the container, the working directory for the command is
root ('/') in the container's filesystem. The command
is simply exec'd, it is not run inside a shell, so traditional
shell instructions ('|', etc) won't work. To use a shell,
you need to explicitly call out to that shell. Exit status
of 0 is treated as live/healthy and non-zero is unhealthy.
items:
type: string
type: array
type: object
httpGet:
description: HTTPGet specifies the http request to perform.
properties:
host:
description: Host name to connect to, defaults to the pod
IP. You probably want to set "Host" in httpHeaders instead.
type: string
httpHeaders:
description: Custom headers to set in the request. HTTP
allows repeated headers.
items:
description: HTTPHeader describes a custom header to be
used in HTTP probes
properties:
name:
description: The header field name
type: string
value:
description: The header field value
type: string
required:
- name
- value
type: object
type: array
path:
description: Path to access on the HTTP server.
type: string
port:
anyOf:
- type: string
- type: integer
description: Name or number of the port to access on the
container. Number must be in the range 1 to 65535. Name
must be an IANA_SVC_NAME.
scheme:
description: Scheme to use for connecting to the host. Defaults
to HTTP.
type: string
required:
- port
type: object
tcpSocket:
description: 'TCPSocket specifies an action involving a TCP
port. TCP hooks not yet supported TODO: implement a realistic
TCP lifecycle hook'
properties:
host:
description: 'Optional: Host name to connect to, defaults
to the pod IP.'
type: string
port:
anyOf:
- type: string
- type: integer
description: Number or name of the port to access on the
container. Number must be in the range 1 to 65535. Name
must be an IANA_SVC_NAME.
required:
- port
type: object
type: object
type: object
interimVolumeTemplate:
description: InterimVolumeTemplate specifies a template for a volume
to hold targeted data temporarily before uploading to backend or inserting
Expand Down Expand Up @@ -2640,6 +2809,7 @@ spec:
type: object
type: object
schedule:
description: Schedule specifies the schedule for invoking backup sessions
type: string
target:
description: Target specify the backup target
Expand Down Expand Up @@ -2733,6 +2903,8 @@ spec:
- value
type: object
type: array
required:
- name
type: object
tempDir:
description: Temp directory configuration for functions/sidecar An `EmptyDir`
Expand Down
21 changes: 19 additions & 2 deletions api/crds/stash.appscode.com_backupsessions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -415,14 +415,31 @@ spec:
spec:
properties:
backupConfiguration:
description: BackupConfiguration indicates the target BackupConfiguration
crd
description: 'BackupConfiguration indicates the target BackupConfiguration
crd Deprecated: Use Invoker'
properties:
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string
type: object
invoker:
description: Invoker refers to the BackupConfiguration or BackupBatch
being used to invoke this backup session
properties:
apiGroup:
description: APIGroup is the group for the resource being referenced
type: string
kind:
description: Kind is the type of resource being referenced
type: string
name:
description: Name is the name of resource being referenced
type: string
required:
- kind
- name
type: object
type: object
status:
properties:
Expand Down
2 changes: 2 additions & 0 deletions api/crds/stash.appscode.com_restoresessions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3332,6 +3332,8 @@ spec:
- value
type: object
type: array
required:
- name
type: object
tempDir:
description: Temp directory configuration for functions/sidecar An `EmptyDir`
Expand Down
Loading

0 comments on commit 675769a

Please sign in to comment.