_nginx.tpl 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. {{- define "nginx.workload" -}}
  2. {{- $fullname := (include "ix.v1.common.lib.chart.names.fullname" $) -}}
  3. {{- $ncUrl := printf "http://%s:80" $fullname }}
  4. workload:
  5. nginx:
  6. enabled: true
  7. type: Deployment
  8. podSpec:
  9. hostNetwork: false
  10. containers:
  11. nginx:
  12. enabled: true
  13. primary: true
  14. imageSelector: nginxImage
  15. securityContext:
  16. runAsUser: 0
  17. runAsGroup: 0
  18. runAsNonRoot: false
  19. readOnlyRootFilesystem: false
  20. capabilities:
  21. add:
  22. - CHOWN
  23. - DAC_OVERRIDE
  24. - FOWNER
  25. - NET_BIND_SERVICE
  26. - NET_RAW
  27. - SETGID
  28. - SETUID
  29. probes:
  30. liveness:
  31. enabled: true
  32. type: https
  33. port: {{ .Values.ncNetwork.webPort }}
  34. path: /status.php
  35. httpHeaders:
  36. Host: localhost
  37. readiness:
  38. enabled: true
  39. type: https
  40. port: {{ .Values.ncNetwork.webPort }}
  41. path: /status.php
  42. httpHeaders:
  43. Host: localhost
  44. startup:
  45. enabled: true
  46. type: https
  47. port: {{ .Values.ncNetwork.webPort }}
  48. path: /status.php
  49. httpHeaders:
  50. Host: localhost
  51. initContainers:
  52. 01-wait-server:
  53. enabled: true
  54. type: init
  55. imageSelector: bashImage
  56. command:
  57. - bash
  58. args:
  59. - -c
  60. - |
  61. echo "Waiting for [{{ $ncUrl }}]";
  62. until wget --spider --quiet --timeout=3 --tries=1 {{ $ncUrl }}/status.php;
  63. do
  64. echo "Waiting for [{{ $ncUrl }}]";
  65. sleep 2;
  66. done
  67. echo "Nextcloud is up: {{ $ncUrl }}";
  68. {{- end -}}