_sonarr.tpl 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. {{- define "sonarr.workload" -}}
  2. workload:
  3. sonarr:
  4. enabled: true
  5. primary: true
  6. type: Deployment
  7. podSpec:
  8. hostNetwork: {{ .Values.sonarrNetwork.hostNetwork }}
  9. containers:
  10. sonarr:
  11. enabled: true
  12. primary: true
  13. imageSelector: image
  14. securityContext:
  15. runAsUser: {{ .Values.sonarrRunAs.user }}
  16. runAsGroup: {{ .Values.sonarrRunAs.group }}
  17. {{ with .Values.sonarrConfig.additionalEnvs }}
  18. env:
  19. {{ range $env := . }}
  20. {{ $env.name }}: {{ $env.value }}
  21. {{ end }}
  22. {{ end }}
  23. env:
  24. SONARR__PORT: {{ .Values.sonarrNetwork.webPort }}
  25. SONARR__INSTANCE_NAME: {{ .Values.sonarrConfig.instanceName }}
  26. probes:
  27. liveness:
  28. enabled: true
  29. type: http
  30. port: "{{ .Values.sonarrNetwork.webPort }}"
  31. path: /ping
  32. readiness:
  33. enabled: true
  34. type: http
  35. port: "{{ .Values.sonarrNetwork.webPort }}"
  36. path: /ping
  37. startup:
  38. enabled: true
  39. type: http
  40. port: "{{ .Values.sonarrNetwork.webPort }}"
  41. path: /ping
  42. initContainers:
  43. {{- include "ix.v1.common.app.permissions" (dict "containerName" "01-permissions"
  44. "UID" .Values.sonarrRunAs.user
  45. "GID" .Values.sonarrRunAs.group
  46. "mode" "check"
  47. "type" "init") | nindent 8 }}
  48. {{/* Service */}}
  49. service:
  50. sonarr:
  51. enabled: true
  52. primary: true
  53. type: NodePort
  54. targetSelector: sonarr
  55. ports:
  56. webui:
  57. enabled: true
  58. primary: true
  59. port: {{ .Values.sonarrNetwork.webPort }}
  60. nodePort: {{ .Values.sonarrNetwork.webPort }}
  61. targetSelector: sonarr
  62. {{/* Persistence */}}
  63. persistence:
  64. config:
  65. enabled: true
  66. type: {{ .Values.sonarrStorage.config.type }}
  67. datasetName: {{ .Values.sonarrStorage.config.datasetName | default "" }}
  68. hostPath: {{ .Values.sonarrStorage.config.hostPath | default "" }}
  69. targetSelector:
  70. sonarr:
  71. sonarr:
  72. mountPath: /config
  73. 01-permissions:
  74. mountPath: /mnt/directories/config
  75. {{- range $idx, $storage := .Values.sonarrStorage.additionalStorages }}
  76. {{ printf "sonarr-%v" (int $idx) }}:
  77. enabled: true
  78. type: {{ $storage.type }}
  79. datasetName: {{ $storage.datasetName | default "" }}
  80. hostPath: {{ $storage.hostPath | default "" }}
  81. targetSelector:
  82. sonarr:
  83. sonarr:
  84. mountPath: {{ $storage.mountPath }}
  85. 01-permissions:
  86. mountPath: /mnt/directories{{ $storage.mountPath }}
  87. {{- end }}
  88. {{- end -}}