pod.yaml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. apiVersion: v1
  2. kind: Pod
  3. metadata:
  4. name: clamav
  5. labels:
  6. app.kubernetes.io/name: clamav
  7. app.kubernetes.io/part-of: clamav
  8. annotations:
  9. # Setting spec.force to true will make Flux recreate the Pod when any
  10. # immutable field is changed, forcing the Job to run every time the
  11. # container image tag changes.
  12. kustomize.toolkit.fluxcd.io/force: enabled
  13. spec:
  14. automountServiceAccountToken: false
  15. containers:
  16. - command:
  17. - /entrypoint.sh
  18. env:
  19. - name: container
  20. value: docker
  21. image: harbor.corp1.majordomo.ru/nixos/container-systemd:25ce5a88
  22. livenessProbe:
  23. exec:
  24. command:
  25. - /run/current-system/sw/bin/systemctl
  26. - is-system-running
  27. failureThreshold: 100
  28. periodSeconds: 10
  29. timeoutSeconds: 15
  30. name: nixos-systemd
  31. resources:
  32. limits:
  33. cpu: 8000m
  34. memory: 8Gi
  35. requests:
  36. cpu: 100m
  37. memory: 1Gi
  38. securityContext:
  39. capabilities:
  40. add:
  41. - NET_ADMIN
  42. - NET_BIND_SERVICE
  43. - NET_RAW
  44. - SYS_ADMIN
  45. - SYS_NICE
  46. - SYS_TIME
  47. tty: true
  48. volumeMounts:
  49. - mountPath: /run
  50. name: run
  51. - mountPath: /tmp
  52. name: tmp
  53. - image: docker-registry.wugi.info/networking/3proxy:latest
  54. name: 3proxy
  55. resources:
  56. limits:
  57. memory: 512Mi
  58. volumeMounts:
  59. - mountPath: /etc/3proxy.cfg
  60. subPath: 3proxy.cfg
  61. name: 3proxy-configuration
  62. ports:
  63. - containerPort: 888
  64. name: 3proxy
  65. protocol: TCP
  66. - image: nixery.dev/shell/coreutils/util-linux/iptables/iproute2/netcat-openbsd/tcpdump
  67. name: nixery
  68. command:
  69. - /bin/sh
  70. - -c
  71. - |
  72. set -o nounset -o errexit -o pipefail -o xtrace
  73. private_networks=(
  74. 10.0.0.0/8
  75. 172.16.0.0/12
  76. 192.168.0.0/16
  77. )
  78. iptables -t nat -N TOR
  79. for network in "${private_networks[@]}"
  80. do
  81. iptables -t nat -A TOR -d "$network" -j RETURN
  82. done
  83. iptables -t nat -A TOR -p tcp -j REDIRECT --to-ports 888
  84. iptables -t nat -A OUTPUT -p tcp -j TOR
  85. exec /bin/sleep infinity
  86. securityContext:
  87. capabilities:
  88. add:
  89. - NET_ADMIN
  90. - NET_BIND_SERVICE
  91. - NET_RAW
  92. resources:
  93. limits:
  94. memory: 512Mi
  95. volumes:
  96. - emptyDir:
  97. medium: Memory
  98. sizeLimit: 512M
  99. name: run
  100. - emptyDir:
  101. medium: Memory
  102. sizeLimit: 2G
  103. name: tmp
  104. - name: 3proxy-configuration
  105. configMap:
  106. name: 3proxy-configuration