diff --git a/stable/ark/Chart.yaml b/stable/ark/Chart.yaml index 07de839da1..c82735cff6 100644 --- a/stable/ark/Chart.yaml +++ b/stable/ark/Chart.yaml @@ -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: diff --git a/stable/ark/README.md b/stable/ark/README.md index f6731ee91a..251d9f0859 100644 --- a/stable/ark/README.md +++ b/stable/ark/README.md @@ -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 | `{}` diff --git a/stable/ark/templates/backupstoragelocation.yaml b/stable/ark/templates/backupstoragelocation.yaml index 63c066568e..9dd0372266 100644 --- a/stable/ark/templates/backupstoragelocation.yaml +++ b/stable/ark/templates/backupstoragelocation.yaml @@ -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 }} diff --git a/stable/ark/templates/deployment.yaml b/stable/ark/templates/deployment.yaml index 9ee640bff9..38c0e13b71 100644 --- a/stable/ark/templates/deployment.yaml +++ b/stable/ark/templates/deployment.yaml @@ -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 }} diff --git a/stable/ark/templates/restic-daemonset.yaml b/stable/ark/templates/restic-daemonset.yaml index 801a667c3c..564847f737 100644 --- a/stable/ark/templates/restic-daemonset.yaml +++ b/stable/ark/templates/restic-daemonset.yaml @@ -1,5 +1,5 @@ {{- if .Values.deployRestic }} -{{- $provider := .Values.configuration.backupStorageProvider.name -}} +{{- $provider := .Values.configuration.provider -}} apiVersion: apps/v1 kind: DaemonSet metadata: diff --git a/stable/ark/templates/service.yaml b/stable/ark/templates/service.yaml new file mode 100644 index 0000000000..234db5e8af --- /dev/null +++ b/stable/ark/templates/service.yaml @@ -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 }} diff --git a/stable/ark/templates/servicemonitor.yaml b/stable/ark/templates/servicemonitor.yaml new file mode 100644 index 0000000000..3bb964deb9 --- /dev/null +++ b/stable/ark/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: {{ 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 }} diff --git a/stable/ark/templates/volumesnapshotlocation.yaml b/stable/ark/templates/volumesnapshotlocation.yaml index afa287c0fd..d6cf91d6e3 100644 --- a/stable/ark/templates/volumesnapshotlocation.yaml +++ b/stable/ark/templates/volumesnapshotlocation.yaml @@ -1,6 +1,6 @@ {{- $root := . }} {{- with .Values.configuration }} -{{- with .persistentVolumeProvider }} +{{- with .volumeSnapshotLocation }} apiVersion: ark.heptio.com/v1 kind: VolumeSnapshotLocation metadata: diff --git a/stable/ark/values.yaml b/stable/ark/values.yaml index 1eac4e7390..24ac002450 100644 --- a/stable/ark/values.yaml +++ b/stable/ark/values.yaml @@ -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:::role/ +# 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: {}