_web.tpl 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. {{- define "castopod.web.workload" -}}
  2. {{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) -}}
  3. {{- $backend := printf "%s-castopod-api" $fullname }}
  4. workload:
  5. web:
  6. enabled: true
  7. type: Deployment
  8. podSpec:
  9. hostNetwork: false
  10. containers:
  11. web:
  12. enabled: true
  13. primary: true
  14. imageSelector: webImage
  15. securityContext:
  16. runAsUser: 0
  17. runAsGroup: 0
  18. runAsNonRoot: false
  19. readOnlyRootFilesystem: false
  20. capabilities:
  21. add:
  22. - CHOWN
  23. - SETGID
  24. - SETUID
  25. env:
  26. CP_APP_HOSTNAME: {{ $backend }}
  27. CP_TIMEOUT: {{ .Values.castopodConfig.webTimeout }}
  28. CP_MAX_BODY_SIZE: {{ printf "%vM" .Values.castopodConfig.webMaxBodySize }}
  29. probes:
  30. liveness:
  31. enabled: true
  32. type: http
  33. path: /health
  34. port: 80
  35. readiness:
  36. enabled: true
  37. type: http
  38. path: /health
  39. port: 80
  40. startup:
  41. enabled: true
  42. type: http
  43. path: /health
  44. port: 80
  45. initContainers:
  46. wait-server:
  47. enabled: true
  48. type: init
  49. imageSelector: bashImage
  50. command:
  51. - bash
  52. args:
  53. - -c
  54. - |
  55. echo "Waiting for backend to be ready at [{{ $backend }}:9000]"
  56. until nc -vz -w 5 "{{ $backend }}" 9000; do
  57. echo "Waiting for backend to be ready at [{{ $backend }}:9000]"
  58. sleep 1
  59. done
  60. {{- end -}}