_gitea.tpl 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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.permissions" (dict "containerName" "01-permissions"
  51. "UID" .Values.giteaRunAs.user
  52. "GID" .Values.giteaRunAs.group
  53. "type" "install") | nindent 8 }}
  54. {{- include "ix.v1.common.app.postgresWait" (dict "name" "postgres-wait"
  55. "secretName" "postgres-creds") | nindent 8 }}
  56. {{/* Service */}}
  57. service:
  58. gitea:
  59. enabled: true
  60. primary: true
  61. type: NodePort
  62. targetSelector: gitea
  63. ports:
  64. webui:
  65. enabled: true
  66. primary: true
  67. port: {{ .Values.giteaNetwork.webPort }}
  68. nodePort: {{ .Values.giteaNetwork.webPort }}
  69. targetSelector: gitea
  70. ssh:
  71. enabled: true
  72. port: {{ .Values.giteaNetwork.sshPort }}
  73. nodePort: {{ .Values.giteaNetwork.sshPort }}
  74. targetSelector: gitea
  75. {{/* Persistence */}}
  76. persistence:
  77. data:
  78. enabled: true
  79. type: {{ .Values.giteaStorage.data.type }}
  80. datasetName: {{ .Values.giteaStorage.data.datasetName | default "" }}
  81. hostPath: {{ .Values.giteaStorage.data.hostPath | default "" }}
  82. targetSelector:
  83. gitea:
  84. gitea:
  85. mountPath: /var/lib/gitea
  86. 01-permissions:
  87. mountPath: /mnt/directories/data
  88. config:
  89. enabled: true
  90. type: {{ .Values.giteaStorage.config.type }}
  91. datasetName: {{ .Values.giteaStorage.config.datasetName | default "" }}
  92. hostPath: {{ .Values.giteaStorage.config.hostPath | default "" }}
  93. targetSelector:
  94. gitea:
  95. gitea:
  96. mountPath: /etc/gitea
  97. 01-permissions:
  98. mountPath: /mnt/directories/config
  99. gitea-temp:
  100. enabled: true
  101. type: emptyDir
  102. targetSelector:
  103. gitea:
  104. gitea:
  105. mountPath: /tmp/gitea
  106. {{ if .Values.giteaNetwork.certificateID }}
  107. cert:
  108. enabled: true
  109. type: secret
  110. objectName: gitea-cert
  111. defaultMode: "0600"
  112. items:
  113. - key: tls.key
  114. path: private.key
  115. - key: tls.crt
  116. path: public.crt
  117. targetSelector:
  118. gitea:
  119. gitea:
  120. mountPath: /etc/certs/gitea
  121. readOnly: true
  122. {{ end }}
  123. {{- end -}}