gogs.yaml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. ---
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: gogs
  6. namespace: gogs
  7. spec:
  8. strategy:
  9. type: Recreate
  10. selector:
  11. matchLabels:
  12. app: gogs
  13. replicas: 1
  14. template:
  15. metadata:
  16. labels:
  17. app: gogs
  18. spec:
  19. containers:
  20. - name: gogs
  21. ## Gogs container with `ssh` added. This ssh isn't servicing git operations, only used in hooks to mirror repos.
  22. ## TODO make a real Dockerfile out of this
  23. #
  24. # FROM gogs/gogs:next-0.14.1
  25. # USER root
  26. # RUN apk --no-cache --no-progress --logfile=no add openssh
  27. # USER git:git
  28. image: jibby0/gogs-next-ssh:0.14.1
  29. env:
  30. - name: SOCAT_LINK
  31. value: "false"
  32. name: DISABLE_REGISTRATION
  33. value: "true"
  34. ports:
  35. - containerPort: 2222
  36. name: ssh-svc
  37. - containerPort: 3000
  38. name: http-web-svc
  39. volumeMounts:
  40. - mountPath: "/data"
  41. name: data
  42. livenessProbe:
  43. httpGet:
  44. path: /
  45. port: 3000
  46. failureThreshold: 10
  47. initialDelaySeconds: 30
  48. periodSeconds: 10
  49. securityContext:
  50. runAsNonRoot: true
  51. runAsUser: 1000
  52. runAsGroup: 1000
  53. allowPrivilegeEscalation: false
  54. seccompProfile:
  55. type: RuntimeDefault
  56. capabilities:
  57. drop:
  58. - ALL
  59. securityContext:
  60. fsGroup: 1000
  61. fsGroupChangePolicy: OnRootMismatch
  62. volumes:
  63. - name: data
  64. persistentVolumeClaim:
  65. claimName: gogs-pvc
  66. ---
  67. apiVersion: v1
  68. kind: Service
  69. metadata:
  70. name: gogs-service
  71. namespace: gogs
  72. spec:
  73. selector:
  74. app: gogs
  75. type: ClusterIP
  76. ports:
  77. - name: gogs-web-port
  78. protocol: TCP
  79. port: 3000
  80. targetPort: http-web-svc
  81. - name: gogs-ssh-port
  82. protocol: TCP
  83. port: 2222
  84. targetPort: ssh-svc
  85. ---
  86. apiVersion: traefik.io/v1alpha1
  87. kind: IngressRouteTCP
  88. metadata:
  89. name: gogs-ssh
  90. namespace: gogs
  91. spec:
  92. entryPoints:
  93. - gogsssh
  94. routes:
  95. - match: HostSNI(`*`)
  96. services:
  97. - name: gogs-service
  98. port: 2222