Skip to content

Commit

Permalink
Merge pull request #196 from jenting/revert-prometheus-operator
Browse files Browse the repository at this point in the history
[velero] Revert "Remove Prometheus operator CRDs"
  • Loading branch information
Carlisia Thompson authored Dec 18, 2020
2 parents eaad4f0 + b2c4592 commit 1ea07c7
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]`)
2 changes: 1 addition & 1 deletion charts/velero/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
27 changes: 16 additions & 11 deletions charts/velero/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,27 @@ See Velero's full [official documentation](https://velero.io/docs/v1.5/basic-ins

#### Using Helm 3

First, create the namespace: `kubectl create namespace <YOUR 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 <YOUR NAMESPACE> \
helm install vmware-tanzu/velero \
--namespace <YOUR NAMESPACE> \
--create-namespace \
--set-file credentials.secretContents.cloud=<FULL PATH TO FILE> \
--set configuration.provider=<PROVIDER NAME> \
--set configuration.backupStorageLocation.name=<BACKUP STORAGE LOCATION NAME> \
--set configuration.backupStorageLocation.bucket=<BUCKET NAME> \
--set configuration.backupStorageLocation.config.region=<REGION> \
--set configuration.volumeSnapshotLocation.name=<VOLUME SNAPSHOT LOCATION NAME> \
--set configuration.volumeSnapshotLocation.config.region=<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-<PROVIDER NAME> \
--set initContainers[0].image=velero/velero-plugin-for-<PROVIDER NAME>:<PROVIDER PLUGIN TAG> \
--set initContainers[0].volumeMounts[0].mountPath=/target \
--set initContainers[0].volumeMounts[0].name=plugins \
--generate-name
Expand Down Expand Up @@ -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 <YOUR NAMESPACE> \
helm install vmware-tanzu/velero \
--namespace <YOUR NAMESPACE> \
--set-file credentials.secretContents.cloud=<FULL PATH TO FILE> \
--set configuration.provider=aws \
--set configuration.provider=<PROVIDER NAME> \
--set configuration.backupStorageLocation.name=<BACKUP STORAGE LOCATION NAME> \
--set configuration.backupStorageLocation.bucket=<BUCKET NAME> \
--set configuration.backupStorageLocation.config.region=<REGION> \
--set configuration.volumeSnapshotLocation.name=<VOLUME SNAPSHOT LOCATION NAME> \
--set configuration.volumeSnapshotLocation.config.region=<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-<PROVIDER NAME> \
--set initContainers[0].image=velero/velero-plugin-for-<PROVIDER NAME>:<PROVIDER PLUGIN TAG> \
--set initContainers[0].volumeMounts[0].mountPath=/target \
--set initContainers[0].volumeMounts[0].name=plugins
```
Expand Down
21 changes: 21 additions & 0 deletions charts/velero/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
22 changes: 22 additions & 0 deletions charts/velero/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
5 changes: 5 additions & 0 deletions charts/velero/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,18 @@ extraVolumeMounts: []
# Settings for Velero's prometheus metrics. Enabled by default.
metrics:
enabled: true
scrapeInterval: 30s

# Pod annotations for Prometheus
podAnnotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8085"
prometheus.io/path: "/metrics"

serviceMonitor:
enabled: false
additionalLabels: {}

# Install CRDs as a templates. Enabled by default.
installCRDs: true

Expand Down

0 comments on commit 1ea07c7

Please sign in to comment.