gogs.yaml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. ---
  2. kind: Deployment
  3. apiVersion: apps/v1
  4. metadata:
  5. name: gogs
  6. labels:
  7. app: gogs
  8. spec:
  9. replicas: 1
  10. selector:
  11. matchLabels:
  12. app: gogs
  13. template:
  14. metadata:
  15. labels:
  16. app: gogs
  17. spec:
  18. containers:
  19. - name: gogs
  20. image: gogs/gogs
  21. env:
  22. - name: PUID
  23. value: "1000"
  24. - name: PGID
  25. value: "1000"
  26. - name: SOCAT_LINK
  27. value: "false"
  28. ports:
  29. - name: web
  30. containerPort: 3000
  31. - name: ssh
  32. containerPort: 2222
  33. volumeMounts:
  34. - name: gogs-data-volume
  35. mountPath: "/data"
  36. - name: "gogs-sshd-config"
  37. mountPath: "/app/gogs/docker/sshd_config"
  38. subPath: "sshd_config"
  39. - name: "gogs-appini-config"
  40. mountPath: "/data/gogs/conf/app.ini"
  41. subPath: "app.ini"
  42. volumes:
  43. - name: gogs-data-volume
  44. persistentVolumeClaim:
  45. claimName: gogs-data-pvc
  46. - name: "gogs-sshd-config"
  47. configMap:
  48. name: "gogs-sshd-config"
  49. - name: "gogs-appini-config"
  50. configMap:
  51. name: "gogs-appini-config"
  52. ---
  53. apiVersion: v1
  54. kind: Service
  55. metadata:
  56. name: gogs
  57. spec:
  58. type: ClusterIP
  59. ports:
  60. - name: web
  61. port: 3000
  62. selector:
  63. app: gogs
  64. ---
  65. apiVersion: v1
  66. kind: Service
  67. metadata:
  68. name: gogs-ssh
  69. spec:
  70. type: ClusterIP
  71. ports:
  72. - name: ssh-tcp-svc
  73. port: 2222
  74. selector:
  75. app: gogs
  76. ---
  77. apiVersion: traefik.containo.us/v1alpha1
  78. kind: IngressRoute
  79. metadata:
  80. name: gogs-ingress-route
  81. namespace: default
  82. spec:
  83. entryPoints:
  84. - web
  85. routes:
  86. - match: Host(`gogs.dezendorf.net`)
  87. kind: Rule
  88. middlewares:
  89. - name: redirecthttps
  90. services:
  91. - name: gogs
  92. port: 3000
  93. ---
  94. apiVersion: traefik.containo.us/v1alpha1
  95. kind: IngressRoute
  96. metadata:
  97. name: gogs-websecure-route
  98. namespace: default
  99. spec:
  100. entryPoints:
  101. - websecure
  102. routes:
  103. - match: Host(`gogs.dezendorf.net`)
  104. kind: Rule
  105. services:
  106. - name: gogs
  107. port: 3000
  108. tls:
  109. certResolver: myresolver
  110. ---
  111. apiVersion: traefik.containo.us/v1alpha1
  112. kind: IngressRouteTCP
  113. metadata:
  114. name: gogs-ssh-route
  115. spec:
  116. entryPoints:
  117. - ssh-tcp
  118. routes:
  119. - match: HostSNI(`*`)
  120. priority: 10
  121. services:
  122. - name: gogs-ssh
  123. port: 2222
  124. ---
  125. apiVersion: v1
  126. kind: PersistentVolumeClaim
  127. metadata:
  128. name: gogs-data-pvc
  129. spec:
  130. accessModes:
  131. - ReadWriteOnce
  132. storageClassName: longhorn
  133. resources:
  134. requests:
  135. storage: 500M
  136. ---
  137. apiVersion: v1
  138. kind: ConfigMap
  139. metadata:
  140. name: gogs-sshd-config
  141. namespace: default
  142. data:
  143. sshd_config: |
  144. Port 2222
  145. AddressFamily any
  146. ListenAddress 0.0.0.0
  147. ListenAddress ::
  148. Protocol 2
  149. LogLevel INFO
  150. HostKey /data/ssh/ssh_host_rsa_key
  151. HostKey /data/ssh/ssh_host_dsa_key
  152. HostKey /data/ssh/ssh_host_ecdsa_key
  153. HostKey /data/ssh/ssh_host_ed25519_key
  154. PermitRootLogin no
  155. AuthorizedKeysFile .ssh/authorized_keys
  156. PasswordAuthentication no
  157. PermitUserEnvironment yes
  158. AllowUsers git
  159. ---
  160. apiVersion: v1
  161. kind: ConfigMap
  162. metadata:
  163. name: gogs-appini-config
  164. namespace: default
  165. data:
  166. app.ini: |
  167. BRAND_NAME = Gogs
  168. RUN_USER = git
  169. RUN_MODE = prod
  170. [database]
  171. TYPE = sqlite3
  172. HOST = 127.0.0.1:5432
  173. NAME = gogs
  174. SCHEMA = public
  175. USER = gogs
  176. PASSWORD =
  177. SSL_MODE = disable
  178. PATH = data/gogs.db
  179. [repository]
  180. ROOT = /data/git/gogs-repositories
  181. [server]
  182. DOMAIN = gogs.dezendorf.net
  183. HTTP_PORT = 3000
  184. EXTERNAL_URL = https://gogs.dezendorf.net/
  185. DISABLE_SSH = false
  186. SSH_PORT = 2222
  187. SSH_LISTEN_PORT = 2222
  188. START_SSH_SERVER = false
  189. OFFLINE_MODE = false
  190. [mailer]
  191. ENABLED = false
  192. [auth]
  193. REQUIRE_EMAIL_CONFIRMATION = false
  194. DISABLE_REGISTRATION = false
  195. ENABLE_REGISTRATION_CAPTCHA = true
  196. REQUIRE_SIGNIN_VIEW = false
  197. [user]
  198. ENABLE_EMAIL_NOTIFICATION = false
  199. [picture]
  200. DISABLE_GRAVATAR = false
  201. ENABLE_FEDERATED_AVATAR = false
  202. [session]
  203. PROVIDER = file
  204. [log]
  205. MODE = file
  206. LEVEL = Info
  207. ROOT_PATH = /app/gogs/log
  208. [security]
  209. INSTALL_LOCK = true
  210. SECRET_KEY = WityxCyHAcBVyLm