Skip to content

Commit

Permalink
Merge pull request #167 from kanisterio/sync
Browse files Browse the repository at this point in the history
Initial failure domain support; Initial function cancellation support; CSI improvements; Google Regional Disk Support;
  • Loading branch information
SupriyaKasten committed Apr 26, 2019
2 parents ae6a06c + 2e35b79 commit 99ebec3
Show file tree
Hide file tree
Showing 59 changed files with 3,107 additions and 452 deletions.
2 changes: 1 addition & 1 deletion docker/tools/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM busybox:glibc as restbox

# Get restic executable
ENV RESTIC_VERSION=0.9.4
ENV RESTIC_VERSION=0.9.5
ADD https://github.com/restic/restic/releases/download/v${RESTIC_VERSION}/restic_${RESTIC_VERSION}_linux_amd64.bz2 /
RUN bzip2 -d restic_${RESTIC_VERSION}_linux_amd64.bz2 && mv restic_${RESTIC_VERSION}_linux_amd64 /bin/restic && chmod +x /bin/restic

Expand Down
13 changes: 13 additions & 0 deletions docs/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,19 @@ Blueprint phase along with its state of execution and output.
Output map[string]interface{} `json:"output"`
}
Deleting an ActionSet will cause the controller to delete the ActionSet,
which will stop the execution of the actions.

.. code-block:: bash
$ kubectl --namespace kanister delete actionset s3backup-j4z6f
actionset.cr.kanister.io "s3backup-j4z6f" deleted
.. note::
Since ActionSets are `Custom Resources`, Kubernetes allows users to delete them like any other API objects.
Currently, `deleting` an ActionSet to stop execution is an **alpha** feature.

.. _profiles:

Profiles
Expand Down
94 changes: 76 additions & 18 deletions docs/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ This function backs up data from a container into an S3 compatible object store.
sidecar container. This sidecar is necessary to run the
tools that capture path on a volume and store it on the object store.

Arguments:

.. csv-table::
:header: "Argument", "Required", "Type", "Description"
:align: left
Expand All @@ -279,22 +281,37 @@ This function backs up data from a container into an S3 compatible object store.
`container`, Yes, `string`, container in which to execute
`includePath`, Yes, `string`, path of the data to be backed up
`backupArtifactPrefix`, Yes, `string`, path to store the backup on the object store
`backupIdentifier`, Yes, `string`, unique string to identify the backup

Outputs:

.. csv-table::
:header: "Output", "Type", "Description"
:align: left
:widths: 5,5,15

`backupTag`,`string`, unique tag added to the backup

Example:

.. code-block:: yaml
:linenos:
- func: BackupData
name: BackupToObjectStore
args:
namespace: "{{ .Deployment.Namespace }}"
pod: "{{ index .Deployment.Pods 0 }}"
container: kanister-tools
includePath: /mnt/data
backupArtifactPrefix: s3-bucket/path/artifactPrefix
backupIdentifier: "{{ .Time }}"
actions:
backup:
type: Deployment
outputArtifacts:
backupInfo:
keyValue:
backupIdentifier: "{{ .Phases.BackupToObjectStore.Output.backupTag }}"
phases:
- func: BackupData
name: BackupToObjectStore
args:
namespace: "{{ .Deployment.Namespace }}"
pod: "{{ index .Deployment.Pods 0 }}"
container: kanister-tools
includePath: /mnt/data
backupArtifactPrefix: s3-bucket/path/artifactPrefix
.. _restoredata:

Expand Down Expand Up @@ -322,7 +339,7 @@ and restores data to the specified path.
`namespace`, Yes, `string`, namespace in which to execute
`image`, Yes, `string`, image to be used for running restore
`backupArtifactPrefix`, Yes, `string`, path to the backup on the object store
`backupIdentifier`, Yes, `string`, unique string to identify the backup
`backupTag`, Yes, `string`, unique tag added during the backup
`restorePath`, No, `string`, path where data is restored
`pod`, No, `string`, pod to which the volumes are attached
`volumes`, No, `map[string]string`, Mapping of `pvcName` to `mountPath` under which the volume will be available
Expand All @@ -336,6 +353,11 @@ and restores data to the specified path.

Example:

Consider a scenario where you wish to restore the data backed up by the
:ref:`backupdata` function. We will first scale down the application,
restore the data and then scale it back up.
For this phase, we will use the `backupInfo` Artifact provided by backup function.

.. code-block:: yaml
:linenos:
Expand All @@ -344,7 +366,7 @@ Example:
args:
namespace: "{{ .Deployment.Namespace }}"
name: "{{ .Deployment.Name }}"
kind: deployment
kind: Deployment
replicas: 0
- func: RestoreData
name: RestoreFromObjectStore
Expand All @@ -353,7 +375,14 @@ Example:
pod: "{{ index .Deployment.Pods 0 }}"
image: kanisterio/kanister-tools:0.18.0
backupArtifactPrefix: s3-bucket/path/artifactPrefix
backupIdentifier: "{{ .Time }}"
backupTag: "{{ .ArtifactsIn.backupInfo.KeyValue.backupIdentifier }}"
- func: ScaleWorkload
name: StartupApplication
args:
namespace: "{{ .Deployment.Namespace }}"
name: "{{ .Deployment.Name }}"
kind: Deployment
replicas: 1
CopyVolumeData
--------------
Expand Down Expand Up @@ -388,7 +417,7 @@ Outputs:
:widths: 5,5,15

`backupArtifactLocation`,`string`, location in objectstore where data was copied
`backupID`,`string`, unique string to identify this data copy
`backupTag`,`string`, unique string to identify this data copy

Example:

Expand All @@ -406,6 +435,37 @@ If the ActionSet `Object` is a PersistentVolumeClaim:
DeleteData
----------

This function deletes the snapshot data backed up by the BackupData function.


.. csv-table::
:header: "Argument", "Required", "Type", "Description"
:align: left
:widths: 5,5,5,15

`namespace`, Yes, `string`, namespace in which to execute
`backupArtifactPrefix`, Yes, `string`, path to the backup on the object store
`backupTag`, Yes, `string`, unique tag added during the backup

Example:

Consider a scenario where you wish to delete the data backed up by the
:ref:`backupdata` function.
For this phase, we will use the `backupInfo` Artifact provided by backup function.

.. code-block:: yaml
:linenos:
- func: DeleteData
name: DeleteFromObjectStore
args:
namespace: "{{ .Namespace.Name }}"
backupArtifactPrefix: s3-bucket/path/artifactPrefix
backupTag: "{{ .ArtifactsIn.backupInfo.KeyValue.backupIdentifier }}"
LocationDelete
--------------

This function uses a new Pod to delete the specified artifact
from an S3 compatible object store.

Expand All @@ -414,7 +474,6 @@ from an S3 compatible object store.
:align: left
:widths: 5,5,5,15

`namespace`, No, `string`, namespace in which to execute
`artifact`, Yes, `string`, artifact to be deleted from the object store

.. note::
Expand All @@ -427,10 +486,9 @@ Example:
.. code-block:: yaml
:linenos:
- func: DeleteData
name: DeleteFromObjectStore
- func: LocationDelete
name: LocationDeleteFromObjectStore
args:
namespace: "{{ .Deployment.Namespace }}"
artifact: s3://bucket/path/artifact
.. _createvolumesnapshot:
Expand Down
4 changes: 4 additions & 0 deletions docs/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Walkthrough
Workflow
args
aws
boolean
helm
kanctl
kanister
Expand All @@ -15,11 +16,14 @@ namespace
outputArtifact
param
params
pluggable
prepopulated
repo
runtime
schemas
stateful
stdout
subcommand
templating
defaultProfile
Kando
Expand Down
5 changes: 2 additions & 3 deletions examples/time-log/blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ actions:
inputArtifactNames:
- timeLog
phases:
- func: DeleteData
name: deleteFromS3
- func: LocationDelete
name: LocationDeleteFromS3
args:
namespace: "{{ .Deployment.Namespace }}"
artifact: "{{ .ArtifactsIn.timeLog.KeyValue.path }}"
Loading

0 comments on commit 99ebec3

Please sign in to comment.