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.

gitea.yml 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. apiVersion: v1
  2. kind: Namespace
  3. metadata:
  4. name: gitea
  5. ---
  6. apiVersion: apps/v1
  7. kind: Deployment
  8. metadata:
  9. name: gitea
  10. namespace: gitea
  11. labels:
  12. app: gitea
  13. spec:
  14. replicas: 1
  15. template:
  16. metadata:
  17. name: gitea
  18. labels:
  19. app: gitea
  20. spec:
  21. containers:
  22. - name: gitea
  23. image: gitea/gitea:latest
  24. imagePullPolicy: Always
  25. volumeMounts:
  26. - mountPath: "/var/lib/gitea"
  27. name: "root"
  28. - mountPath: "/data"
  29. name: "data"
  30. ports:
  31. - containerPort: 22
  32. name: ssh
  33. protocol: TCP
  34. - containerPort: 3000
  35. name: http
  36. protocol: TCP
  37. restartPolicy: Always
  38. volumes:
  39. # Set up a data directory for gitea
  40. # For production usage, you should consider using PV/PVC instead(or simply using storage like NAS)
  41. # For more details, please see https://kubernetes.io/docs/concepts/storage/volumes/
  42. - name: "root"
  43. hostPath:
  44. # directory location on host
  45. path: "/var/lib/gitea"
  46. # this field is optional
  47. type: Directory
  48. - name: "data"
  49. hostPath:
  50. path: "/data/gitea"
  51. type: Directory
  52. selector:
  53. matchLabels:
  54. app: gitea
  55. ---
  56. # Using cluster mode
  57. apiVersion: v1
  58. kind: Service
  59. metadata:
  60. name: gitea-web
  61. namespace: gitea
  62. labels:
  63. app: gitea-web
  64. spec:
  65. ports:
  66. - port: 80
  67. targetPort: 3000
  68. name: http
  69. selector:
  70. app: gitea
  71. ---
  72. # Using node-port mode
  73. # This mainly open a specific TCP port for SSH usage on each host,
  74. # so you can use a proxy layer to handle it(e.g. slb, nginx)
  75. apiVersion: v1
  76. kind: Service
  77. metadata:
  78. name: gitea-ssh
  79. namespace: gitea
  80. labels:
  81. app: gitea-ssh
  82. spec:
  83. ports:
  84. - port: 22
  85. targetPort: 22
  86. nodePort: 30022
  87. name: ssh
  88. selector:
  89. app: gitea
  90. type: NodePort
  91. ---
  92. # Ingress is always suitable for HTTP usage,
  93. # we suggest using an proxy layer such as slb to send traffic to different ports.
  94. # Usually 80/443 for web and 22 directly for SSH.
  95. apiVersion: extensions/v1beta1
  96. kind: Ingress
  97. metadata:
  98. name: gitea
  99. namespace: gitea
  100. spec:
  101. rules:
  102. - host: your-gitea-host.com
  103. http:
  104. paths:
  105. - backend:
  106. serviceName: gitea-web
  107. servicePort: 80