_adguard.tpl 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. # If appVersion is 0.107.29 or above add this flag
  25. {{- if semverCompare "~0.107.29" (.Values.image.tag | replace "v" "") }}
  26. - /opt/adguardhome/AdGuardHome
  27. {{- end }}
  28. - --no-check-update
  29. - --host
  30. - "0.0.0.0"
  31. - --config
  32. - /opt/adguardhome/conf/AdGuardHome.yaml
  33. - --work-dir
  34. - /opt/adguardhome/work
  35. - --port
  36. - {{ .Values.adguardNetwork.webPort | quote }}
  37. # Setup wizard shows an option to select the port that AdGuardHome
  38. # Web UI will listen on. If the user selects anything other than the `webPort`,
  39. # container will reload its new configuration and listen to the user specified port.
  40. # But user won't have access to it because the port is not exposed. Few seconds later
  41. # probes will kill the container and restart it with the correct `webPort` port.
  42. securityContext:
  43. # FIXME: It might be able to run rootless, probably blocked by:
  44. # https://github.com/AdguardTeam/AdGuardHome/issues/4681
  45. runAsNonRoot: false
  46. runAsUser: 0
  47. runAsGroup: 0
  48. capabilities:
  49. add:
  50. - NET_BIND_SERVICE
  51. {{ if .Values.adguardNetwork.enableDHCP }}
  52. - NET_RAW
  53. {{ end }}
  54. # FIXME: Switch to exec probe after this issue is solved, also note that healthcheck
  55. # is only available on "edge" tag, as of 27/03/2023
  56. # https://github.com/AdguardTeam/AdGuardHome/issues/3290#issuecomment-1485451976
  57. probes:
  58. liveness:
  59. enabled: true
  60. type: http
  61. path: /
  62. port: {{ .Values.adguardNetwork.webPort }}
  63. readiness:
  64. enabled: true
  65. type: http
  66. path: /
  67. port: {{ .Values.adguardNetwork.webPort }}
  68. startup:
  69. enabled: true
  70. type: http
  71. path: /
  72. port: {{ .Values.adguardNetwork.webPort }}
  73. {{/* # FIXME: Disabled until it can run as non-root
  74. initContainers:
  75. {{- include "ix.v1.common.app.permissions" (dict "containerName" "01-permissions"
  76. "UID" .Values.ipfsRunAs.user
  77. "GID" .Values.ipfsRunAs.group
  78. "type" "install") | nindent 8 }}
  79. */}}
  80. {{/* Persistence */}}
  81. persistence:
  82. work:
  83. enabled: true
  84. type: {{ .Values.adguardStorage.work.type }}
  85. datasetName: {{ .Values.adguardStorage.work.datasetName | default "" }}
  86. hostPath: {{ .Values.adguardStorage.work.hostPath | default "" }}
  87. targetSelector:
  88. adguard:
  89. adguard:
  90. mountPath: /opt/adguardhome/work
  91. {{/* # FIXME: See above
  92. 01-permissions:
  93. mountPath: /mnt/directories/work
  94. */}}
  95. conf:
  96. enabled: true
  97. type: {{ .Values.adguardStorage.conf.type }}
  98. datasetName: {{ .Values.adguardStorage.conf.datasetName | default "" }}
  99. hostPath: {{ .Values.adguardStorage.conf.hostPath | default "" }}
  100. targetSelector:
  101. adguard:
  102. adguard:
  103. mountPath: /opt/adguardhome/conf
  104. {{/* # FIXME: See above
  105. 01-permissions:
  106. mountPath: /mnt/directories/conf
  107. */}}
  108. {{- end -}}