[stable/ark] Several improvements on naming, decoupling and metrics (#11068)

* [stable/ark] Several improvements on naming, decoupling and metrics

* Use new naming:
    * Rename backupStorageProvider to backupStorageLocation
    * Rename persistentVolumeProvider to volumeSnapshotLocation
* Add configuration.provider so that backupStorageLocation is decoupled from
  the cloud provider where ark it deployed to
* Fixed typo in metricsAddress (now renamed to configuration.metrics.address)
* Expose metrics port with configuration.metrics.enabled

Signed-off-by: Pablo Castellano <pablo.castellano@schibsted.com>

* Allow setting new prefix parameter

Signed-off-by: Pablo Castellano <pablo.castellano@schibsted.com>

* Fix and document prefix parameter

Signed-off-by: Pablo Castellano <pablo.castellano@schibsted.com>

* Major version bump

Signed-off-by: Pablo Castellano <pablo.castellano@schibsted.com>

* Add prometheus monitoring

Originally by JoschaLaubach (https://github.com/helm/charts/pull/9496)
Adapted by PabloCastellano to latest chart available

Signed-off-by: Pablo Castellano <pablo@anche.no>
This commit is contained in:
Pablo Castellano
2019-02-22 10:04:09 -08:00
committed by Kubernetes Prow Robot
parent bf10057800
commit f63198f214
9 changed files with 104 additions and 27 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ apiVersion: v1
appVersion: 0.10.1
description: A Helm chart for ark
name: ark
version: 3.0.1
version: 4.0.0
home: https://github.com/heptio/ark
icon: https://cdn-images-1.medium.com/max/1600/1*-9mb3AKnKdcL_QD3CMnthQ.png
sources:
+18 -11
View File
@@ -16,7 +16,8 @@ kubectl scale -n heptio-ark deploy/ark --replicas 0
```
3. Migrate file structure of your backup storage according to [guide](https://github.com/heptio/ark/blob/master/docs/storage-layout-reorg-v0.10.md)
4. Upgrade your deployment
4. Adjust your `values.yaml` to the new structure and naming
5. Upgrade your deployment
```sh
helm upgrade --force --namespace heptio-ark ark ./ark
@@ -61,23 +62,29 @@ Parameter | Description | Default
`resources` | Resource requests and limits | `{}`
`tolerations` | List of node taints to tolerate | `[]`
`nodeSelector` | Node labels for pod assignment | `{}`
`configuration.persistentVolumeProvider.name` | The name of the cloud provider the cluster is using for persistent volumes, if any | `{}`
`configuration.persistentVolumeProvider.config.region` | The cloud provider region (AWS only) | ``
`configuration.persistentVolumeProvider.config.apiTimeout` | The API timeout (Azure only) |
`configuration.backupStorageProvider.name` | The name of the cloud provider that will be used to actually store the backups (`aws`, `azure`, `gcp`) | ``
`configuration.backupStorageProvider.bucket` | The storage bucket where backups are to be uploaded | ``
`configuration.backupStorageProvider.config.region` | The cloud provider region (AWS only) | ``
`configuration.backupStorageProvider.config.s3ForcePathStyle` | Set to `true` for a local storage service like Minio | ``
`configuration.backupStorageProvider.config.s3Url` | S3 url (primarily used for local storage services like Minio) | ``
`configuration.backupStorageProvider.config.kmsKeyId` | KMS key for encryption (AWS only) | ``
`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 Ark 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.metricsAddress` | Address to expose metrics | `:8085`
`configuration.provider` | The name of the cloud provider where you are deploying ark 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 | `{}`
@@ -1,6 +1,6 @@
{{- $root := . }}
{{- with .Values.configuration }}
{{- with .backupStorageProvider }}
{{- with .backupStorageLocation }}
apiVersion: ark.heptio.com/v1
kind: BackupStorageLocation
metadata:
@@ -14,6 +14,9 @@ spec:
provider: {{ .name }}
objectStorage:
bucket: {{ .bucket }}
{{- with .prefix }}
prefix: {{ . }}
{{- end }}
{{- with .config }}
config:
{{- with .region }}
+15 -8
View File
@@ -1,5 +1,5 @@
{{- if and .Values.configuration.backupStorageProvider.name .Values.configuration.backupStorageProvider.bucket -}}
{{- $provider := .Values.configuration.backupStorageProvider.name -}}
{{- if .Values.configuration.provider -}}
{{- $provider := .Values.configuration.provider -}}
apiVersion: apps/v1beta2
kind: Deployment
metadata:
@@ -20,10 +20,15 @@ spec:
labels:
release: {{ .Release.Name }}
app: {{ template "ark.name" . }}
{{- with .Values.podAnnotations }}
{{- if or .Values.podAnnotations .Values.metrics.enabled }}
annotations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- if .Values.podAnnotations }}
{{ toYaml .Values.podAnnotations | indent 8 }}
{{- end }}
{{- if .Values.metrics.enabled }}
{{ toYaml .Values.metrics.podAnnotations | indent 8 }}
{{- end }}
{{- end }}
spec:
restartPolicy: Always
serviceAccountName: {{ template "ark.serverServiceAccount" . }}
@@ -31,14 +36,16 @@ spec:
- name: ark
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.metrics.enabled }}
ports:
- name: monitoring
containerPort: 8085
{{- end }}
command:
- /ark
args:
- server
{{- with .Values.configuration }}
{{- with .metricAddress }}
- --metrics-address={{ . }}
{{- end }}
{{- with .backupSyncPeriod }}
- --backup-sync-period={{ . }}
{{- end }}
+1 -1
View File
@@ -1,5 +1,5 @@
{{- if .Values.deployRestic }}
{{- $provider := .Values.configuration.backupStorageProvider.name -}}
{{- $provider := .Values.configuration.provider -}}
apiVersion: apps/v1
kind: DaemonSet
metadata:
+20
View File
@@ -0,0 +1,20 @@
{{- if .Values.metrics.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "ark.fullname" . }}
labels:
release: {{ .Release.Name }}
app: {{ template "ark.name" . }}
chart: {{ template "ark.chart" . }}
heritage: {{ .Release.Service }}
spec:
type: ClusterIP
ports:
- name: monitoring
port: 8085
targetPort: monitoring
selector:
release: {{ .Release.Name }}
app: {{ template "ark.name" . }}
{{- end }}
+22
View File
@@ -0,0 +1,22 @@
{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "ark.fullname" . }}
labels:
release: {{ .Release.Name }}
app: {{ template "ark.name" . }}
chart: {{ template "ark.chart" . }}
heritage: {{ .Release.Service }}
{{- if .Values.metrics.serviceMonitor.additionalLabels }}
{{ toYaml .Values.metrics.serviceMonitor.additionalLabels | indent 4 }}
{{- end }}
spec:
selector:
matchLabels:
release: {{ .Release.Name }}
app: {{ template "ark.name" . }}
endpoints:
- port: monitoring
interval: {{ .Values.metrics.scrapeInterval }}
{{- end }}
@@ -1,6 +1,6 @@
{{- $root := . }}
{{- with .Values.configuration }}
{{- with .persistentVolumeProvider }}
{{- with .volumeSnapshotLocation }}
apiVersion: ark.heptio.com/v1
kind: VolumeSnapshotLocation
metadata:
+22 -4
View File
@@ -3,9 +3,12 @@ image:
tag: v0.10.1
pullPolicy: IfNotPresent
# Only kube2iam: change the AWS_ACCOUNT_ID and HEPTIO_ARK_ROLE_NAME
# Only kube2iam/kiam: change the AWS_ACCOUNT_ID and HEPTIO_ARK_ROLE_NAME
podAnnotations: {}
# iam.amazonaws.com/role: arn:aws:iam::<AWS_ACCOUNT_ID>:role/<HEPTIO_ARK_ROLE_NAME>
# prometheus.io/scrape: "true"
# prometheus.io/port: "8085"
# prometheus.io/path: "/metrics"
rbac:
create: true
@@ -24,17 +27,20 @@ nodeSelector: {}
## Parameters for the ' default' Config resource
## See https://heptio.github.io/ark/v0.9.0/config-definition
configuration:
persistentVolumeProvider: {}
provider:
volumeSnapshotLocation: {}
# name:
# config:
# region:
# apiTimeout:
backupStorageProvider:
backupStorageLocation:
name:
bucket:
config: {}
# region:
# prefix:
# s3ForcePathStyle:
# s3Url:
# kmsKeyId:
@@ -42,7 +48,6 @@ configuration:
# storageAccount:
backupSyncPeriod: 60m
metricsAddress: ":8085"
resticTimeout: 1h
restoreResourcePriorities: namespaces,persistentvolumes,persistentvolumeclaims,secrets,configmaps,serviceaccounts,limitranges,pods
restoreOnlyMode: false
@@ -65,3 +70,16 @@ credentials:
secretContents: {}
deployRestic: false
metrics:
enabled: false
scrapeInterval: 30s
# Pod annotations for Prometheus
podAnnotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8085"
serviceMonitor:
enabled: false
additionalLabels: {}