Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Add Velero definition #7

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions definitions/velero/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# velero

This [Fabrikate](https://github.com/microsoft/fabrikate) definition generates the Kubernetes resource manifests for [Velero](https://github.com/heptio/velero).

## Usage

Follow the [Velero instructions](https://heptio.github.io/velero/v0.11.0/install-overview) for installing Velero and collect for the configuration you need to use Velero on your target cloud platform.

For example, for the Azure cloud platform you will need to apply the following configuration to Velero as part of a config file (where `velero` is the subcomponent):

```
velero:
config:
azure:
clientId: <client id>
clientSecret: <client secret>
subscriptionId: <subscription id>
tenantId: <tenant id>

storageResourceGroup: <backup storage resource group>
storageAccount: <storage account>
container: <storage container>
```
2 changes: 2 additions & 0 deletions definitions/velero/chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: velero
version: 1.0.0
63 changes: 63 additions & 0 deletions definitions/velero/chart/templates/00-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Copyright 2017 the Velero 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: apps/v1beta1
kind: Deployment
metadata:
namespace: velero
name: velero
spec:
replicas: 1
template:
metadata:
labels:
component: velero
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8085"
prometheus.io/path: "/metrics"
spec:
restartPolicy: Always
serviceAccountName: velero
containers:
- name: velero
image: gcr.io/heptio-images/velero:v1.0.0-alpha.1
ports:
- name: metrics
containerPort: 8085
command:
- /velero
args:
- server
## uncomment following line and specify values if needed for multiple provider snapshot locations
# - --default-volume-snapshot-locations=<provider-1:location-1,provider-2:location-2,...>
envFrom:
- secretRef:
name: cloud-credentials
env:
- name: VELERO_SCRATCH_DIR
value: /scratch
volumeMounts:
- name: plugins
mountPath: /plugins
- name: scratch
mountPath: /scratch
volumes:
- name: plugins
emptyDir: {}
- name: scratch
emptyDir: {}
nodeSelector:
beta.kubernetes.io/os: linux
208 changes: 208 additions & 0 deletions definitions/velero/chart/templates/00-prereqs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
# Copyright 2017 the Velero 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: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: backups.velero.io
labels:
component: velero
spec:
group: velero.io
version: v1
scope: Namespaced
names:
plural: backups
kind: Backup

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: schedules.velero.io
labels:
component: velero
spec:
group: velero.io
version: v1
scope: Namespaced
names:
plural: schedules
kind: Schedule

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: restores.velero.io
labels:
component: velero
spec:
group: velero.io
version: v1
scope: Namespaced
names:
plural: restores
kind: Restore

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: downloadrequests.velero.io
labels:
component: velero
spec:
group: velero.io
version: v1
scope: Namespaced
names:
plural: downloadrequests
kind: DownloadRequest

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: deletebackuprequests.velero.io
labels:
component: velero
spec:
group: velero.io
version: v1
scope: Namespaced
names:
plural: deletebackuprequests
kind: DeleteBackupRequest

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: podvolumebackups.velero.io
labels:
component: velero
spec:
group: velero.io
version: v1
scope: Namespaced
names:
plural: podvolumebackups
kind: PodVolumeBackup

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: podvolumerestores.velero.io
labels:
component: velero
spec:
group: velero.io
version: v1
scope: Namespaced
names:
plural: podvolumerestores
kind: PodVolumeRestore

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: resticrepositories.velero.io
labels:
component: velero
spec:
group: velero.io
version: v1
scope: Namespaced
names:
plural: resticrepositories
kind: ResticRepository

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: backupstoragelocations.velero.io
labels:
component: velero
spec:
group: velero.io
version: v1
scope: Namespaced
names:
plural: backupstoragelocations
kind: BackupStorageLocation

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: volumesnapshotlocations.velero.io
labels:
component: velero
spec:
group: velero.io
version: v1
scope: Namespaced
names:
plural: volumesnapshotlocations
kind: VolumeSnapshotLocation

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: serverstatusrequests.velero.io
labels:
component: velero
spec:
group: velero.io
version: v1
scope: Namespaced
names:
plural: serverstatusrequests
kind: ServerStatusRequest
---
apiVersion: v1
kind: Namespace
metadata:
name: velero

---
apiVersion: v1
kind: ServiceAccount
metadata:
name: velero
namespace: velero
labels:
component: velero

---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: velero
labels:
component: velero
subjects:
- kind: ServiceAccount
namespace: velero
name: velero
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
12 changes: 12 additions & 0 deletions definitions/velero/chart/templates/00-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
name: cloud-credentials
namespace: velero
type: Opaque
data:
AZURE_SUBSCRIPTION_ID: {{.Values.azure.subscriptionId | b64enc | quote }}
AZURE_TENANT_ID: {{.Values.azure.tenantId | b64enc | quote }}
AZURE_CLIENT_ID: {{.Values.azure.clientId | b64enc | quote }}
AZURE_CLIENT_SECRET: {{.Values.azure.clientSecret | b64enc | quote }}
AZURE_RESOURCE_GROUP: {{.Values.azure.clusterResourceGroup| b64enc | quote }}
27 changes: 27 additions & 0 deletions definitions/velero/chart/templates/05-backupstoragelocation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2018 the Velero 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: velero.io/v1
kind: BackupStorageLocation
metadata:
name: default
namespace: velero
spec:
provider: azure
objectStorage:
bucket: {{.Values.azure.container}}
config:
resourceGroup: {{.Values.azure.storageResourceGroup}}
storageAccount: {{.Values.azure.storageAccount}}
24 changes: 24 additions & 0 deletions definitions/velero/chart/templates/06-volumesnapshotlocation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2018 the Velero 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: velero.io/v1
kind: VolumeSnapshotLocation
metadata:
name: azure-default
namespace: velero
spec:
provider: azure
config:
apiTimeout: "2m0s"
Loading