Skip to content

Commit fbb239d

Browse files
authored
Support for external secrets (#299)
## Description Supports mixing secrets in values.yaml and in external secrets, and allows a optional value ({chart}exportarr, eg "sonarrexportarr" that if set contains the name of the key to use for the API in the exportarr deployment. If that key is not set, it uses the default "apiKey" that was used before. When defining secrets in values.yaml, you can either provide a value, or a reference to an external secret. Adds capability requested in #285 ``` secrets: - name: 'sonarr-apikey' value: '12345' - name: 'sonarrexportarr' value: 'sonarr-apikey' - name: 'externalSecret' ref: 'mysecret' ``` When "ref" is defined, it will (in the example above) look for a secret with the name 'mysecret' and then pull the value from the key 'externalSecret'. This increments the base chart, but does not break any of the existing charts and defaults, and will not break existing deployments. Given that it is difficult to insert comments in the template files, there are none. Was not sure the right place to document this, as it is technically available to all charts. If desired, I can add to the base values.yaml for the main template chart. ## Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] Non-breaking change which adds functionality - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update ## Checklist - [ ] I have updated the chart version in `Chart.yaml` according to [semantic versioning](https://semver.org/). - [ ] I have included any new or changed values in the `values.yaml` file and documented them in the README if applicable. - [x] My changes are tested and proven to work. - [x] I have performed a self-review of my own code. - [ ] I have commented my code, particularly in hard-to-understand areas. - [ ] I have made corresponding changes to the documentation. - [x] My changes generate no new warnings. ## Testing Please describe the tests that you ran to verify your changes. Provide instructions so reviewers can reproduce the testing. Also, list any relevant details for your test configuration. - Deployed and confirmed working in my test kubernetes cluster. ## Additional Information I've tested this pretty hard, but would recommend a close review before accepting the PR.
2 parents 7bc13ea + de2ccc4 commit fbb239d

36 files changed

+185
-36
lines changed

Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ apiVersion: 'v2'
22
name: 'media-servarr-base'
33
description: 'Base chart for media-servarr charts'
44
type: 'application'
5-
version: 0.10.0
5+
version: 0.11.0
66
icon: 'https://github.com/drinkataco/media-servarr/blob/main/icon.png'

charts/bazarr/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ keywords:
1313
- 'bazarr'
1414
kubeversion: ">=1.24.0-0"
1515
type: 'application'
16-
version: 0.9.2
16+
version: 0.10.0
1717
appVersion: 1.5.5
1818
icon: 'https://github.com/drinkataco/media-servarr/blob/main/charts/bazarr/icon.png'
1919
dependencies:
2020
- name: 'media-servarr-base'
21-
version: 0.10.0
21+
version: 0.11.0
2222
repository: "file://../.."
2323
maintainers:
2424
- name: 'media-servarr'

charts/bazarr/README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,19 @@ Use `openssl rand -hex 16` to generate a key and replace the default value. If u
4444

4545
```yaml
4646
secrets:
47+
# inline value
4748
- name: 'apiKey'
4849
value: 'your-api-key-here'
50+
51+
# reference pre-existing Secret
4952
- name: 'sonarrApiKey'
50-
value: ''
53+
ref: 'sonarr-api-key'
5154
- name: 'radarrApiKey'
52-
value: ''
55+
ref: 'radarr-api-key'
5356
```
5457
58+
When `ref` is set, the chart reads key `name` from the Secret named by `ref` in the same namespace.
59+
5560
By not setting this value, and leaving it blank, Bazarr will automatically generate a new key on start.
5661

5762
### Application Configuration
@@ -144,9 +149,14 @@ ingress:
144149

145150
Enabling metrics enables a sidecar container being attached for [exportarr](https://github.com/onedr0p/exportarr/) - and a ServiceMonitor CRD to be consumed by the [kube-prometheus](https://github.com/prometheus-operator/kube-prometheus) package.
146151

152+
By default, Exportarr reads the `apiKey` from this chart's Secret. If you need Exportarr to read a different Secret/key, set `metrics.apiref`.
153+
147154
```yaml
148155
metrics:
149156
enabled: true
157+
apiref:
158+
secret: 'my-existing-secret'
159+
keyname: 'apiKey'
150160
env: []
151161
```
152162

charts/bazarr/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ fullnameOverride: ''
88
secrets:
99
- name: 'apiKey'
1010
value: ''
11+
# ref: 'my-existing-secret' # existing secret
1112
# - name: 'sonarrApiKey'
1213
# value: ''
14+
# # ref: 'sonarr-api-secret' # existing secret
1315
# - name: 'radarrApiKey'
1416
# value: ''
17+
# # ref: 'radarr-api-secret' # existing secret
1518

1619
#
1720
# Application Config

charts/cleanuparr/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ keywords:
1212
- 'whisparr'
1313
kubeversion: ">=1.24.0-0"
1414
type: 'application'
15-
version: 0.7.0
15+
version: 0.8.0
1616
appVersion: 2.6.3
1717
icon: 'https://github.com/drinkataco/media-servarr/blob/main/charts/cleanuparr/icon.png'
1818
dependencies:
1919
- name: 'media-servarr-base'
20-
version: 0.10.0
20+
version: 0.11.0
2121
repository: "file://../.."
2222
maintainers:
2323
- name: 'media-servarr'

charts/cleanuparr/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,27 @@ Pointing the host `media-servarr.local` to your kubernetes cluster will then all
3636

3737
Here is some example of some configuration you may want to override (and include in installation with `-f myvalues.yaml`
3838

39+
### Secrets
40+
41+
Cleanuparr defines `apiKey` by default, and you can optionally define integration keys such as `sonarrApiKey` and `radarrApiKey`.
42+
43+
You can either define secret values directly in your chart values, or reference keys from an existing Secret.
44+
45+
```yaml
46+
secrets:
47+
# inline value
48+
- name: 'apiKey'
49+
value: 'your-api-key-here'
50+
51+
# reference pre-existing Secret
52+
- name: 'sonarrApiKey'
53+
ref: 'sonarr-api-secret'
54+
- name: 'radarrApiKey'
55+
ref: 'radarr-api-secret'
56+
```
57+
58+
When `ref` is set, the chart reads key `name` from the Secret named by `ref` in the same namespace.
59+
3960
### Application Configuration
4061

4162
Application configuration is managed via the GUI and stored in the application database.

charts/cleanuparr/values.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ fullnameOverride: ''
88
secrets:
99
- name: 'apiKey'
1010
value: ''
11+
# ref: 'my-existing-secret' # existing secret
1112
# - name: 'sonarrApiKey'
1213
# value: ''
14+
# # ref: 'sonarr-api-secret' # existing secret
1315
# - name: 'radarrApiKey'
1416
# value: ''
17+
# # ref: 'radarr-api-secret' # existing secret
1518

1619
#
1720
# Application Config
@@ -67,4 +70,3 @@ persistentVolumeClaims:
6770

6871
ingress:
6972
enabled: true
70-

charts/flaresolverr/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ keywords:
99
- 'bypass'
1010
kubeVersion: ">=1.24.0-0"
1111
type: 'application'
12-
version: 0.9.1
12+
version: 0.10.0
1313
appVersion: v3.4.6
1414
icon: 'https://github.com/drinkataco/media-servarr/blob/main/charts/flaresolverr/icon.png'
1515
dependencies:
1616
- name: 'media-servarr-base'
17-
version: 0.10.0
17+
version: 0.11.0
1818
repository: "file://../.."
1919
maintainers:
2020
- name: 'media-servarr'

charts/homarr/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ keywords:
77
- 'homarr'
88
kubeversion: ">=1.24.0-0"
99
type: 'application'
10-
version: 0.27.0
10+
version: 0.28.0
1111
appVersion: v1.53.1
1212
icon: 'https://github.com/drinkataco/media-servarr/blob/main/charts/homarr/icon.png'
1313
dependencies:
1414
- name: 'media-servarr-base'
15-
version: 0.10.0
15+
version: 0.11.0
1616
repository: "file://../.."
1717
maintainers:
1818
- name: 'media-servarr'

charts/huntarr/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ keywords:
1313
- 'whisparr'
1414
kubeversion: ">=1.24.0-0"
1515
type: 'application'
16-
version: 1.2.0
16+
version: 1.3.0
1717
appVersion: 9.3.7
1818
icon: 'https://github.com/drinkataco/media-servarr/blob/main/charts/huntarr/icon.png'
1919
dependencies:
2020
- name: 'media-servarr-base'
21-
version: 0.10.0
21+
version: 0.11.0
2222
repository: "file://../.."
2323
maintainers:
2424
- name: 'media-servarr'

0 commit comments

Comments
 (0)