From 26b940c81ca75507190e549a75acc3bc455cee1f Mon Sep 17 00:00:00 2001 From: Steve Kriss Date: Thu, 25 Apr 2019 13:09:58 -0600 Subject: [PATCH] copy examples/ dir as-is to release tarballs Signed-off-by: Steve Kriss --- .gitignore | 1 - .goreleaser.yml | 5 +- docs/aws-config.md | 2 +- docs/azure-config.md | 2 +- docs/gcp-config.md | 2 +- docs/get-started.md | 14 +-- docs/ibm-config.md | 2 +- docs/install-overview.md | 4 +- docs/troubleshooting.md | 3 +- examples/README.md | 12 +- examples/common/00-prereqs.yaml | 208 -------------------------------- examples/common/README.md | 10 -- hack/set-example-tags.sh | 37 ------ 13 files changed, 19 insertions(+), 283 deletions(-) delete mode 100644 examples/common/00-prereqs.yaml delete mode 100644 examples/common/README.md delete mode 100755 hack/set-example-tags.sh diff --git a/.gitignore b/.gitignore index 8c9eb8707..dfb45f682 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ _obj _test _output -config # Architecture specific extensions/prefixes *.[568vq] diff --git a/.goreleaser.yml b/.goreleaser.yml index 552367e8b..9ccf4629b 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -13,9 +13,6 @@ # limitations under the License. dist: _output -before: - hooks: - - ./hack/set-example-tags.sh builds: - main: ./cmd/velero/main.go env: @@ -45,7 +42,7 @@ archive: wrap_in_directory: true files: - LICENSE - - config/**/* + - examples/**/* checksum: name_template: 'CHECKSUM' release: diff --git a/docs/aws-config.md b/docs/aws-config.md index 5e2b3fbb2..0c678c5d2 100644 --- a/docs/aws-config.md +++ b/docs/aws-config.md @@ -298,7 +298,7 @@ It can be set up for Velero by creating a role that will have required permissio ## Installing the nginx example (optional) -If you run the nginx example, in file `config/nginx-app/with-pv.yaml`: +If you run the nginx example, in file `examples/nginx-app/with-pv.yaml`: * Replace `` with `gp2`. This is AWS's default `StorageClass` name. diff --git a/docs/azure-config.md b/docs/azure-config.md index a5568d046..92d42b2ee 100644 --- a/docs/azure-config.md +++ b/docs/azure-config.md @@ -151,7 +151,7 @@ For more complex installation needs, use either the Helm chart, or add `--dry-ru ## Installing the nginx example (optional) -If you run the nginx example, in file `config/nginx-app/with-pv.yaml`: +If you run the nginx example, in file `examples/nginx-app/with-pv.yaml`: * Replace `` with `default`. This is Azure's default `StorageClass` name. diff --git a/docs/gcp-config.md b/docs/gcp-config.md index c7c0436f5..35a47462f 100644 --- a/docs/gcp-config.md +++ b/docs/gcp-config.md @@ -130,7 +130,7 @@ For more complex installation needs, use either the Helm chart, or add `--dry-ru ## Installing the nginx example (optional) -If you run the nginx example, in file `config/nginx-app/with-pv.yaml`: +If you run the nginx example, in file `examples/nginx-app/with-pv.yaml`: * Replace `` with `standard`. This is GCP's default `StorageClass` name. diff --git a/docs/get-started.md b/docs/get-started.md index 499c9cd1e..e6f320a97 100644 --- a/docs/get-started.md +++ b/docs/get-started.md @@ -55,7 +55,7 @@ These instructions start the Velero server and a Minio instance that is accessib 1. Start the server and the local storage service. In the Velero directory, run: ```bash - kubectl apply -f config/minio/00-minio-deployment.yaml + kubectl apply -f examples/minio/00-minio-deployment.yaml velero install \ --provider aws \ @@ -75,7 +75,7 @@ These instructions start the Velero server and a Minio instance that is accessib 1. Deploy the example nginx application: ```bash - kubectl apply -f config/nginx-app/base.yaml + kubectl apply -f examples/nginx-app/base.yaml ``` 1. Check to see that both the Velero and nginx deployments are successfully created: @@ -183,14 +183,12 @@ Once fully removed, the backup is no longer visible when you run: velero backup get BACKUP_NAME ``` -If you want to uninstall Velero but preserve the backup data in object storage and persistent volume -snapshots, it is safe to remove the `velero` namespace and everything else created for this -example: +To completely uninstall Velero, minio, and the nginx example app from your Kubernetes cluster: ``` -kubectl delete -f config/common/ -kubectl delete -f config/minio/ -kubectl delete -f config/nginx-app/base.yaml +kubectl delete namespace/velero clusterrolebinding/velero +kubectl delete crds -l component=velero +kubectl delete -f examples/nginx-app/base.yaml ``` [31]: expose-minio.md diff --git a/docs/ibm-config.md b/docs/ibm-config.md index db32571cb..737e36524 100644 --- a/docs/ibm-config.md +++ b/docs/ibm-config.md @@ -75,7 +75,7 @@ For more complex installation needs, use either the Helm chart, or add `--dry-ru ## Installing the nginx example (optional) -If you run the nginx example, in file `config/nginx-app/with-pv.yaml`: +If you run the nginx example, in file `examples/nginx-app/with-pv.yaml`: * Replace `` with your `StorageClass` name. diff --git a/docs/install-overview.md b/docs/install-overview.md index 9ddafcb3f..ee23f4837 100644 --- a/docs/install-overview.md +++ b/docs/install-overview.md @@ -68,7 +68,7 @@ After you set up the Velero server, try these examples: 1. Start the sample nginx app: ```bash - kubectl apply -f config/nginx-app/base.yaml + kubectl apply -f examples/nginx-app/base.yaml ``` 1. Create a backup: @@ -98,7 +98,7 @@ After you set up the Velero server, try these examples: 1. Start the sample nginx app: ```bash - kubectl apply -f config/nginx-app/with-pv.yaml + kubectl apply -f examples/nginx-app/with-pv.yaml ``` 1. Create a backup with PV snapshotting: diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 0c70b876d..c845255df 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -49,8 +49,7 @@ Alternatively, you might be able to use the Service's `spec.loadBalancerIP` fiel ### Velero reports `custom resource not found` errors when starting up. -Velero's server will not start if the required Custom Resource Definitions are not found in Kubernetes. Apply -the `config/common/00-prereqs.yaml` file to create these definitions, then restart Velero. +Velero's server will not start if the required Custom Resource Definitions are not found in Kubernetes. Run `velero install` again to install any missing custom resource definitions. ### `velero backup logs` returns a `SignatureDoesNotMatch` error diff --git a/examples/README.md b/examples/README.md index 17d074b2a..b2d2b1a71 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,13 +1,11 @@ # Examples -This directory contains sample YAML config files for running Velero on each core provider. Starting with v0.10, these files are packaged into [the Velero release tarballs][2], and we highly recommend that you use the packaged versions of these files to ensure compatibility with the released code. +This directory contains sample YAML config files that can be used for exploring Velero. -* `common/`: Contains manifests to set up Velero. Can be used across cloud provider platforms. (Note that Azure requires its own deployment file due to its unique way of loading credentials). +* `minio/`: Used in the [Quickstart][0] to set up [Minio][1], a local S3-compatible object storage service. It provides a convenient way to test Velero without tying you to a specific cloud provider. -* `minio/`: Used in the [Quickstart][1] to set up [Minio][0], a local S3-compatible object storage service. It provides a convenient way to test Velero without tying you to a specific cloud provider. +* `nginx-app/`: A sample nginx app that can be used to test backups and restores. -* `aws/`, `azure/`, `gcp/`, `ibm/`: Contains manifests specific to the given cloud provider's setup. -[0]: https://github.com/minio/minio -[1]: /README.md#quickstart -[2]: https://github.com/heptio/velero/releases +[0]: /docs/get-started.md +[1]: https://github.com/minio/minio diff --git a/examples/common/00-prereqs.yaml b/examples/common/00-prereqs.yaml deleted file mode 100644 index 247b91ece..000000000 --- a/examples/common/00-prereqs.yaml +++ /dev/null @@ -1,208 +0,0 @@ -# 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 diff --git a/examples/common/README.md b/examples/common/README.md deleted file mode 100644 index 8cb41883e..000000000 --- a/examples/common/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# File Structure - -## 00-prereqs.yaml - -This file contains the prerequisites necessary to run the Velero server: - -- `velero` namespace -- `velero` service account -- RBAC rules to grant permissions to the `velero` service account -- CRDs for the Velero-specific resources (Backup, Schedule, Restore, etc.) diff --git a/hack/set-example-tags.sh b/hack/set-example-tags.sh deleted file mode 100755 index c8e6118c7..000000000 --- a/hack/set-example-tags.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -# 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. - -set -o nounset -set -o errexit -set -o pipefail - -GIT_TAG=$(git describe --tags --always) - -# this script copies all of the files under examples/ into a new directory, -# config/ (which is gitignored so it doesn't result in the git state being -# dirty, which would prevent goreleaser from running), and then updates all -# of the image tags in those files to use $GIT_TAG. - -rm -rf config/ && cp -r examples/ config/ - -# the "-i'.bak'" flag to sed is necessary, with no space between the flag -# and the value, for this to be compatible across BSD/OSX sed and GNU sed. -# remove the ".bak" files afterwards (they're copies of the originals). -find config/ -type f -name "*.yaml" | xargs sed -i'.bak' "s|gcr.io/heptio-images/velero:latest|gcr.io/heptio-images/velero:$GIT_TAG|g" -find config/ -type f -name "*.bak" | xargs rm - -find config/ -type f -name "*.yaml" | xargs sed -i'.bak' "s|gcr.io/heptio-images/fsfreeze-pause:latest|gcr.io/heptio-images/fsfreeze-pause:$GIT_TAG|g" -find config/ -type f -name "*.bak" | xargs rm