_frigate.tpl 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. {{- define "frigate.workload" -}}
  2. workload:
  3. frigate:
  4. enabled: true
  5. primary: true
  6. type: Deployment
  7. podSpec:
  8. hostNetwork: {{ .Values.frigateNetwork.hostNetwork }}
  9. containers:
  10. frigate:
  11. enabled: true
  12. primary: true
  13. imageSelector: {{ .Values.frigateConfig.imageSelector | default "image" }}
  14. securityContext:
  15. runAsUser: 0
  16. runAsGroup: 0
  17. runAsNonRoot: false
  18. readOnlyRootFilesystem: false
  19. {{- if .Values.frigateConfig.mountUSBBus }}
  20. privileged: true
  21. allowPrivilegeEscalation: true
  22. {{- end }}
  23. capabilities:
  24. add:
  25. - CHOWN
  26. - DAC_OVERRIDE
  27. - FOWNER
  28. - SETUID
  29. - SETGID
  30. {{ with .Values.frigateConfig.additionalEnvs }}
  31. envList:
  32. {{ range $env := . }}
  33. - name: {{ $env.name }}
  34. value: {{ $env.value }}
  35. {{ end }}
  36. {{ end }}
  37. probes:
  38. liveness:
  39. enabled: true
  40. type: http
  41. port: 5000
  42. path: /api
  43. readiness:
  44. enabled: true
  45. type: http
  46. port: 5000
  47. path: /api
  48. startup:
  49. enabled: true
  50. type: http
  51. port: 5000
  52. path: /api
  53. initContainers:
  54. 01-init:
  55. enabled: true
  56. type: init
  57. imageSelector: bashImage
  58. securityContext:
  59. runAsUser: 0
  60. runAsGroup: 0
  61. runAsNonRoot: false
  62. readOnlyRootFilesystem: false
  63. command:
  64. - /bin/sh
  65. args:
  66. - -c
  67. - |
  68. if [ ! -f /config/config.yml ]; then
  69. {
  70. echo 'mqtt:'
  71. echo ' enabled: false'
  72. echo 'cameras:'
  73. echo ' dummy:'
  74. echo ' enabled: false'
  75. echo ' ffmpeg:'
  76. echo ' inputs:'
  77. echo ' - path: rtsp://127.0.0.1:554/rtsp'
  78. echo ' roles:'
  79. echo ' - detect'
  80. } > /config/config.yml
  81. fi
  82. {{- with .Values.frigateGPU }}
  83. scaleGPU:
  84. {{- range $key, $value := . }}
  85. - gpu:
  86. {{ $key }}: {{ $value }}
  87. targetSelector:
  88. frigate:
  89. - frigate
  90. {{- end }}
  91. {{- end -}}
  92. {{- end -}}