From b4231dac8ef18203b6d856c8545e01f23f0876b4 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Thu, 4 May 2023 14:15:03 -0400 Subject: [PATCH] add metrics exporting to sonarr --- .../apps/download/sonarr/helm-release.yaml | 32 ++++++++++ .../apps/download/sonarr/kustomization.yaml | 4 +- .../sonarr/sonarr-exportarr-metrics.yaml | 18 ++++++ .../sonarr/sonarr-exportarr.sops.yaml | 61 +++++++++++++++++++ 4 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 cluster/apps/download/sonarr/sonarr-exportarr-metrics.yaml create mode 100644 cluster/apps/download/sonarr/sonarr-exportarr.sops.yaml diff --git a/cluster/apps/download/sonarr/helm-release.yaml b/cluster/apps/download/sonarr/helm-release.yaml index 87b9047..f7513e2 100644 --- a/cluster/apps/download/sonarr/helm-release.yaml +++ b/cluster/apps/download/sonarr/helm-release.yaml @@ -18,15 +18,45 @@ spec: image: repository: lscr.io/linuxserver/sonarr tag: latest + + # Metrics sidecar + sidecars: + exportarr: + image: ghcr.io/onedr0p/exportarr:latest + args: + - sonarr + ports: + - name: metrics + containerPort: 9000 + env: + - name: URL + value: "http://localhost" + - name: CONFIG + value: "/config/config.xml" + volumeMounts: + - name: config + mountPath: /config + readOnly: true + env: TZ: America/New_York PGID: "1000" PUID: "1000" + service: main: + labels: + app: sonarr-service + ports: http: port: 8989 + + metrics: + enabled: true + port: 9000 + protocol: HTTP + probes: liveness: enabled: true @@ -41,6 +71,7 @@ spec: failureThreshold: 3 startup: enabled: false + ingress: main: enabled: true @@ -57,6 +88,7 @@ spec: - hosts: - *host secretName: wildcard-main-tls + persistence: config: enabled: true diff --git a/cluster/apps/download/sonarr/kustomization.yaml b/cluster/apps/download/sonarr/kustomization.yaml index ea3145d..33b5dad 100644 --- a/cluster/apps/download/sonarr/kustomization.yaml +++ b/cluster/apps/download/sonarr/kustomization.yaml @@ -1,4 +1,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: -- ./helm-release.yaml \ No newline at end of file +- ./sonarr-exportarr.sops.yaml +- ./helm-release.yaml +- ./sonarr-exportarr-metrics.yaml \ No newline at end of file diff --git a/cluster/apps/download/sonarr/sonarr-exportarr-metrics.yaml b/cluster/apps/download/sonarr/sonarr-exportarr-metrics.yaml new file mode 100644 index 0000000..bbf9a6c --- /dev/null +++ b/cluster/apps/download/sonarr/sonarr-exportarr-metrics.yaml @@ -0,0 +1,18 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: sonarr-exportarr + namespace: download + labels: + release: kube-prometheus-stack +spec: + endpoints: + - interval: 30s + targetPort: 9000 + path: /metrics + namespaceSelector: + matchNames: + - download + selector: + matchLabels: + app: sonarr-service diff --git a/cluster/apps/download/sonarr/sonarr-exportarr.sops.yaml b/cluster/apps/download/sonarr/sonarr-exportarr.sops.yaml new file mode 100644 index 0000000..11759e9 --- /dev/null +++ b/cluster/apps/download/sonarr/sonarr-exportarr.sops.yaml @@ -0,0 +1,61 @@ +apiVersion: v1 +kind: Secret +metadata: + name: sonarr-exportarr-secret + namespace: download +stringData: + APIKEY: ENC[AES256_GCM,data:f5PgZzaqPzW+SWyO4c4G9KqmkIred90GU5tmmYMA1eY=,iv:ZKss/oayfpavRDf6S8XoAw9bMea59bej92939jwnbvE=,tag:X7ENiPQQmxtjU7N/8AquDQ==,type:str] + URL: ENC[AES256_GCM,data:6DuakWUy1SAjZivVF6r/AaMBBT9i,iv:X53Lw45HbXcAMQSxOcOiZGrdOPXo5lt1ggk637tD3AQ=,tag:kyHA46HZm/ZFT3ikf08XoA==,type:str] +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: [] + lastmodified: "2023-05-04T17:54:00Z" + mac: ENC[AES256_GCM,data:13LAQvU+g3zh5D6chE/umIGOrV1e2AX4iKpgrTLpSWuohgtLsxLFfYTGsKMkhmMZXt7a+T5R1L1HSLBjilHqSatTJx/lRz5AyZ5a2g5D4quJvWS/GEuyL4pzsJ1xmQRbX3fwiQQlTwQcdyVmuzCBH3vv7FsrLqDhhqI7PAYivdI=,iv:vR/HSzoD2yBgtHvoRzhAkZZdzNgGsofapJIUUqubiic=,tag:+Meh3+uzj6qRgjvH2Ec7rg==,type:str] + pgp: + - created_at: "2023-05-04T17:53:59Z" + enc: | + -----BEGIN PGP MESSAGE----- + + hQIMAzKleRwoSoixAQ//TpnOVvM5S+Q/FHbmra+QcxyQo4aQ/4Jt4k2FKXEIZFW7 + RLVd1dfb67RKzCWSzP8xv3cXlLb80CTguEmQmAXuC8gzFrtVQTKmRZKzd/en1s6h + W0VDdVMge2G+NFjWlPAko3Kg+MCwtPgTVdiYccB4ZHZf5AN0CPbGemYSdd32UYVj + Rwx4mHMR0ZsXlLpSHAfSTOXGXkHX8friIIJo7Xxst1kdEOWCsYTljIG6SqqsH07d + LySUTwbGZLyFG/OUlSG9gUO8jOwN82pYtsubL19MUPQ4CJYisOKXjNgDdUbITDNN + 3O0mKmPQcclMnEw0/yTH/etGBNRVft9hRgVlGX8veJxNfryJcKncNSQ+ZUcoN4gV + 9acX3IXvHlFy+PKtRTuTrYsYEzNs33O48HfMSwcaGNnDNQNDo1jUN86IaYAv3E/Y + hxTIjgsLC/k0l0Lzk0zIqCI94uaNIfbUCcgDDaPfh5DQ/aaxt4ZGE5JlWUUoj6nB + SOiEwOuuLvLS7/4pGbSxNjcKLQCYXX2UEji5Y3RxkS83MhenXbKCYD2ZCeWNKVqT + Jx9Dt307AqhtDJtzFl0jvUG39dmQpKHo+vi+qmeMNbSh5VEqngUvZ/KN3Rtnst0R + BWKhn/lzlBWlEkglbZep1B2Tsq4QuBBg9XKACKTQslzLT4EZxFrumiyybXH01s/U + ZgEJAhBYiUts5IcnEWJb8haP2cUkltgHshUE35kRSNiWVGY7CHDjxIok8zGqiE2L + ltNneLO9BVCn7ekEQjGLzitEwSwTXm68JRolR8siBI1sw2pg7cZOnDfxY2u5O5oL + bZUkK4ctiA== + =NADI + -----END PGP MESSAGE----- + fp: 2CC2B3631D5C3393901335DB68F95C5D753EE1E5 + - created_at: "2023-05-04T17:53:59Z" + enc: | + -----BEGIN PGP MESSAGE----- + + hQIMA4WLYkVpP8xtAQ/+J6P9FE/yGAeQAi5nORs+eXIbjUouKzjJ0Ax4T8eD7YQE + ZwbzSCEZ0UruChdGWDEDLOezFPZ7h3PkW+Zp0itrUAzsPqVnqz1zA1tZmc//ex4h + ccL1CD7LZNYXZMPjRZoyg/bF3AyebMPNKEgUOhIYpLtunck/uFY+D1PL32MwfcVv + nHaavrEQnLfYknvGSZRq/aAUztjFvcVfnt1TdC8mw5CFK4YfDG0cMjb7uS4Jzay0 + KHAyqSU7X4SrbKrreV8qHVcwDhCEdZf9/Jaoyxl7rrDYBfsgawa35Mg1F+BNebqL + jMRrbgU3r+D+T9rf/wKFkzI39m+wFrVYNc6Wk0cwWzKvMqCN52o7eLIHIcf4m4EJ + uPvfjxTZczsQn2vjbWqcbVOonIoh075JxKRedfavygQkeiCzczq5sW7fl/BCKRuF + F9vW9uIjEosvscYvDBPTTD+Obt3PphxthA/FYG0/WyHR1xNBC4bJCFCm/HeUTWrR + ACy0xRu9VQ8BJw9XZTR456xa/ndSOdSJGC0R5FeTdT7p/ESLL4CGrQme1M0ITKRy + /lmbwSYhDey6KTCTRxLkR/ikwg3qUCYLcvivfz6XhN/uNTBh4YzDcW228P7WkZN5 + 18300iXK5KzTxU3EPa6SHhtmAouAuVzorAH48vq1pVodcbCxCD6Rrq+BUrAaIqnU + ZgEJAhA0R38li6TrcwJ1YnasziEKGfbNQ53ZAXfiL8kV6P+G3JtOPeoY85e5coX9 + o84NUJAPbwHrm+wwzFYf4iBnwb1je8zAcTIuoVkGCZwp6yOuEqwV2HUq4ABycMAm + dviqt3YzJw== + =r5D8 + -----END PGP MESSAGE----- + fp: 8DF31C9F48A24F525FFB1815FC96C52B59328E95 + encrypted_regex: ^(data|stringData)$ + version: 3.7.3