Skip to content

Commit

Permalink
[stable/velero] Upgrade Ark 0.10.x to Velero 0.11 (helm#12031)
Browse files Browse the repository at this point in the history
* Change Ark to Velero and upgrade from 0.10.1 to 0.11.0

Signed-off-by: Joe Gorse <joseph.gorseiii@emc.com>

* Change velero.heptio.com to velero.io

Signed-off-by: Joe Gorse <joseph.gorseiii@emc.com>

* Add CRD for serverstatusrequest

Fix version number of velero.

Signed-off-by: Aman Wangde <Aman.wangde@emc.com>

* Change namespace to 'velero'

Signed-off-by: Aman Wangde <Aman.wangde@emc.com>

* Fix README for upgrade instructions

Signed-off-by: Joe Gorse <joseph.gorseiii@emc.com>

* Add Ark back in

Signed-off-by: Ethan Kaley <ethan.kaley@emc.com>

* Deprecate the stable/Ark chart

Signed-off-by: Joe Gorse <joseph.gorseiii@emc.com>

* Fix version issues

Signed-off-by: Ethan Kaley <ethan.kaley@emc.com>

* Remove references to v0.10.x

Signed-off-by: Joe Gorse <joseph.gorseiii@emc.com>

* Fix indentation issue and add to restic-daemonset tpl

Signed-off-by: Joe Gorse <joseph.gorseiii@emc.com>

* Add missing newline

Move commented value example

Signed-off-by: Joe Gorse <joseph.gorseiii@emc.com>

* Bump Ark chart version for deprecation

Signed-off-by: Ethan Kaley <ethan.kaley@emc.com>

* Fix labels (#1)

* Fix labels

Signed-off-by: Ethan Kaley <ethan.kaley@emc.com>
Signed-off-by: Joe Gorse <joseph.gorseiii@emc.com>

* Use include instead of template function

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Remove  variables

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Use with and nindent

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Update API versions

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Updated Ark chart to a patch bump

Signed-off-by: Joe Gorse <joseph.gorseiii@emc.com>

* Add comments and fix NOTES template

Signed-off-by: Joe Gorse <joseph.gorseiii@emc.com>

* Fix deployment template for podAnnotations

Signed-off-by: Ethan Kaley <ethan.kaley@emc.com>
  • Loading branch information
josephgorse authored and k8s-ci-robot committed Apr 18, 2019
1 parent 6570c98 commit 56326b1
Show file tree
Hide file tree
Showing 30 changed files with 899 additions and 7 deletions.
13 changes: 6 additions & 7 deletions stable/ark/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
apiVersion: v1
appVersion: 0.10.2
description: A Helm chart for ark
## This Ark chart is deprecated because Ark has been renamed to Velero as of Velero version 0.11.0.
## This chart is no longer maintained. Use the stable/velero chart for future work.
## Please see the Helm deprecation policy in the PROCESSES.md file.
deprecated: true
description: DEPRECATED A Helm chart for ark
name: ark
version: 4.2.1
version: 4.2.2
home: https://github.com/heptio/ark
icon: https://cdn-images-1.medium.com/max/1600/1*-9mb3AKnKdcL_QD3CMnthQ.png
sources:
- https://github.com/heptio/ark
maintainers:
- name: domcar
email: d-caruso@hotmail.it
- name: unguiculus
email: unguiculus@gmail.com
tillerVersion: ">=2.10.0"
3 changes: 3 additions & 0 deletions stable/ark/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Ark-server

# THIS CHART HAS BEEN DEPRECATED. PLEASE MOVE TO THE STABLE/VELERO CHART.


This helm chart installs Ark version v0.10.2
https://github.com/heptio/ark/tree/v0.10.2

Expand Down
2 changes: 2 additions & 0 deletions stable/ark/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
THIS CHART HAS BEEN DEPRECATED. PLEASE MOVE TO THE STABLE/VELERO CHART.

Check that the ark is up and running:

Check that the secret has been created:
Expand Down
21 changes: 21 additions & 0 deletions stable/velero/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
15 changes: 15 additions & 0 deletions stable/velero/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
appVersion: 0.11.0
description: A Helm chart for velero
name: velero
version: 1.0.0
home: https://github.com/heptio/velero
icon: https://cdn-images-1.medium.com/max/1600/1*-9mb3AKnKdcL_QD3CMnthQ.png
sources:
- https://github.com/heptio/velero
maintainers:
- name: domcar
email: d-caruso@hotmail.it
- name: unguiculus
email: unguiculus@gmail.com
tillerVersion: ">=2.10.0"
85 changes: 85 additions & 0 deletions stable/velero/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Velero-server

This helm chart installs Velero version v0.11.0
https://github.com/heptio/velero/tree/v0.11.0


## Upgrading to v0.11.0

As of v0.11.0, Heptio Ark has become Velero.

The [instructions found here](https://heptio.github.io/velero/v0.11.0/migrating-to-velero) will assist you in upgrading from Ark to Velero

## Prerequisites

### Secret for cloud provider credentials
Velero server needs an IAM service account in order to run, if you don't have it you must create it.
Please follow the official documentation: https://heptio.github.io/velero/v0.11.0/install-overview

Don't forget the step to create the secret
```
kubectl create secret generic cloud-credentials --namespace <VELERO_NAMESPACE> --from-file cloud=credentials-velero
```

### Configuration
Please change the values.yaml according to your setup
See here for the official documentation https://heptio.github.io/velero/v0.11.0/install-overview

Parameter | Description | Default | Required
--- | --- | --- | ---
`cloudprovider` | Cloud provider | `nil` | yes
`bucket` | Object storage where to store backups | `nil` | yes
`region` | AWS region | `nil` | only if using AWS
`apitimeout` | Api Timeout | `nil` | only if using Azure
`credentials` | Credentials | `nil` | Yes (not required for kube2iam)
`backupSyncPeriod` | How frequently Velero queries the object storage to make sure that the appropriate Backup resources have been created for existing backup files. | `60m` | yes
`gcSyncPeriod` | How frequently Velero queries the object storage to delete backup files that have passed their TTL. | `60m` | yes
`scheduleSyncPeriod` | How frequently Velero checks its Schedule resource objects to see if a backup needs to be initiated | `1m` | yes
`restoreOnlyMode` | When RestoreOnly mode is on, functionality for backups, schedules, and expired backup deletion is turned off. Restores are made from existing backup files in object storage. | `false` | yes

Parameter | Description | Default
--- | --- | ---
`image.repository` | Image repository | `gcr.io/heptio-images/velero`
`image.tag` | Image tag | `v0.11.0`
`image.pullPolicy` | Image pull policy | `IfNotPresent`
`podAnnotations` | Annotations for the Velero server pod | `{}`
`rbac.create` | If true, create and use RBAC resources | `true`
`rbac.server.serviceAccount.create` | Whether a new service account name that the server will use should be created | `true`
`rbac.server.serviceAccount.name` | Service account to be used for the server. If not set and `rbac.server.serviceAccount.create` is `true` a name is generated using the fullname template | ``
`resources` | Resource requests and limits | `{}`
`initContainers` | InitContainers and their specs to start with the deployment pod | `[]`
`tolerations` | List of node taints to tolerate | `[]`
`nodeSelector` | Node labels for pod assignment | `{}`
`configuration.backupStorageLocation.name` | The name of the cloud provider that will be used to actually store the backups (`aws`, `azure`, `gcp`) | ``
`configuration.backupStorageLocation.bucket` | The storage bucket where backups are to be uploaded | ``
`configuration.backupStorageLocation.config.region` | The cloud provider region (AWS only) | ``
`configuration.backupStorageLocation.config.s3ForcePathStyle` | Set to `true` for a local storage service like Minio | ``
`configuration.backupStorageLocation.config.s3Url` | S3 url (primarily used for local storage services like Minio) | ``
`configuration.backupStorageLocation.config.kmsKeyId` | KMS key for encryption (AWS only) | ``
`configuration.backupStorageLocation.prefix` | The directory inside a storage bucket where backups are to be uploaded | ``
`configuration.backupSyncPeriod` | How frequently Velero queries the object storage to make sure that the appropriate Backup resources have been created for existing backup files | `60m`
`configuration.extraEnvVars` | Key/values for extra environment variables such as AWS_CLUSTER_NAME, etc | `{}`
`configuration.provider` | The name of the cloud provider where you are deploying velero to (`aws`, `azure`, `gcp`) |
`configuration.restoreResourcePriorities` | An ordered list that describes the order in which Kubernetes resource objects should be restored | `namespaces,persistentvolumes,persistentvolumeclaims,secrets,configmaps,serviceaccounts,limitranges,pods`
`configuration.restoreOnlyMode` | When RestoreOnly mode is on, functionality for backups, schedules, and expired backup deletion is turned off. Restores are made from existing backup files in object storage | `false`
`configuration.volumeSnapshotLocation.name` | The name of the cloud provider the cluster is using for persistent volumes, if any | `{}`
`configuration.volumeSnapshotLocation.config.region` | The cloud provider region (AWS only) | ``
`configuration.volumeSnapshotLocation.config.apiTimeout` | The API timeout (`azure` only) |
`credentials.existingSecret` | If specified and `useSecret` is `true`, uses an existing secret with this name instead of creating one | ``
`credentials.useSecret` | Whether a secret should be used. Set this to `false` when using `kube2iam` | `true`
`credentials.secretContents` | Contents for the credentials secret | `{}`
`deployRestic` | If `true`, enable restic deployment | `false`
`metrics.enabled` | Set this to `true` to enable exporting Prometheus monitoring metrics | `false`
`metrics.scrapeInterval` | Scrape interval for the Prometheus ServiceMonitor | `30s`
`metrics.serviceMonitor.enabled` | Set this to `true` to create ServiceMonitor for Prometheus operator | `false`
`metrics.serviceMonitor.additionalLabels` | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | `{}`
`schedules` | A dict of schedules | `{}`


## How to
```
helm install --name velero --namespace velero ./velero
```

## Remove heptio/velero
Remember that when you remove Velero all backups remain untouched
15 changes: 15 additions & 0 deletions stable/velero/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Check that the velero is up and running:

kubectl get deployment/{{ .Release.Name }} -n {{ .Release.Namespace }}

Check that the secret has been created:

kubectl get secret/{{ include "velero.fullname" . }} -n {{ .Release.Namespace }}

Check that the secret has been created:

Once velero server is up and running you need the client before you can use it
1. wget https://github.com/heptio/velero/releases/download/{{ .Values.image.tag }}/velero-{{ .Values.image.tag }}-darwin-amd64.tar.gz
2. tar -xvf velero-{{ .Values.image.tag }}-darwin-amd64.tar.gz -C velero-client

More info on the official site: https://github.com/heptio/velero#install-client
54 changes: 54 additions & 0 deletions stable/velero/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "velero.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "velero.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "velero.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create the name of the service account to use for creating or deleting the velero server
*/}}
{{- define "velero.serverServiceAccount" -}}
{{- if .Values.serviceAccount.server.create -}}
{{ default (printf "%s-%s" (include "velero.fullname" .) "server") .Values.serviceAccount.server.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.server.name }}
{{- end -}}
{{- end -}}

{{/*
Create the name for the credentials secret.
*/}}
{{- define "velero.secretName" -}}
{{- if .Values.credentials.existingSecret -}}
{{- .Values.credentials.existingSecret -}}
{{- else -}}
{{- include "velero.fullname" . -}}
{{- end -}}
{{- end -}}
19 changes: 19 additions & 0 deletions stable/velero/templates/backups.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: backups.velero.io
labels:
app.kubernetes.io/name: {{ include "velero.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "velero.chart" . }}
annotations:
"helm.sh/hook": crd-install
"helm.sh/hook-delete-policy": "before-hook-creation"
spec:
group: velero.io
version: v1
scope: Namespaced
names:
plural: backups
kind: Backup
46 changes: 46 additions & 0 deletions stable/velero/templates/backupstoragelocation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
apiVersion: velero.io/v1
kind: BackupStorageLocation
metadata:
name: default
labels:
app.kubernetes.io/name: {{ include "velero.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "velero.chart" . }}
spec:
{{- with .Values.configuration }}
{{- with .backupStorageLocation }}
provider: {{ .name }}
objectStorage:
bucket: {{ .bucket }}
{{- with .prefix }}
prefix: {{ . }}
{{- end }}
{{- with .config }}
config:
{{- with .region }}
region: {{ . }}
{{- end }}
{{- with .s3ForcePathStyle }}
s3ForcePathStyle: {{ . | quote }}
{{- end }}
{{- with .s3Url }}
s3Url: {{ . }}
{{- end }}
{{- with .kmsKeyId }}
kmsKeyId: {{ . }}
{{- end }}
{{- with .resourceGroup }}
resourceGroup: {{ . }}
{{- end }}
{{- with .storageAccount }}
storageAccount: {{ . }}
{{- end }}
{{- if .publicUrl }}
{{- with .publicUrl }}
publicUrl: {{ . }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
19 changes: 19 additions & 0 deletions stable/velero/templates/backupstoragelocations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: backupstoragelocations.velero.io
labels:
app.kubernetes.io/name: {{ include "velero.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "velero.chart" . }}
annotations:
"helm.sh/hook": crd-install
"helm.sh/hook-delete-policy": "before-hook-creation"
spec:
group: velero.io
version: v1
scope: Namespaced
names:
plural: backupstoragelocations
kind: BackupStorageLocation
19 changes: 19 additions & 0 deletions stable/velero/templates/deletebackuprequests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: deletebackuprequests.velero.io
labels:
app.kubernetes.io/name: {{ include "velero.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "velero.chart" . }}
annotations:
"helm.sh/hook": crd-install
"helm.sh/hook-delete-policy": "before-hook-creation"
spec:
group: velero.io
version: v1
scope: Namespaced
names:
plural: deletebackuprequests
kind: DeleteBackupRequest
Loading

0 comments on commit 56326b1

Please sign in to comment.