gogs-deployment.yaml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: gogs
  5. namespace: nginx-app
  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: registry.cn-hangzhou.aliyuncs.com/zhongpengqun/wanderer:linux-amd64-gogs-0.13
  21. ports:
  22. - containerPort: 3000 # Gogs web interface
  23. - containerPort: 22 # SSH port for Git operations
  24. env:
  25. - name: GOGS__server__ROOT_URL
  26. value: "http://localhost:3000"
  27. - name: GOGS__database__DB_TYPE
  28. value: "sqlite3"
  29. - name: GOGS__database__PATH
  30. value: "/data/gogs.db"
  31. volumeMounts:
  32. - name: gogs-data
  33. mountPath: /data
  34. resources:
  35. requests:
  36. memory: "256Mi"
  37. cpu: "250m"
  38. limits:
  39. memory: "512Mi"
  40. cpu: "1000m"
  41. volumes:
  42. - name: gogs-data
  43. persistentVolumeClaim:
  44. claimName: gogs-pvc
  45. ---
  46. apiVersion: v1
  47. kind: Service
  48. metadata:
  49. name: gogs-service
  50. namespace: nginx-app
  51. labels:
  52. app: gogs
  53. spec:
  54. selector:
  55. app: gogs
  56. ports:
  57. - name: http
  58. port: 3000
  59. targetPort: 3000
  60. - name: ssh
  61. port: 22
  62. targetPort: 22
  63. type: ClusterIP
  64. ---
  65. apiVersion: v1
  66. kind: PersistentVolumeClaim
  67. metadata:
  68. name: gogs-pvc
  69. namespace: nginx-app
  70. spec:
  71. accessModes:
  72. - ReadWriteOnce
  73. resources:
  74. requests:
  75. storage: 5Gi