_clamav.tpl 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. {{- define "clamav.workload" -}}
  2. workload:
  3. clamav:
  4. enabled: true
  5. primary: true
  6. type: Deployment
  7. podSpec:
  8. hostNetwork: false
  9. containers:
  10. clamav:
  11. enabled: true
  12. primary: true
  13. tty: true
  14. stdin: true
  15. imageSelector: image
  16. securityContext:
  17. # FIXME: https://github.com/Cisco-Talos/clamav/issues/478
  18. runAsUser: 0
  19. runAsGroup: 0
  20. runAsNonRoot: false
  21. readOnlyRootFilesystem: false
  22. capabilities:
  23. add:
  24. - CHOWN
  25. - DAC_OVERRIDE
  26. - FOWNER
  27. - SETUID
  28. - SETGID
  29. env:
  30. CLAMAV_NO_CLAMD: {{ .Values.clamavConfig.disableClamd | quote }}
  31. CLAMAV_NO_FRESHCLAMD: {{ .Values.clamavConfig.disableFreshClamd | quote }}
  32. CLAMAV_NO_MILTERD: {{ .Values.clamavConfig.disableMilterd | quote }}
  33. CLAMD_STARTUP_TIMEOUT: {{ .Values.clamavConfig.clamdStartupTimeout | quote }}
  34. FRESHCLAM_CHECKS: {{ .Values.clamavConfig.freshclamChecks | quote }}
  35. {{ with .Values.clamavConfig.additionalEnvs }}
  36. envList:
  37. {{ range $env := . }}
  38. - name: {{ $env.name }}
  39. value: {{ $env.value }}
  40. {{ end }}
  41. {{ end }}
  42. probes:
  43. liveness:
  44. enabled: {{ not .Values.clamavConfig.disableClamd }}
  45. type: exec
  46. command: clamdcheck.sh
  47. readiness:
  48. enabled: {{ not .Values.clamavConfig.disableClamd }}
  49. type: exec
  50. command: clamdcheck.sh
  51. startup:
  52. enabled: {{ not .Values.clamavConfig.disableClamd }}
  53. type: exec
  54. command: clamdcheck.sh
  55. {{/* Service */}}
  56. service:
  57. clamav:
  58. enabled: {{ or (not .Values.clamavConfig.disableClamd) (not .Values.clamavConfig.disableMilterd) }}
  59. primary: true
  60. type: NodePort
  61. targetSelector: clamav
  62. ports:
  63. clamd:
  64. enabled: {{ not .Values.clamavConfig.disableClamd }}
  65. primary: true
  66. port: {{ .Values.clamavNetwork.clamdPort }}
  67. nodePort: {{ .Values.clamavNetwork.clamdPort }}
  68. targetPort: 3310
  69. targetSelector: clamav
  70. milted:
  71. enabled: {{ not .Values.clamavConfig.disableMilterd }}
  72. primary: {{ .Values.clamavConfig.disableClamd }}
  73. port: {{ .Values.clamavNetwork.milterdPort }}
  74. nodePort: {{ .Values.clamavNetwork.milterdPort }}
  75. targetPort: 7357
  76. targetSelector: clamav
  77. {{/* Persistence */}}
  78. persistence:
  79. data:
  80. enabled: true
  81. type: {{ .Values.clamavStorage.sigdb.type }}
  82. datasetName: {{ .Values.clamavStorage.sigdb.datasetName | default "" }}
  83. hostPath: {{ .Values.clamavStorage.sigdb.hostPath | default "" }}
  84. targetSelector:
  85. clamav:
  86. clamav:
  87. mountPath: /var/lib/clamav
  88. scan-dir:
  89. enabled: true
  90. type: {{ .Values.clamavStorage.scandir.type }}
  91. datasetName: {{ .Values.clamavStorage.scandir.datasetName | default "" }}
  92. hostPath: {{ .Values.clamavStorage.scandir.hostPath | default "" }}
  93. targetSelector:
  94. clamav:
  95. clamav:
  96. mountPath: /scandir
  97. {{- end -}}