-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Carlisia <[email protected]>
- Loading branch information
Showing
31 changed files
with
1,598 additions
and
14 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
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
File renamed without changes.
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,59 @@ | ||
# Ark Volume Snapshot Location | ||
|
||
## Volume Snapshot Location | ||
|
||
A volume snapshot location is the location in which to store the volume snapshots created for a backup. | ||
|
||
Ark can be configured to take snapshots of volumes from multiple providers. Ark also allows you to configure multiple possible `VolumeSnapshotLocation` per provider, although you can only select one location per provider at backup time. | ||
|
||
Each VolumeSnapshotLocation describes a provider + location. These are represented in the cluster via the `VolumeSnapshotLocation` CRD. Ark must have at least one `VolumeSnapshotLocation` per cloud provider. | ||
|
||
A sample YAML `VolumeSnapshotLocation` looks like the following: | ||
|
||
```yaml | ||
apiVersion: ark.heptio.com/v1 | ||
kind: VolumeSnapshotLocation | ||
metadata: | ||
name: aws-default | ||
namespace: heptio-ark | ||
spec: | ||
provider: aws | ||
config: | ||
region: us-west-2 | ||
``` | ||
### Parameter Reference | ||
The configurable parameters are as follows: | ||
#### Main config parameters | ||
| Key | Type | Default | Meaning | | ||
| --- | --- | --- | --- | | ||
| `provider` | String (Ark natively supports `aws`, `gcp`, and `azure`. Other providers may be available via external plugins.)| Required Field | The name for whichever cloud provider will be used to actually store the volume. | | ||
| `config` | See the corresponding [AWS][0], [GCP][1], and [Azure][2]-specific configs or your provider's documentation. | ||
|
||
#### AWS | ||
|
||
##### config | ||
|
||
| Key | Type | Default | Meaning | | ||
| --- | --- | --- | --- | | ||
| `region` | string | Empty | *Example*: "us-east-1"<br><br>See [AWS documentation][3] for the full list.<br><br>Queried from the AWS S3 API if not provided. | | ||
|
||
#### Azure | ||
|
||
##### config | ||
|
||
| Key | Type | Default | Meaning | | ||
| --- | --- | --- | --- | | ||
| `apiTimeout` | metav1.Duration | 2m0s | How long to wait for an Azure API request to complete before timeout. | | ||
|
||
#### GCP | ||
|
||
No parameters required. | ||
|
||
[0]: #aws | ||
[1]: #gcp | ||
[2]: #azure | ||
[3]: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-available-regions |
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
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
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
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
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,24 @@ | ||
# Copyright 2018 the Heptio Ark contributors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
--- | ||
apiVersion: ark.heptio.com/v1 | ||
kind: VolumeSnapshotLocation | ||
metadata: | ||
name: aws-default | ||
namespace: heptio-ark | ||
spec: | ||
provider: aws | ||
config: | ||
region: <YOUR_REGION> |
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,24 @@ | ||
# Copyright 2018 the Heptio Ark contributors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
--- | ||
apiVersion: ark.heptio.com/v1 | ||
kind: VolumeSnapshotLocation | ||
metadata: | ||
name: azure-default | ||
namespace: heptio-ark | ||
spec: | ||
provider: azure | ||
config: | ||
apiTimeout: 2m0s |
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
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,22 @@ | ||
# Copyright 2018 the Heptio Ark contributors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
--- | ||
apiVersion: ark.heptio.com/v1 | ||
kind: VolumeSnapshotLocation | ||
metadata: | ||
name: gcp-default | ||
namespace: heptio-ark | ||
spec: | ||
provider: gcp |
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
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
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,89 @@ | ||
/* | ||
Copyright 2018 the Heptio Ark contributors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1 | ||
|
||
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
||
// +genclient | ||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// VolumeSnapshot represents a snapshot of a persistent volume | ||
type VolumeSnapshot struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata"` | ||
|
||
Spec VolumeSnapshotSpec `json:"spec"` | ||
Status VolumeSnapshotStatus `json:"status"` | ||
} | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// VolumeSnapshotList is a list of VolumeSnapshots. | ||
type VolumeSnapshotList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata"` | ||
Items []VolumeSnapshot `json:"items"` | ||
} | ||
|
||
// VolumeSnapshotSpec defines the specification for an Ark VolumeSnapshot. | ||
type VolumeSnapshotSpec struct { | ||
// Type is the type of the disk/volume in the cloud provider | ||
// API. | ||
Type string `json:"type"` | ||
|
||
// AvailabilityZone is the where the volume is provisioned | ||
// in the cloud provider. | ||
AvailabilityZone string `json:"availabilityZone,omitempty"` | ||
|
||
// Iops is the optional value of provisioned IOPS for the | ||
// disk/volume in the cloud provider API. | ||
Iops *int64 `json:"iops,omitempty"` | ||
|
||
// Backup is a string containing the name of name of the Ark backup this snapshot is associated with. | ||
Backup string `json:"backup"` | ||
|
||
// Location is the name of the VolumeSnapshotLocation where this snapshot is stored. | ||
Location string `json:"location"` | ||
} | ||
|
||
// VolumeSnapshotStatus captures the current status of an Ark VolumeSnapshot. | ||
type VolumeSnapshotStatus struct { | ||
// SnapshotID is the UUID generated by Ark. | ||
SnapshotID string `json:"snapshotID"` | ||
|
||
// ProviderSnapshotID is the ID of the snapshot taken in the cloud | ||
// provider API of this volume. | ||
ProviderSnapshotID string `json:"providerSnapshotID"` | ||
|
||
// Phase is the current state of the VolumeSnapshot. | ||
Phase VolumeSnapshotPhase `json:"phase,omitempty"` | ||
} | ||
|
||
// VolumeSnapshotPhase is the lifecyle phase of an Ark VolumeSnapshot. | ||
type VolumeSnapshotPhase string | ||
|
||
const ( | ||
// VolumeSnapshotPhaseNew means the volume snapshot has been created but not | ||
// yet processed by the VolumeSnapshotController. | ||
VolumeSnapshotPhaseNew VolumeSnapshotPhase = "New" | ||
|
||
// VolumeSnapshotPhaseCompleted means the volume snapshot was successfully created and can be restored from.. | ||
VolumeSnapshotPhaseCompleted VolumeSnapshotPhase = "Completed" | ||
|
||
// VolumeSnapshotPhaseFailed means the volume snapshot was unable to execute. | ||
VolumeSnapshotPhaseFailed VolumeSnapshotPhase = "Failed" | ||
) |
Oops, something went wrong.