_tftp.tpl 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. {{- define "tftp.workload" -}}
  2. workload:
  3. tftp:
  4. enabled: true
  5. primary: true
  6. type: Deployment
  7. podSpec:
  8. hostNetwork: {{ .Values.tftpNetwork.hostNetwork }}
  9. containers:
  10. tftp:
  11. enabled: true
  12. primary: true
  13. imageSelector: image
  14. securityContext:
  15. runAsUser: 0
  16. runAsGroup: 0
  17. runAsNonRoot: false
  18. readOnlyRootFilesystem: false
  19. capabilities:
  20. add:
  21. - NET_BIND_SERVICE
  22. - SETGID
  23. - SETUID
  24. - SYS_CHROOT
  25. env:
  26. MAPFILE: ""
  27. SECURE: "1"
  28. CREATE: {{ ternary "1" "0" .Values.tftpConfig.allowCreate | quote }}
  29. fixedEnv:
  30. UMASK: {{ ternary "020" "" .Values.tftpConfig.allowCreate | quote }}
  31. {{ with .Values.tftpConfig.additionalEnvs }}
  32. envList:
  33. {{ range $env := . }}
  34. - name: {{ $env.name }}
  35. value: {{ $env.value }}
  36. {{ end }}
  37. {{ end }}
  38. probes:
  39. liveness:
  40. enabled: true
  41. type: exec
  42. command:
  43. - /bin/sh
  44. - -c
  45. - |
  46. getent services tftp
  47. readiness:
  48. enabled: true
  49. type: exec
  50. command:
  51. - /bin/sh
  52. - -c
  53. - |
  54. getent services tftp
  55. startup:
  56. enabled: true
  57. type: exec
  58. command:
  59. - /bin/sh
  60. - -c
  61. - |
  62. getent services tftp
  63. initContainers:
  64. {{- include "ix.v1.common.app.permissions" (dict "containerName" "01-permissions"
  65. "UID" 9069
  66. "GID" 9069
  67. "mode" "check"
  68. "chmod" (ternary "757" "555" .Values.tftpConfig.allowCreate)
  69. "type" "init") | nindent 8 }}
  70. {{/* Service */}}
  71. service:
  72. tftp:
  73. enabled: true
  74. primary: true
  75. type: NodePort
  76. targetSelector: tftp
  77. ports:
  78. tftp:
  79. enabled: true
  80. primary: true
  81. port: {{ .Values.tftpNetwork.tftpPort }}
  82. nodePort: {{ .Values.tftpNetwork.tftpPort }}
  83. targetPort: 69
  84. protocol: udp
  85. targetSelector: tftp
  86. {{/* Persistence */}}
  87. persistence:
  88. tftpboot:
  89. enabled: true
  90. type: {{ .Values.tftpStorage.tftpboot.type }}
  91. datasetName: {{ .Values.tftpStorage.tftpboot.datasetName | default "" }}
  92. hostPath: {{ .Values.tftpStorage.tftpboot.hostPath | default "" }}
  93. targetSelector:
  94. tftp:
  95. tftp:
  96. mountPath: /tftpboot
  97. 01-permissions:
  98. mountPath: /mnt/directories/tftpboot
  99. {{- end -}}