_sonarr.tpl 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. env:
  18. SONARR__SERVER__PORT: {{ .Values.sonarrNetwork.webPort }}
  19. SONARR__APP__INSTANCENAME: {{ .Values.sonarrConfig.instanceName }}
  20. {{ with .Values.sonarrConfig.additionalEnvs }}
  21. envList:
  22. {{ range $env := . }}
  23. - name: {{ $env.name }}
  24. value: {{ $env.value }}
  25. {{ end }}
  26. {{ end }}
  27. probes:
  28. liveness:
  29. enabled: true
  30. type: http
  31. port: "{{ .Values.sonarrNetwork.webPort }}"
  32. path: /ping
  33. readiness:
  34. enabled: true
  35. type: http
  36. port: "{{ .Values.sonarrNetwork.webPort }}"
  37. path: /ping
  38. startup:
  39. enabled: true
  40. type: http
  41. port: "{{ .Values.sonarrNetwork.webPort }}"
  42. path: /ping
  43. initContainers:
  44. {{- include "ix.v1.common.app.permissions" (dict "containerName" "01-permissions"
  45. "UID" .Values.sonarrRunAs.user
  46. "GID" .Values.sonarrRunAs.group
  47. "mode" "check"
  48. "type" "install") | nindent 8 }}
  49. {{/* Service */}}
  50. service:
  51. sonarr:
  52. enabled: true
  53. primary: true
  54. type: NodePort
  55. targetSelector: sonarr
  56. ports:
  57. webui:
  58. enabled: true
  59. primary: true
  60. port: {{ .Values.sonarrNetwork.webPort }}
  61. nodePort: {{ .Values.sonarrNetwork.webPort }}
  62. targetSelector: sonarr
  63. {{/* Persistence */}}
  64. persistence:
  65. config:
  66. enabled: true
  67. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.sonarrStorage.config) | nindent 4 }}
  68. targetSelector:
  69. sonarr:
  70. sonarr:
  71. mountPath: /config
  72. {{- if and (eq .Values.sonarrStorage.config.type "ixVolume")
  73. (not (.Values.sonarrStorage.config.ixVolumeConfig | default dict).aclEnable) }}
  74. 01-permissions:
  75. mountPath: /mnt/directories/config
  76. {{- end }}
  77. tmp:
  78. enabled: true
  79. type: emptyDir
  80. targetSelector:
  81. sonarr:
  82. sonarr:
  83. mountPath: /tmp
  84. {{- range $idx, $storage := .Values.sonarrStorage.additionalStorages }}
  85. {{ printf "sonarr-%v:" (int $idx) }}
  86. enabled: true
  87. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  88. targetSelector:
  89. sonarr:
  90. sonarr:
  91. mountPath: {{ $storage.mountPath }}
  92. {{- if and (eq $storage.type "ixVolume") (not ($storage.ixVolumeConfig | default dict).aclEnable) }}
  93. 01-permissions:
  94. mountPath: /mnt/directories{{ $storage.mountPath }}
  95. {{- end }}
  96. {{- end }}
  97. {{- end -}}