_gitea.tpl 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. {{- define "gitea.workload" -}}
  2. workload:
  3. gitea:
  4. enabled: true
  5. primary: true
  6. type: Deployment
  7. podSpec:
  8. hostNetwork: {{ .Values.giteaNetwork.hostNetwork }}
  9. containers:
  10. gitea:
  11. enabled: true
  12. primary: true
  13. imageSelector: image
  14. securityContext:
  15. runAsUser: {{ .Values.giteaRunAs.user }}
  16. runAsGroup: {{ .Values.giteaRunAs.group }}
  17. envFrom:
  18. - secretRef:
  19. name: gitea-creds
  20. - configMapRef:
  21. name: gitea-config
  22. {{ with .Values.giteaConfig.additionalEnvs }}
  23. envList:
  24. {{ range $env := . }}
  25. - name: {{ $env.name }}
  26. value: {{ $env.value }}
  27. {{ end }}
  28. {{ end }}
  29. probes:
  30. {{ $protocol := "http" }}
  31. {{ if .Values.giteaNetwork.certificateID }}
  32. {{ $protocol = "https" }}
  33. {{ end }}
  34. liveness:
  35. enabled: true
  36. type: {{ $protocol }}
  37. path: /api/healthz
  38. port: {{ .Values.giteaNetwork.webPort }}
  39. readiness:
  40. enabled: true
  41. type: {{ $protocol }}
  42. path: /api/healthz
  43. port: {{ .Values.giteaNetwork.webPort }}
  44. startup:
  45. enabled: true
  46. type: {{ $protocol }}
  47. path: /api/healthz
  48. port: {{ .Values.giteaNetwork.webPort }}
  49. initContainers:
  50. {{- include "ix.v1.common.app.postgresWait" (dict "name" "postgres-wait"
  51. "secretName" "postgres-creds") | nindent 8 }}
  52. {{/* Service */}}
  53. service:
  54. gitea:
  55. enabled: true
  56. primary: true
  57. type: NodePort
  58. targetSelector: gitea
  59. ports:
  60. webui:
  61. enabled: true
  62. primary: true
  63. port: {{ .Values.giteaNetwork.webPort }}
  64. nodePort: {{ .Values.giteaNetwork.webPort }}
  65. targetSelector: gitea
  66. ssh:
  67. enabled: true
  68. port: {{ .Values.giteaNetwork.sshPort }}
  69. nodePort: {{ .Values.giteaNetwork.sshPort }}
  70. targetSelector: gitea
  71. {{/* Persistence */}}
  72. persistence:
  73. data:
  74. enabled: true
  75. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.giteaStorage.data) | nindent 4 }}
  76. targetSelector:
  77. gitea:
  78. gitea:
  79. mountPath: /var/lib/gitea
  80. 01-permissions:
  81. mountPath: /mnt/directories/data
  82. config:
  83. enabled: true
  84. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.giteaStorage.config) | nindent 4 }}
  85. targetSelector:
  86. gitea:
  87. gitea:
  88. mountPath: /etc/gitea
  89. 01-permissions:
  90. mountPath: /mnt/directories/config
  91. gitea-temp:
  92. enabled: true
  93. type: emptyDir
  94. targetSelector:
  95. gitea:
  96. gitea:
  97. mountPath: /tmp/gitea
  98. {{- range $idx, $storage := .Values.giteaStorage.additionalStorages }}
  99. {{ printf "gitea-%v:" (int $idx) }}
  100. enabled: true
  101. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  102. targetSelector:
  103. gitea:
  104. gitea:
  105. mountPath: {{ $storage.mountPath }}
  106. {{- end }}
  107. {{ if .Values.giteaNetwork.certificateID }}
  108. cert:
  109. enabled: true
  110. type: secret
  111. objectName: gitea-cert
  112. defaultMode: "0600"
  113. items:
  114. - key: tls.key
  115. path: private.key
  116. - key: tls.crt
  117. path: public.crt
  118. targetSelector:
  119. gitea:
  120. gitea:
  121. mountPath: /etc/certs/gitea
  122. readOnly: true
  123. {{ end }}
  124. {{- end -}}