Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions base/bazarr/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,33 @@ spec:
command: ['sh', '-c', 'until wget -qO- sonarr:8989/sonarr &> /dev/null && wget -qO- radarr:7878/radarr &> /dev/null; do echo waiting for sonarr and radarr; sleep 2; done;']
- name: config
image: busybox
command:
env:
- name: API_KEY
valueFrom:
configMapKeyRef:
name: arr-apps-api-key
key: api_key
command:
- "sh"
- "-c"
- |
mkdir -p /htpc/bazarr/config
export RADARR_API_KEY=$(cat /htpc/radarr/config.xml | sed -ne "/ApiKey/{s/.*<ApiKey>\(.*\)<\/ApiKey>.*/\1/p;q;}")
export SONARR_API_KEY=$(cat /htpc/sonarr/config.xml | sed -ne "/ApiKey/{s/.*<ApiKey>\(.*\)<\/ApiKey>.*/\1/p;q;}")
cat << EOF > /htpc/bazarr/config/config.ini
[sonarr]
apikey = ${SONARR_API_KEY}
apikey = ${API_KEY}
full_update = Daily
ip = $(SONARR)
ip = sonarr
only_monitored = False
base_url = /$(SONARR)
base_url = /sonarr
ssl = False
port = 8989

[radarr]
apikey = ${RADARR_API_KEY}
apikey = ${API_KEY}
full_update = Daily
ip = $(RADARR)
ip = radarr
only_monitored = False
base_url = /$(RADARR)
base_url = /radarr
ssl = False
port = 7878

Expand Down
30 changes: 4 additions & 26 deletions base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,7 @@ patchesStrategicMerge:
- volumes_patch.yaml
- env_variables_patch.yaml

vars:
- name: SONARR
objref:
kind: Service
name: sonarr
apiVersion: v1
- name: RADARR
objref:
kind: Service
name: radarr
apiVersion: v1
- name: PROWLARR
objref:
kind: Service
name: prowlarr
apiVersion: v1
- name: READARR
objref:
kind: Service
name: readarr
apiVersion: v1
- name: KAVITA
objref:
kind: Service
name: kavita
apiVersion: v1
configMapGenerator:
- name: arr-apps-api-key
literals:
- api_key=e575a60f4f4335d8109fd60355b7c650
5 changes: 4 additions & 1 deletion base/lidarr/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ spec:
- name: LIDARR__AUTH__REQUIRED
value: enabled
- name: LIDARR__AUTH__APIKEY
value: htk8s-api-key-secure
valueFrom:
configMapKeyRef:
name: arr-apps-api-key
key: api_key
image: lscr.io/linuxserver/lidarr
name: lidarr
ports:
Expand Down
36 changes: 13 additions & 23 deletions base/prowlarr/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,13 @@ spec:
run: prowlarr
spec:
securityContext:
fsGroup: 1000
fsGroup: 1000
initContainers:
- name: chown
image: busybox
command: ["sh", "-c", "chown -R 1000:1000 /config"]
volumeMounts:
- mountPath: /config
name: htpc-home
subPath: prowlarr
- name: config
image: busybox
securityContext:
runAsUser: 1000
runAsGroup: 1000
command: ["sh", "-c"]
args:
- |
echo 'Customizing Prowlarr config...'
if [[ ! -f /config/config.xml ]]; then
echo '<Config><UrlBase>/$(PROWLARR)</UrlBase></Config>'> /config/config.xml
fi
echo 'Prowlarr config customized.'
volumeMounts:
- mountPath: /config
- mountPath: /config
name: htpc-home
subPath: prowlarr
containers:
Expand All @@ -50,6 +33,13 @@ spec:
value: "1000"
- name: PGID
value: "1000"
- name: PROWLARR__SERVER__URLBASE
value: /prowlarr
- name: PROWLARR__AUTH__APIKEY
valueFrom:
configMapKeyRef:
name: arr-apps-api-key
key: api_key
image: linuxserver/prowlarr
name: prowlarr
ports:
Expand All @@ -60,18 +50,18 @@ spec:
command:
- /bin/sh
- -c
- curl "http://localhost:9696/prowlarr/api/v1/health?ApiKey=$(sed -ne '/ApiKey/{s/.*<ApiKey>\(.*\)<\/ApiKey>.*/\1/p;q;}' </config/config.xml)"
- curl "http://localhost:9696/prowlarr/api/v1/health?ApiKey=$PROWLARR__AUTH__APIKEY"
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
exec:
command:
- /bin/sh
- -c
- curl "http://localhost:9696/prowlarr/api/v1/system/status?ApiKey=$(sed -ne '/ApiKey/{s/.*<ApiKey>\(.*\)<\/ApiKey>.*/\1/p;q;}' </config/config.xml)"
- curl "http://localhost:9696/prowlarr/api/v1/system/status?ApiKey=$PROWLARR__AUTH__APIKEY"
initialDelaySeconds: 30
periodSeconds: 10
volumeMounts:
- mountPath: /config
volumeMounts:
- mountPath: /config
name: htpc-home
subPath: prowlarr
23 changes: 9 additions & 14 deletions base/radarr/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,6 @@ spec:
- mountPath: /movies
name: htpc-home
subPath: media/movies
- name: config
image: busybox
command: ["sh", "-c"]
securityContext:
runAsUser: 1000
runAsGroup: 1000
args:
- "echo start;[[ ! -f /config/config.xml ]] && echo '<Config><UrlBase>/$(RADARR)</UrlBase></Config>'> /config/config.xml;echo end;"
volumeMounts:
- mountPath: /config
name: htpc-home
subPath: radarr
containers:
- env:
- name: TZ
Expand All @@ -50,6 +38,13 @@ spec:
value: "1000"
- name: PGID
value: "1000"
- name: RADARR__SERVER__URLBASE
value: /radarr
- name: RADARR__AUTH__APIKEY
valueFrom:
configMapKeyRef:
name: arr-apps-api-key
key: api_key
image: linuxserver/radarr
name: radarr
ports:
Expand All @@ -60,15 +55,15 @@ spec:
command:
- /bin/sh
- -c
- curl "http://localhost:7878/radarr/api/health?ApiKey=$(sed -ne '/ApiKey/{s/.*<ApiKey>\(.*\)<\/ApiKey>.*/\1/p;q;}' </config/config.xml)"
- curl "http://localhost:7878/radarr/api/health?ApiKey=$RADARR__AUTH__APIKEY"
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
exec:
command:
- /bin/sh
- -c
- curl "http://localhost:7878/radarr/api/system/status?ApiKey=$(sed -ne '/ApiKey/{s/.*<ApiKey>\(.*\)<\/ApiKey>.*/\1/p;q;}' </config/config.xml)"
- curl "http://localhost:7878/radarr/api/system/status?ApiKey=$RADARR__AUTH__APIKEY"
initialDelaySeconds: 30
periodSeconds: 10
volumeMounts:
Expand Down
28 changes: 9 additions & 19 deletions base/readarr/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,6 @@ spec:
- mountPath: /comics
name: htpc-home
subPath: media/books/comics
- name: config
image: busybox
command: ["sh", "-c"]
securityContext:
runAsUser: 1000
runAsGroup: 1000
args:
- |
echo 'Customizing config...'
if [[ ! -f /config/config.xml ]]; then
echo '<Config><UrlBase>/$(READARR)</UrlBase></Config>'> /config/config.xml
fi
echo 'Done customizing.'
volumeMounts:
- mountPath: /config
name: htpc-home
subPath: readarr
containers:
- name: readarr
image: lscr.io/linuxserver/readarr
Expand All @@ -60,22 +43,29 @@ spec:
value: "1000"
- name: TZ
value: Pacific/Auckland
- name: READARR__SERVER__URLBASE
value: /readarr
- name: READARR__AUTH__APIKEY
valueFrom:
configMapKeyRef:
name: arr-apps-api-key
key: api_key
ports:
- containerPort: 8787
livenessProbe:
exec:
command:
- /bin/sh
- -c
- curl "http://localhost:8787/readarr/api/v1/health?ApiKey=$(sed -ne '/ApiKey/{s/.*<ApiKey>\(.*\)<\/ApiKey>.*/\1/p;q;}' </config/config.xml)"
- curl "http://localhost:8787/readarr/api/v1/health?ApiKey=$READARR__AUTH__APIKEY"
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
exec:
command:
- /bin/sh
- -c
- curl "http://localhost:8787/readarr/api/v1/system/status?ApiKey=$(sed -ne '/ApiKey/{s/.*<ApiKey>\(.*\)<\/ApiKey>.*/\1/p;q;}' </config/config.xml)"
- curl "http://localhost:8787/readarr/api/v1/system/status?ApiKey=$READARR__AUTH__APIKEY"
initialDelaySeconds: 30
periodSeconds: 10
volumeMounts:
Expand Down
23 changes: 9 additions & 14 deletions base/sonarr/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,6 @@ spec:
- mountPath: /tv
name: htpc-home
subPath: media/tv
- name: config
image: busybox
command: ["sh", "-c"]
securityContext:
runAsUser: 1000
runAsGroup: 1000
args:
- "echo start;[[ ! -f /config/config.xml ]] && echo '<Config><UrlBase>/$(SONARR)</UrlBase></Config>'> /config/config.xml;echo end;"
volumeMounts:
- mountPath: /config
name: htpc-home
subPath: sonarr
containers:
- env:
- name: TZ
Expand All @@ -50,6 +38,13 @@ spec:
value: "1000"
- name: PGID
value: "1000"
- name: SONARR__SERVER__URLBASE
value: /sonarr
- name: SONARR__AUTH__APIKEY
valueFrom:
configMapKeyRef:
name: arr-apps-api-key
key: api_key
image: linuxserver/sonarr
name: sonarr
ports:
Expand All @@ -60,15 +55,15 @@ spec:
command:
- /bin/sh
- -c
- curl "http://localhost:8989/sonarr/api/health?ApiKey=$(sed -ne '/ApiKey/{s/.*<ApiKey>\(.*\)<\/ApiKey>.*/\1/p;q;}' </config/config.xml)"
- curl "http://localhost:8989/sonarr/api/health?ApiKey=$SONARR__AUTH__APIKEY"
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
exec:
command:
- /bin/sh
- -c
- curl "http://localhost:8989/sonarr/api/system/status?ApiKey=$(sed -ne '/ApiKey/{s/.*<ApiKey>\(.*\)<\/ApiKey>.*/\1/p;q;}' </config/config.xml)"
- curl "http://localhost:8989/sonarr/api/system/status?ApiKey=$SONARR__AUTH__APIKEY"
initialDelaySeconds: 30
periodSeconds: 10
volumeMounts:
Expand Down
Loading