From 580323dec9bcba09c6ba8f965272d0700ae54776 Mon Sep 17 00:00:00 2001 From: JenTing Hsiao Date: Fri, 18 Dec 2020 05:52:12 +0800 Subject: [PATCH 1/4] Revert "Remove Prometheus operator CRDs" Signed-off-by: JenTing Hsiao --- charts/velero/templates/service.yaml | 21 ++++++++++++++++++++ charts/velero/templates/servicemonitor.yaml | 22 +++++++++++++++++++++ charts/velero/values.yaml | 5 +++++ 3 files changed, 48 insertions(+) create mode 100644 charts/velero/templates/service.yaml create mode 100644 charts/velero/templates/servicemonitor.yaml diff --git a/charts/velero/templates/service.yaml b/charts/velero/templates/service.yaml new file mode 100644 index 00000000..731202ff --- /dev/null +++ b/charts/velero/templates/service.yaml @@ -0,0 +1,21 @@ +{{- if .Values.metrics.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "velero.fullname" . }} + 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: + type: ClusterIP + ports: + - name: monitoring + port: 8085 + targetPort: monitoring + selector: + name: velero + app.kubernetes.io/name: {{ include "velero.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/charts/velero/templates/servicemonitor.yaml b/charts/velero/templates/servicemonitor.yaml new file mode 100644 index 00000000..8833088d --- /dev/null +++ b/charts/velero/templates/servicemonitor.yaml @@ -0,0 +1,22 @@ +{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "velero.fullname" . }} + 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" . }} + {{- with .Values.metrics.serviceMonitor.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + selector: + matchLabels: + app.kubernetes.io/name: {{ include "velero.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + endpoints: + - port: monitoring + interval: {{ .Values.metrics.scrapeInterval }} +{{- end }} diff --git a/charts/velero/values.yaml b/charts/velero/values.yaml index ec3caa06..6427c83c 100644 --- a/charts/velero/values.yaml +++ b/charts/velero/values.yaml @@ -69,6 +69,7 @@ extraVolumeMounts: [] # Settings for Velero's prometheus metrics. Enabled by default. metrics: enabled: true + scrapeInterval: 30s # Pod annotations for Prometheus podAnnotations: @@ -76,6 +77,10 @@ metrics: prometheus.io/port: "8085" prometheus.io/path: "/metrics" + serviceMonitor: + enabled: false + additionalLabels: {} + # Install CRDs as a templates. Enabled by default. installCRDs: true From 970cf1cffc8dafeb673a105e5d77029a60dcfad2 Mon Sep 17 00:00:00 2001 From: JenTing Hsiao Date: Fri, 18 Dec 2020 05:56:00 +0800 Subject: [PATCH 2/4] Update Github PR template Signed-off-by: JenTing Hsiao --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 1a393929..73fc8697 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -4,5 +4,5 @@ [Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.] - [ ] [DCO](https://github.com/helm/charts/blob/master/CONTRIBUTING.md#sign-your-work) signed - [ ] Chart Version bumped -- [ ] Variables are documented in the README.md +- [ ] Variables are documented in the values.yaml or README.md - [ ] Title of the PR starts with chart name (e.g. `[velero]`) From caecde6e9ad50534e4f1938e7b9e3c42a4831972 Mon Sep 17 00:00:00 2001 From: JenTing Hsiao Date: Fri, 18 Dec 2020 21:54:30 +0800 Subject: [PATCH 3/4] Bump chart version Signed-off-by: JenTing Hsiao --- charts/velero/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/velero/Chart.yaml b/charts/velero/Chart.yaml index 12f4607f..07b87e9c 100644 --- a/charts/velero/Chart.yaml +++ b/charts/velero/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: 1.5.2 description: A Helm chart for velero name: velero -version: 2.14.3 +version: 2.14.4 home: https://github.com/vmware-tanzu/velero icon: https://cdn-images-1.medium.com/max/1600/1*-9mb3AKnKdcL_QD3CMnthQ.png sources: From b2c459266065082b4d3adbe60801d6d744dd7adf Mon Sep 17 00:00:00 2001 From: JenTing Hsiao Date: Fri, 18 Dec 2020 22:01:47 +0800 Subject: [PATCH 4/4] Update README Signed-off-by: JenTing Hsiao --- charts/velero/README.md | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/charts/velero/README.md b/charts/velero/README.md index f34ac00d..d1a916c0 100644 --- a/charts/velero/README.md +++ b/charts/velero/README.md @@ -27,16 +27,18 @@ See Velero's full [official documentation](https://velero.io/docs/v1.5/basic-ins #### Using Helm 3 -First, create the namespace: `kubectl create namespace ` - ##### Option 1) CLI commands -Note: you may add the flag `--skip-crds` if you don't want to install the CRDs. +Note: You may add the flag `--set installCRDs=false` if you don't want to install the CRDs. +Likewise, you may add the flag `--set cleanUpCRDs=true` if you want to delete the Velero CRDs after deleting a release. +Please note that cleaning up CRDs will also delete any CRD instance, such as BackupStorageLocation and VolumeSnapshotLocation, which would have to be reconfigured when reinstalling Velero. The backup data in object storage will not be deleted, even though the backup instances in the cluster will. Specify the necessary values using the --set key=value[,key=value] argument to helm install. For example, ```bash -helm install vmware-tanzu/velero --namespace \ +helm install vmware-tanzu/velero \ +--namespace \ +--create-namespace \ --set-file credentials.secretContents.cloud= \ --set configuration.provider= \ --set configuration.backupStorageLocation.name= \ @@ -44,8 +46,8 @@ helm install vmware-tanzu/velero --namespace \ --set configuration.backupStorageLocation.config.region= \ --set configuration.volumeSnapshotLocation.name= \ --set configuration.volumeSnapshotLocation.config.region= \ ---set initContainers[0].name=velero-plugin-for-aws \ ---set initContainers[0].image=velero/velero-plugin-for-aws:v1.1.0 \ +--set initContainers[0].name=velero-plugin-for- \ +--set initContainers[0].image=velero/velero-plugin-for-: \ --set initContainers[0].volumeMounts[0].mountPath=/target \ --set initContainers[0].volumeMounts[0].name=plugins \ --generate-name @@ -80,21 +82,24 @@ helm init --service-account=tiller --wait --upgrade ##### Option 1) CLI commands -Note: you may add the flag `--set installCRDs=false` if you don't want to install the CRDs. +Note: You may add the flag `--set installCRDs=false` if you don't want to install the CRDs. +Likewise, you may add the flag `--set cleanUpCRDs=true` if you want to delete the Velero CRDs after deleting a release. +Please note that cleaning up CRDs will also delete any CRD instance, such as BackupStorageLocation and VolumeSnapshotLocation, which would have to be reconfigured when reinstalling Velero. The backup data in object storage will not be deleted, even though the backup instances in the cluster will. Specify the necessary values using the --set key=value[,key=value] argument to helm install. For example, ```bash -helm install vmware-tanzu/velero --namespace \ +helm install vmware-tanzu/velero \ +--namespace \ --set-file credentials.secretContents.cloud= \ ---set configuration.provider=aws \ +--set configuration.provider= \ --set configuration.backupStorageLocation.name= \ --set configuration.backupStorageLocation.bucket= \ --set configuration.backupStorageLocation.config.region= \ --set configuration.volumeSnapshotLocation.name= \ --set configuration.volumeSnapshotLocation.config.region= \ ---set initContainers[0].name=velero-plugin-for-aws \ ---set initContainers[0].image=velero/velero-plugin-for-aws:v1.1.0 \ +--set initContainers[0].name=velero-plugin-for- \ +--set initContainers[0].image=velero/velero-plugin-for-: \ --set initContainers[0].volumeMounts[0].mountPath=/target \ --set initContainers[0].volumeMounts[0].name=plugins ```