Skip to content

Commit

Permalink
Implement changes to modify the config.xml for servarr apps to enable…
Browse files Browse the repository at this point in the history
… postgres
  • Loading branch information
Wattos committed Jun 11, 2024
1 parent b3d8645 commit 1277c5f
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/servarr/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: servarr
version: "1.0.14"
version: "1.0.15"
kubeVersion: ">=1.23.0-0"
description: Helm Chart for all servarr apps, such as lidarr, radarr, readarr, sonarr, whisparr
appVersion: "v3"
Expand Down
57 changes: 57 additions & 0 deletions charts/servarr/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: "{{ .Values.app }}-config-xml"
labels:
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
data: {{ $app := (index .Values .Values.app) }}
config.xml: |-
<Config>
{{- if .Values.appConfig.instanceName }}
<InstanceName>{{ .Values.appConfig.instanceName }}</InstanceName>
{{- else }}
<InstanceName>{{ .Values.app }}</InstanceName>
{{- end }}
<BindAddress>{{ .Values.appConfig.bindAddress }}</BindAddress>
<Port>{{ $app.container.port | int }}</Port>
<SslPort>{{ .Values.appConfig.sslPort }}</SslPort>
<EnableSsl>{{ .Values.appConfig.enableSsl }}</EnableSsl>
<ApiKey>{{ .Values.appConfig.apiKey }}</ApiKey>
<LaunchBrowser>{{ .Values.appConfig.launchBrowser }}</LaunchBrowser>
<AuthenticationMethod>{{ .Values.appConfig.authenticationMethod }}</AuthenticationMethod>
<Branch>{{ .Values.appConfig.branch }}</Branch>
<LogLevel>{{ .Values.appConfig.logLevel }}</LogLevel>
<SslCertPath>{{ .Values.appConfig.sslCertPath }}</SslCertPath>
<SslCertPassword>{{ .Values.appConfig.sslCertPassword }}</SslCertPassword>
<UrlBase>{{ .Values.appConfig.urlBase }}</UrlBase>
<UpdateMechanism>{{ .Values.appConfig.updateMechanism }}</UpdateMechanism>
<AuthenticationRequired>{{ .Values.appConfig.authenticationRequired }}</AuthenticationRequired>
<SyslogPort>{{ .Values.appConfig.syslogPort }}</SyslogPort>
<AnalyticsEnabled>{{ .Values.appConfig.analyticsEnabled }}</AnalyticsEnabled>
{{- if .Values.appConfig.postgresHost }}
<PostgresHost>{{ .Values.appConfig.postgresHost }}</PostgresHost>
<PostgresPort>{{ .Values.appConfig.postgresPort }}</PostgresPort>
<PostgresUser>{{ .Values.appConfig.postgresUser }}</PostgresUser>
<PostgresPassword>{{ .Values.appConfig.postgresPassword }}</PostgresPassword>
{{- if .Values.appConfig.postgresMainDb }}
<PostgresMainDb>{{ .Values.appConfig.postgresMainDb }}</PostgresMainDb>
{{- else }}
<PostgresMainDb>{{ .Values.appConfig.app }}-main</PostgresMainDb>
{{- end }}
{{- if .Values.appConfig.postgresLogDb }}
<PostgresLogDb>{{ .Values.appConfig.postgresLogDb }}</PostgresLogDb>
{{- else }}
<PostgresLogDb>{{ .Values.appConfig.app }}-log</PostgresLogDb>
{{- end }}
{{- end }}
</Config>
6 changes: 6 additions & 0 deletions charts/servarr/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ spec:
volumeMounts:
- name: "{{ .Values.app }}-config"
mountPath: /config
- name: "{{ .Values.app }}-config-xml"
mountPath: /config
subPath: config.xml
{{- if $app.media.enabled }}
- name: "{{ .Values.app }}-media"
mountPath: /media
Expand All @@ -40,6 +43,9 @@ spec:
- name: "{{ .Values.app }}-config"
persistentVolumeClaim:
claimName: "{{ .Values.app }}-config"
- name: "{{ .Values.app }}-config-xml"
configMap:
name: {{ .Values.app }}-config-xml
{{- if $app.media.enabled }}
- name: "{{ .Values.app }}-media"
nfs:
Expand Down
28 changes: 26 additions & 2 deletions charts/servarr/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@
# General Settings towards servarr
app: # one of: lidarr, radarr, readarr, sonarr, prowlarr

appConfig:
bindAddress: "*"
sslPort: 9898
enableSsl: False
launchBrowser: True
apiKey: "random-key"
authenticationMethod: "Forms"
branch: "master"
logLevel: "info"
sslCertPath: ""
sslCertPassword: ""
urlBase: ""
instanceName:
updateMechanism: "Docker"
authenticationRequired: "Enabled"
syslogPort: 514
analyticsEnabled: "False"

postgresHost:
PostgresPort:
PostgresUser:
PostgresPassword:
PostgresMainDb:
postgresLogDb:

servarr:
# How many replicas of the service should run
replicaCount: 1
Expand All @@ -25,13 +50,12 @@ servarr:
nfs:
server:
path:

config:
# The name of the storage class for the persistant volume
storage:
className: # the storage class name to use
size: "200Mi"


# per app configuration
lidarr:
Expand Down

0 comments on commit 1277c5f

Please sign in to comment.