From 9bef0aac5ebce64a8e431e1815326d5edd7c8984 Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Tue, 14 Apr 2020 09:04:58 -0400 Subject: [PATCH] [radarr] Add exportarr for Radarr (#199) * first attempt at adding exportarr * add appVersion back --- charts/radarr/Chart.yaml | 4 +- charts/radarr/README.md | 117 ++++++++++-------- charts/radarr/templates/deployment.yaml | 36 ++++++ charts/radarr/templates/service-exporter.yaml | 20 +++ charts/radarr/templates/servicemonitor.yaml | 24 ++++ charts/radarr/values.yaml | 20 ++- 6 files changed, 166 insertions(+), 55 deletions(-) create mode 100644 charts/radarr/templates/service-exporter.yaml create mode 100644 charts/radarr/templates/servicemonitor.yaml diff --git a/charts/radarr/Chart.yaml b/charts/radarr/Chart.yaml index eb286fb5..ee3942f7 100644 --- a/charts/radarr/Chart.yaml +++ b/charts/radarr/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 -appVersion: amd64-v0.2.0.1344-ls17 +appVersion: v0.2.0.1480-ls58 description: Radarr is a movie downloading client name: radarr -version: 3.1.0 +version: 3.2.0 keywords: - radarr - usenet diff --git a/charts/radarr/README.md b/charts/radarr/README.md index 98d2e5c4..2b955706 100644 --- a/charts/radarr/README.md +++ b/charts/radarr/README.md @@ -31,58 +31,71 @@ The command removes all the Kubernetes components associated with the chart and The following tables lists the configurable parameters of the Sentry chart and their default values. -| Parameter | Description | Default | -|----------------------------|-------------------------------------|---------------------------------------------------------| -| `image.repository` | Image repository | `linuxserver/radarr` | -| `image.tag` | Image tag. Possible values listed [here](https://hub.docker.com/r/linuxserver/radarr/tags/).| `amd64-v0.2.0.1344-ls17`| -| `image.pullPolicy` | Image pull policy | `IfNotPresent` | -| `strategyType` | Specifies the strategy used to replace old Pods by new ones | `Recreate` | -| `timezone` | Timezone the radarr instance should run as, e.g. 'America/New_York' | `UTC` | -| `puid` | process userID the radarr instance should run as | `1001` | -| `pgid` | process groupID the radarr instance should run as | `1001` | -| `probes.liveness.initialDelaySeconds` | Specify liveness `initialDelaySeconds` parameter for the deployment | `60` | -| `probes.liveness.failureThreshold` | Specify liveness `failureThreshold` parameter for the deployment | `5` | -| `probes.liveness.timeoutSeconds` | Specify liveness `timeoutSeconds` parameter for the deployment | `10` | -| `probes.readiness.initialDelaySeconds` | Specify readiness `initialDelaySeconds` parameter for the deployment | `60` | -| `probes.readiness.failureThreshold` | Specify readiness `failureThreshold` parameter for the deployment | `5` | -| `probes.readiness.timeoutSeconds` | Specify readiness `timeoutSeconds` parameter for the deployment | `10` | -| `Service.type` | Kubernetes service type for the radarr GUI | `ClusterIP` | -| `Service.port` | Kubernetes port where the radarr GUI is exposed| `7878` | -| `Service.annotations` | Service annotations for the radarr GUI | `{}` | -| `Service.labels` | Custom labels | `{}` | -| `Service.loadBalancerIP` | Loadbalance IP for the radarr GUI | `{}` | -| `Service.loadBalancerSourceRanges` | List of IP CIDRs allowed access to load balancer (if supported) | None -| `ingress.enabled` | Enables Ingress | `false` | -| `ingress.annotations` | Ingress annotations | `{}` | -| `ingress.labels` | Custom labels | `{}` -| `ingress.path` | Ingress path | `/` | -| `ingress.hosts` | Ingress accepted hostnames | `chart-example.local` | -| `ingress.tls` | Ingress TLS configuration | `[]` | -| `persistence.config.enabled` | Use persistent volume to store configuration data | `true` | -| `persistence.config.size` | Size of persistent volume claim | `1Gi` | -| `persistence.config.existingClaim`| Use an existing PVC to persist data | `nil` | -| `persistence.config.storageClass` | Type of persistent volume claim | `-` | -| `persistence.config.accessMode` | Persistence access mode | `ReadWriteOnce` | -| `persistence.config.skipuninstall` | Do not delete the pvc upon helm uninstall | `false` | -| `persistence.downloads.enabled` | Use persistent volume to store configuration data | `true` | -| `persistence.downloads.size` | Size of persistent volume claim | `10Gi` | -| `persistence.downloads.existingClaim`| Use an existing PVC to persist data | `nil` | -| `persistence.downloads.storageClass` | Type of persistent volume claim | `-` | -| `persistence.downloads.accessMode` | Persistence access mode | `ReadWriteOnce` | -| `persistence.downloads.skipuninstall` | Do not delete the pvc upon helm uninstall | `false` | -| `persistence.movies.enabled` | Use persistent volume to store configuration data | `true` | -| `persistence.movies.size` | Size of persistent volume claim | `10Gi` | -| `persistence.movies.existingClaim`| Use an existing PVC to persist data | `nil` | -| `persistence.movies.storageClass` | Type of persistent volume claim | `-` | -| `persistence.movies.accessMode` | Persistence access mode | `ReadWriteOnce` | -| `persistence.movies.skipuninstall` | Do not delete the pvc upon helm uninstall | `false` | -| `persistence.extraExistingClaimMounts` | Optionally add multiple existing claims | `[]` | -| `resources` | CPU/Memory resource requests/limits | `{}` | -| `nodeSelector` | Node labels for pod assignment | `{}` | -| `tolerations` | Toleration labels for pod assignment | `[]` | -| `affinity` | Affinity settings for pod assignment | `{}` | -| `podAnnotations` | Key-value pairs to add as pod annotations | `{}` | -| `deploymentAnnotations` | Key-value pairs to add as deployment annotations | `{}` | +| Parameter | Description | Default | +|---------------------------------------------|----------------------------------------------------------------------------------------------|------------------------------------------------| +| `image.repository` | Image repository | `linuxserver/radarr` | +| `image.tag` | Image tag. Possible values listed [here](https://hub.docker.com/r/linuxserver/radarr/tags/). | `v0.2.0.1480-ls58` | +| `image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `strategyType` | Specifies the strategy used to replace old Pods by new ones | `Recreate` | +| `timezone` | Timezone the instance should run as, e.g. 'America/New_York' | `UTC` | +| `puid` | process userID the instance should run as | `1001` | +| `pgid` | process groupID the instance should run as | `1001` | +| `exportarr.enabled` | Enable Prometheus monitoring with [Exportarr](https://github.com/onedr0p/exportarr) | `false` | +| `exportarr.image.repository` | Exportarr image repository | `onedr0p/exportarr` | +| `exportarr.image.tag` | Exportarr image tag | `v0.3.0` | +| `exportarr.image.pullPolicy` | Exportarr image pullPolicy | `IfNotPresent` | +| `exportarr.port` | Prometheus scrape port | `9708` | +| `exportarr.url` | Radarr's URL | `http://radarr.default.svc.cluster.local:7878` | +| `exportarr.apikey` | Radarr's API Key | | +| `exportarr.serviceMonitor.enabled` | Enable Prometheus Operator ServiceMonitor monitoring | `false` | +| `exportarr.serviceMonitor.namespace` | Define namespace where to deploy the ServiceMonitor resource | (namespace where you are deploying) | +| `exportarr.serviceMonitor.path` | Prometheus scrape path | `/metrics` | +| `exportarr.serviceMonitor.interval` | Prometheus scrape interval | `4m` | +| `exportarr.serviceMonitor.scrapeTimeout` | Prometheus scrape timeout | `90s` | +| `exportarr.serviceMonitor.additionalLabels` | Add custom labels to ServiceMonitor | `{}` | +| `probes.liveness.initialDelaySeconds` | Specify liveness `initialDelaySeconds` parameter for the deployment | `60` | +| `probes.liveness.failureThreshold` | Specify liveness `failureThreshold` parameter for the deployment | `5` | +| `probes.liveness.timeoutSeconds` | Specify liveness `timeoutSeconds` parameter for the deployment | `10` | +| `probes.readiness.initialDelaySeconds` | Specify readiness `initialDelaySeconds` parameter for the deployment | `60` | +| `probes.readiness.failureThreshold` | Specify readiness `failureThreshold` parameter for the deployment | `5` | +| `probes.readiness.timeoutSeconds` | Specify readiness `timeoutSeconds` parameter for the deployment | `10` | +| `service.type` | Kubernetes service type for the GUI | `ClusterIP` | +| `service.port` | Kubernetes port where the GUI is exposed | `7878` | +| `service.annotations` | Service annotations for the GUI | `{}` | +| `service.labels` | Custom labels | `{}` | +| `service.loadBalancerIP` | Loadbalancer IP for the GUI | `{}` | +| `service.loadBalancerSourceRanges` | List of IP CIDRs allowed access to load balancer (if supported) | None | +| `ingress.enabled` | Enables Ingress | `false` | +| `ingress.annotations` | Ingress annotations | `{}` | +| `ingress.labels` | Custom labels | `{}` | +| `ingress.path` | Ingress path | `/` | +| `ingress.hosts` | Ingress accepted hostnames | `chart-example.local` | +| `ingress.tls` | Ingress TLS configuration | `[]` | +| `persistence.config.enabled` | Use persistent volume to store configuration data | `true` | +| `persistence.config.size` | Size of persistent volume claim | `1Gi` | +| `persistence.config.existingClaim` | Use an existing PVC to persist data | `nil` | +| `persistence.config.storageClass` | Type of persistent volume claim | `-` | +| `persistence.config.accessMode` | Persistence access mode | `ReadWriteOnce` | +| `persistence.config.skipuninstall` | Do not delete the pvc upon helm uninstall | `false` | +| `persistence.downloads.enabled` | Use persistent volume to store configuration data | `true` | +| `persistence.downloads.size` | Size of persistent volume claim | `10Gi` | +| `persistence.downloads.existingClaim` | Use an existing PVC to persist data | `nil` | +| `persistence.downloads.storageClass` | Type of persistent volume claim | `-` | +| `persistence.downloads.accessMode` | Persistence access mode | `ReadWriteOnce` | +| `persistence.downloads.skipuninstall` | Do not delete the pvc upon helm uninstall | `false` | +| `persistence.movies.enabled` | Use persistent volume to store configuration data | `true` | +| `persistence.movies.size` | Size of persistent volume claim | `10Gi` | +| `persistence.movies.existingClaim` | Use an existing PVC to persist data | `nil` | +| `persistence.movies.storageClass` | Type of persistent volume claim | `-` | +| `persistence.movies.accessMode` | Persistence access mode | `ReadWriteOnce` | +| `persistence.movies.skipuninstall` | Do not delete the pvc upon helm uninstall | `false` | +| `persistence.extraExistingClaimMounts` | Optionally add multiple existing claims | `[]` | +| `resources` | CPU/Memory resource requests/limits | `{}` | +| `nodeSelector` | Node labels for pod assignment | `{}` | +| `tolerations` | Toleration labels for pod assignment | `[]` | +| `affinity` | Affinity settings for pod assignment | `{}` | +| `podAnnotations` | Key-value pairs to add as pod annotations | `{}` | +| `deploymentAnnotations` | Key-value pairs to add as deployment annotations | `{}` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/charts/radarr/templates/deployment.yaml b/charts/radarr/templates/deployment.yaml index ea02399d..721815d4 100644 --- a/charts/radarr/templates/deployment.yaml +++ b/charts/radarr/templates/deployment.yaml @@ -81,6 +81,42 @@ spec: {{- end }} resources: {{ toYaml .Values.resources | indent 12 }} +{{- if .Values.exportarr.enabled }} + - name: radarr-exporter + image: "{{ .Values.exportarr.image.repository }}:{{ .Values.exportarr.image.tag }}" + imagePullPolicy: {{ .Values.exportarr.image.pullPolicy }} + command: ["exportarr"] + args: ["radarr"] + env: + - name: PORT + value: "{{ .Values.exportarr.port }}" + - name: URL + value: "{{ .Values.exportarr.url }}" + - name: APIKEY + value: "{{ .Values.exportarr.apikey }}" + ports: + - name: monitoring + containerPort: {{ .Values.exportarr.port }} + livenessProbe: + httpGet: + path: /healthz + port: monitoring + failureThreshold: 5 + periodSeconds: 10 + readinessProbe: + httpGet: + path: /healthz + port: monitoring + failureThreshold: 5 + periodSeconds: 10 + resources: + requests: + cpu: 100m + memory: 64Mi + limits: + cpu: 500m + memory: 256Mi +{{- end }} volumes: - name: config {{- if .Values.persistence.config.enabled }} diff --git a/charts/radarr/templates/service-exporter.yaml b/charts/radarr/templates/service-exporter.yaml new file mode 100644 index 00000000..fb773317 --- /dev/null +++ b/charts/radarr/templates/service-exporter.yaml @@ -0,0 +1,20 @@ +{{- if .Values.exportarr.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "radarr.fullname" . }}-exporter + labels: + app.kubernetes.io/name: {{ include "radarr.name" . }} + helm.sh/chart: {{ include "radarr.chart" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} +spec: + clusterIP: None + ports: + - name: monitoring + port: {{ .Values.exportarr.port }} + targetPort: monitoring + selector: + app.kubernetes.io/name: {{ include "radarr.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} \ No newline at end of file diff --git a/charts/radarr/templates/servicemonitor.yaml b/charts/radarr/templates/servicemonitor.yaml new file mode 100644 index 00000000..5f8c3bcc --- /dev/null +++ b/charts/radarr/templates/servicemonitor.yaml @@ -0,0 +1,24 @@ +{{- if .Values.exportarr.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "radarr.fullname" . }} + labels: + app.kubernetes.io/name: {{ include "radarr.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + helm.sh/chart: {{ include "radarr.chart" . }} + {{- with .Values.exportarr.serviceMonitor.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + selector: + matchLabels: + app.kubernetes.io/name: {{ include "radarr.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + endpoints: + - port: monitoring + interval: {{ .Values.exportarr.serviceMonitor.interval }} + scrapeTimeout: {{ .Values.exportarr.serviceMonitor.scrapeTimeout }} + path: {{ .Values.exportarr.serviceMonitor.path }} +{{- end }} diff --git a/charts/radarr/values.yaml b/charts/radarr/values.yaml index 325e7665..ee2fd766 100644 --- a/charts/radarr/values.yaml +++ b/charts/radarr/values.yaml @@ -4,7 +4,7 @@ image: repository: linuxserver/radarr - tag: amd64-v0.2.0.1344-ls17 + tag: v0.2.0.1480-ls58 pullPolicy: IfNotPresent # upgrade strategy type (e.g. Recreate or RollingUpdate) @@ -21,6 +21,24 @@ probes: failureThreshold: 5 timeoutSeconds: 10 +# Prometheus Metrics +exportarr: + enabled: false + image: + repository: onedr0p/exportarr + tag: v0.3.0 + pullPolicy: IfNotPresent + url: "http://radarr.default.svc.cluster.local:7878" + apikey: + port: 9708 + serviceMonitor: + enabled: false + namespace: default + path: /metrics + interval: 4m + scrapeTimeout: 90s + additionalLabels: {} + nameOverride: "" fullnameOverride: ""