_adguard.tpl 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. {{- define "adguard.workload" -}}
  2. workload:
  3. adguard:
  4. enabled: true
  5. primary: true
  6. type: Deployment
  7. podSpec:
  8. # Host network is pretty much a requirement for apps like this.
  9. # Because NodePort can't bind ports like 53(DNS) or 67(DHCP)
  10. # and the majority of devices do not have option to change the port.
  11. hostNetwork: true
  12. containers:
  13. adguard:
  14. enabled: true
  15. primary: true
  16. imageSelector: image
  17. # Args are copied from the official docker image
  18. # So we can also specify the port.
  19. # If we dont specify the port here, AdGuardHome
  20. # will start initially at port 3000 and after
  21. # the setup wizard is completed it will switch
  22. # to user specified port.
  23. args:
  24. - --no-check-update
  25. - --host
  26. - "0.0.0.0"
  27. - --config
  28. - /opt/adguardhome/conf/AdGuardHome.yaml
  29. - --work-dir
  30. - /opt/adguardhome/work
  31. - --port
  32. - {{ .Values.adguardNetwork.webPort | quote }}
  33. # Setup wizard shows an option to select the port that AdGuardHome
  34. # Web UI will listen on. If the user selects anything other than the `webPort`,
  35. # container will reload its new configuration and listen to the user specified port.
  36. # But user won't have access to it because the port is not exposed. Few seconds later
  37. # probes will kill the container and restart it with the correct `webPort` port.
  38. securityContext:
  39. # FIXME: It might be able to run rootless, probably blocked by:
  40. # https://github.com/AdguardTeam/AdGuardHome/issues/4681
  41. runAsNonRoot: false
  42. runAsUser: 0
  43. runAsGroup: 0
  44. capabilities:
  45. add:
  46. - NET_BIND_SERVICE
  47. {{ if .Values.adguardNetwork.enableDHCP }}
  48. - NET_RAW
  49. {{ end }}
  50. # FIXME: Switch to exec probe after this issue is solved, also note that healthcheck
  51. # is only available on "edge" tag, as of 27/03/2023
  52. # https://github.com/AdguardTeam/AdGuardHome/issues/3290#issuecomment-1485451976
  53. probes:
  54. liveness:
  55. enabled: true
  56. type: http
  57. path: /
  58. port: {{ .Values.adguardNetwork.webPort }}
  59. readiness:
  60. enabled: true
  61. type: http
  62. path: /
  63. port: {{ .Values.adguardNetwork.webPort }}
  64. startup:
  65. enabled: true
  66. type: http
  67. path: /
  68. port: {{ .Values.adguardNetwork.webPort }}
  69. {{/* # FIXME: Disabled until it can run as non-root
  70. initContainers:
  71. {{- include "ix.v1.common.app.permissions" (dict "containerName" "01-permissions"
  72. "UID" .Values.ipfsRunAs.user
  73. "GID" .Values.ipfsRunAs.group
  74. "type" "install") | nindent 8 }}
  75. */}}
  76. {{/* Persistence */}}
  77. persistence:
  78. work:
  79. enabled: true
  80. type: {{ .Values.adguardStorage.work.type }}
  81. datasetName: {{ .Values.adguardStorage.work.datasetName | default "" }}
  82. hostPath: {{ .Values.adguardStorage.work.hostPath | default "" }}
  83. targetSelector:
  84. adguard:
  85. adguard:
  86. mountPath: /opt/adguardhome/work
  87. {{/* # FIXME: See above
  88. 01-permissions:
  89. mountPath: /mnt/directories/work
  90. */}}
  91. conf:
  92. enabled: true
  93. type: {{ .Values.adguardStorage.conf.type }}
  94. datasetName: {{ .Values.adguardStorage.conf.datasetName | default "" }}
  95. hostPath: {{ .Values.adguardStorage.conf.hostPath | default "" }}
  96. targetSelector:
  97. adguard:
  98. adguard:
  99. mountPath: /opt/adguardhome/conf
  100. {{/* # FIXME: See above
  101. 01-permissions:
  102. mountPath: /mnt/directories/conf
  103. */}}
  104. {{- end -}}