_gitea.tpl 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. env:
  24. {{ range $env := . }}
  25. {{ $env.name }}: {{ $env.value }}
  26. {{ end }}
  27. {{ end }}
  28. probes:
  29. {{ $protocol := "http" }}
  30. {{ if .Values.giteaNetwork.certificateID }}
  31. {{ $protocol = "https" }}
  32. {{ end }}
  33. liveness:
  34. enabled: true
  35. type: {{ $protocol }}
  36. path: /api/healthz
  37. port: {{ .Values.giteaNetwork.webPort }}
  38. readiness:
  39. enabled: true
  40. type: {{ $protocol }}
  41. path: /api/healthz
  42. port: {{ .Values.giteaNetwork.webPort }}
  43. startup:
  44. enabled: true
  45. type: {{ $protocol }}
  46. path: /api/healthz
  47. port: {{ .Values.giteaNetwork.webPort }}
  48. initContainers:
  49. {{- include "ix.v1.common.app.permissions" (dict "containerName" "01-permissions"
  50. "UID" .Values.giteaRunAs.user
  51. "GID" .Values.giteaRunAs.group
  52. "type" "install") | nindent 8 }}
  53. {{- include "ix.v1.common.app.postgresWait" (dict "name" "postgres-wait"
  54. "secretName" "postgres-creds") | nindent 8 }}
  55. {{/* Service */}}
  56. service:
  57. gitea:
  58. enabled: true
  59. primary: true
  60. type: NodePort
  61. targetSelector: gitea
  62. ports:
  63. webui:
  64. enabled: true
  65. primary: true
  66. port: {{ .Values.giteaNetwork.webPort }}
  67. nodePort: {{ .Values.giteaNetwork.webPort }}
  68. targetSelector: gitea
  69. ssh:
  70. enabled: true
  71. port: {{ .Values.giteaNetwork.sshPort }}
  72. nodePort: {{ .Values.giteaNetwork.sshPort }}
  73. targetSelector: gitea
  74. {{/* Persistence */}}
  75. persistence:
  76. data:
  77. enabled: true
  78. type: {{ .Values.giteaStorage.data.type }}
  79. datasetName: {{ .Values.giteaStorage.data.datasetName | default "" }}
  80. hostPath: {{ .Values.giteaStorage.data.hostPath | default "" }}
  81. targetSelector:
  82. gitea:
  83. gitea:
  84. mountPath: /var/lib/gitea
  85. 01-permissions:
  86. mountPath: /mnt/directories/data
  87. config:
  88. enabled: true
  89. type: {{ .Values.giteaStorage.config.type }}
  90. datasetName: {{ .Values.giteaStorage.config.datasetName | default "" }}
  91. hostPath: {{ .Values.giteaStorage.config.hostPath | default "" }}
  92. targetSelector:
  93. gitea:
  94. gitea:
  95. mountPath: /etc/gitea
  96. 01-permissions:
  97. mountPath: /mnt/directories/config
  98. gitea-temp:
  99. enabled: true
  100. type: emptyDir
  101. targetSelector:
  102. gitea:
  103. gitea:
  104. mountPath: /tmp/gitea
  105. {{ if .Values.giteaNetwork.certificateID }}
  106. cert:
  107. enabled: true
  108. type: secret
  109. objectName: gitea-cert
  110. defaultMode: "0600"
  111. items:
  112. - key: tls.key
  113. path: private.key
  114. - key: tls.crt
  115. path: public.crt
  116. targetSelector:
  117. gitea:
  118. gitea:
  119. mountPath: /etc/certs/gitea
  120. readOnly: true
  121. {{ end }}
  122. {{- end -}}