-
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.
Merge pull request #948 from heptio/snapshot-locations
Add VolumeSnapshotLocations support
- Loading branch information
Showing
67 changed files
with
2,945 additions
and
1,298 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,60 @@ | ||
# 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. | | ||
| `resourceGroup` | string | Optional | The name of the resource group where volume snapshots should be stored, if different from the cluster's resource group. | | ||
|
||
#### 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,65 @@ | ||
/* | ||
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 | ||
|
||
// VolumeSnapshotLocation is a location where Ark stores volume snapshots. | ||
type VolumeSnapshotLocation struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata"` | ||
|
||
Spec VolumeSnapshotLocationSpec `json:"spec"` | ||
Status VolumeSnapshotLocationStatus `json:"status"` | ||
} | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// VolumeSnapshotLocationList is a list of VolumeSnapshotLocations. | ||
type VolumeSnapshotLocationList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata"` | ||
Items []VolumeSnapshotLocation `json:"items"` | ||
} | ||
|
||
// VolumeSnapshotLocationSpec defines the specification for an Ark VolumeSnapshotLocation. | ||
type VolumeSnapshotLocationSpec struct { | ||
// Provider is the provider of the volume storage. | ||
Provider string `json:"provider"` | ||
|
||
// Config is for provider-specific configuration fields. | ||
Config map[string]string `json:"config"` | ||
} | ||
|
||
// VolumeSnapshotLocationPhase is the lifecyle phase of an Ark VolumeSnapshotLocation. | ||
type VolumeSnapshotLocationPhase string | ||
|
||
const ( | ||
// VolumeSnapshotLocationPhaseAvailable means the location is available to read and write from. | ||
VolumeSnapshotLocationPhaseAvailable VolumeSnapshotLocationPhase = "Available" | ||
|
||
// VolumeSnapshotLocationPhaseUnavailable means the location is unavailable to read and write from. | ||
VolumeSnapshotLocationPhaseUnavailable VolumeSnapshotLocationPhase = "Unavailable" | ||
) | ||
|
||
// VolumeSnapshotLocationStatus describes the current status of an Ark VolumeSnapshotLocation. | ||
type VolumeSnapshotLocationStatus struct { | ||
Phase VolumeSnapshotLocationPhase `json:"phase,omitempty"` | ||
} |
Oops, something went wrong.