Meta repo for gitea.kosmos.org operation, issues, suggestions, and feedback.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
2.5 KiB

  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: gitea-server
  5. labels:
  6. app: gitea
  7. spec:
  8. replicas: 1
  9. selector:
  10. matchLabels:
  11. app: gitea
  12. template:
  13. metadata:
  14. labels:
  15. name: gitea-server
  16. app: gitea
  17. spec:
  18. initContainers:
  19. - name: init-config
  20. # This is a busybox image with our gitea customizations saved to
  21. # /custom, built using ./script/build_customizations_image from the
  22. # root of the repo
  23. image: eu.gcr.io/fluted-magpie-218106/gitea_custom:0.1.2
  24. command: [
  25. 'sh', '-c',
  26. 'mkdir -p /data/gitea/conf && mkdir -p /data/gitea/https && cp /root/conf/app.ini /data/gitea/conf/app.ini && chown 1000:1000 /data/gitea/conf/app.ini && chmod 660 /data/gitea/conf/app.ini && cp /root/conf/*.pem /data/gitea/https && chmod 600 /data/gitea/https/*.pem && cp -R /custom/* /data/gitea && chown -R 1000:1000 /data/gitea'
  27. ]
  28. volumeMounts:
  29. - mountPath: /data
  30. name: gitea-server-data
  31. - mountPath: /root/conf
  32. name: config
  33. containers:
  34. - name: gitea-server
  35. image: gitea/gitea:1.9.0
  36. ports:
  37. - containerPort: 3000
  38. - containerPort: 3001
  39. - containerPort: 22
  40. volumeMounts:
  41. - mountPath: /data
  42. name: gitea-server-data
  43. resources:
  44. requests:
  45. cpu: 250m
  46. memory: 256Mi
  47. limits:
  48. cpu: 500m
  49. memory: 512Mi
  50. restartPolicy: Always
  51. volumes:
  52. - name: gitea-server-data
  53. persistentVolumeClaim:
  54. claimName: gitea-server-data
  55. - name: config
  56. secret:
  57. secretName: gitea-config
  58. items:
  59. - key: app.ini
  60. path: app.ini
  61. mode: 256
  62. - key: cert.pem
  63. path: cert.pem
  64. mode: 256
  65. - key: key.pem
  66. path: key.pem
  67. mode: 256
  68. ---
  69. apiVersion: v1
  70. kind: PersistentVolumeClaim
  71. metadata:
  72. name: gitea-server-data
  73. labels:
  74. app: gitea
  75. spec:
  76. accessModes:
  77. - ReadWriteOnce
  78. resources:
  79. requests:
  80. storage: 20Gi
  81. ---
  82. apiVersion: v1
  83. kind: Service
  84. metadata:
  85. name: gitea-server
  86. labels:
  87. name: gitea-server
  88. app: gitea
  89. spec:
  90. type: LoadBalancer
  91. # preserves the client source IP
  92. externalTrafficPolicy: Local
  93. ports:
  94. - name: "ssh"
  95. port: 22
  96. targetPort: 22
  97. - name: "http"
  98. port: 80
  99. targetPort: 3001
  100. - name: "https"
  101. port: 443
  102. targetPort: 3000
  103. selector:
  104. name: gitea-server