_sonarr.tpl 3.0 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__PORT: {{ .Values.sonarrNetwork.webPort }}
  19. SONARR__INSTANCE_NAME: {{ .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" "init") | 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. type: {{ .Values.sonarrStorage.config.type }}
  68. datasetName: {{ .Values.sonarrStorage.config.datasetName | default "" }}
  69. hostPath: {{ .Values.sonarrStorage.config.hostPath | default "" }}
  70. targetSelector:
  71. sonarr:
  72. sonarr:
  73. mountPath: /config
  74. 01-permissions:
  75. mountPath: /mnt/directories/config
  76. tmp:
  77. enabled: true
  78. type: emptyDir
  79. targetSelector:
  80. sonarr:
  81. sonarr:
  82. mountPath: /tmp
  83. {{- range $idx, $storage := .Values.sonarrStorage.additionalStorages }}
  84. {{ printf "sonarr-%v" (int $idx) }}:
  85. enabled: true
  86. type: {{ $storage.type }}
  87. datasetName: {{ $storage.datasetName | default "" }}
  88. hostPath: {{ $storage.hostPath | default "" }}
  89. targetSelector:
  90. sonarr:
  91. sonarr:
  92. mountPath: {{ $storage.mountPath }}
  93. 01-permissions:
  94. mountPath: /mnt/directories{{ $storage.mountPath }}
  95. {{- end }}
  96. {{- end -}}