-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert "feat(prowlarr): #31 Added prowlarr and extra lb annot…
…ations""
- Loading branch information
Showing
10 changed files
with
473 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
192 changes: 192 additions & 0 deletions
192
helm-charts/k8s-mediaserver/templates/prowlarr-resources.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
{{ if .Values.prowlarr.enabled }} | ||
--- | ||
### CONFIGMAPS | ||
## INIT-CONTAINER | ||
apiVersion: v1 | ||
data: | ||
config.xml: | | ||
<Config> | ||
<UrlBase>{{ .Values.prowlarr.ingress.path }}</UrlBase> | ||
</Config> | ||
init-prowlarr.sh: | | ||
#!/bin/bash | ||
echo "### Initializing config ###" | ||
if [ ! -f /prowlarr-config/config.xml ]; then | ||
cp -n /init-prowlarr/config.xml /prowlarr-config/config.xml | ||
echo "### No configuration found, intialized with default settings ###" | ||
fi | ||
kind: ConfigMap | ||
metadata: | ||
name: init-prowlarr-cm | ||
--- | ||
## APPLICATION | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: prowlarr-config | ||
data: | ||
PGID: "{{ .Values.general.pgid }}" | ||
PUID: "{{ .Values.general.puid }}" | ||
--- | ||
### DEPLOYMENT | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: prowlarr | ||
labels: | ||
{{- include "k8s-mediaserver.labels" . | nindent 4 }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
{{- include "k8s-mediaserver.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "k8s-mediaserver.selectorLabels" . | nindent 8 }} | ||
app: prowlarr | ||
spec: | ||
initContainers: | ||
- name: config-prowlarr | ||
image: docker.io/ubuntu:groovy | ||
command: ["/init-prowlarr/init-prowlarr.sh"] | ||
volumeMounts: | ||
- mountPath: /init-prowlarr | ||
name: init-files-prowlarr | ||
{{- if .Values.prowlarr.volume }} | ||
- name: {{ .Values.prowlarr.volume.name }} | ||
mountPath: /prowlarr-config | ||
{{- else }} | ||
- name: mediaserver-volume | ||
mountPath: /prowlarr-config | ||
subPath: "{{ .Values.general.storage.subPaths.config }}/prowlarr" | ||
{{- end }} | ||
securityContext: | ||
runAsUser: {{ .Values.general.puid }} | ||
runAsGroup: {{ .Values.general.pgid }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
envFrom: | ||
- configMapRef: | ||
name: prowlarr-config | ||
image: "{{ .Values.prowlarr.container.image }}:{{ .Values.prowlarr.container.tag | default .Values.general.image_tag }}" | ||
imagePullPolicy: Always | ||
readinessProbe: | ||
tcpSocket: | ||
port: {{ .Values.prowlarr.container.port }} | ||
initialDelaySeconds: 10 | ||
periodSeconds: 20 | ||
ports: | ||
- name: prowlarr-port | ||
containerPort: {{ .Values.prowlarr.container.port }} | ||
protocol: TCP | ||
volumeMounts: | ||
{{- if .Values.prowlarr.volume }} | ||
- name: {{ .Values.prowlarr.volume.name }} | ||
mountPath: /config | ||
{{- else }} | ||
- name: mediaserver-volume | ||
mountPath: "/config" | ||
subPath: "{{ .Values.general.storage.subPaths.config }}/prowlarr" | ||
{{- end }} | ||
{{- with .Values.prowlarr.resources }} | ||
resources: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
volumes: | ||
{{ if not .Values.general.storage.customVolume }} | ||
- name: mediaserver-volume | ||
persistentVolumeClaim: | ||
claimName: {{ .Values.general.storage.pvcName }} | ||
{{ else }} | ||
- name: mediaserver-volume | ||
{{- toYaml .Values.general.storage.volumes | nindent 10 }} | ||
{{ end }} | ||
{{- if .Values.prowlarr.volume }} | ||
- name: {{ .Values.prowlarr.volume.name }} | ||
persistentVolumeClaim: | ||
claimName: {{ .Values.prowlarr.volume.name }} | ||
{{- end }} | ||
- name: init-files-prowlarr | ||
configMap: | ||
defaultMode: 493 | ||
name: init-prowlarr-cm | ||
{{- with .Values.general.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
--- | ||
### SERVICES | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: prowlarr | ||
labels: | ||
{{- include "k8s-mediaserver.labels" . | nindent 4 }} | ||
spec: | ||
type: {{ .Values.prowlarr.service.type }} | ||
ports: | ||
- port: {{ .Values.prowlarr.service.port }} | ||
targetPort: {{ .Values.prowlarr.container.port }} | ||
protocol: TCP | ||
{{ if eq .Values.prowlarr.service.type "NodePort" }} | ||
nodePort: {{ .Values.prowlarr.service.nodePort }} | ||
{{ end }} | ||
name: prowlarr-port | ||
selector: | ||
app: prowlarr | ||
|
||
--- | ||
{{ if .Values.prowlarr.service.extraLBService }} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: prowlarr-lb | ||
annotations: | ||
{{- include .Values.prowlarr.service.extraLBService.annotations . | nindent 4 }} | ||
labels: | ||
{{- include "k8s-mediaserver.labels" . | nindent 4 }} | ||
spec: | ||
type: LoadBalancer | ||
ports: | ||
- port: {{ .Values.prowlarr.service.port }} | ||
targetPort: {{ .Values.prowlarr.container.port }} | ||
protocol: TCP | ||
name: prowlarr-port | ||
selector: | ||
app: prowlarr | ||
{{ end }} | ||
--- | ||
### INGRESS ### | ||
{{ if .Values.prowlarr.ingress.enabled }} | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: prowlarr | ||
labels: | ||
{{- include "k8s-mediaserver.labels" . | nindent 4 }} | ||
{{- with .Values.prowlarr.ingress.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
{{ if .Values.prowlarr.ingress.tls.enabled }} | ||
tls: | ||
- hosts: | ||
- {{ .Values.general.ingress_host | quote }} | ||
secretName: {{ .Values.prowlarr.ingress.tls.secretName }} | ||
{{ end }} | ||
ingressClassName: {{ .Values.general.ingress.ingressClassName }} | ||
rules: | ||
- host: {{ .Values.general.ingress_host | quote }} | ||
http: | ||
paths: | ||
- path: {{ .Values.prowlarr.ingress.path }} | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: prowlarr | ||
port: | ||
number: {{ .Values.prowlarr.service.port }} | ||
{{ end }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.