ss.yaml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ---
  2. apiVersion: apps/v1
  3. kind: StatefulSet
  4. metadata:
  5. name: gogs
  6. namespace: cicd
  7. spec:
  8. selector:
  9. matchLabels:
  10. app: gogs
  11. replicas: 1
  12. updateStrategy:
  13. type: RollingUpdate
  14. serviceName: gogs
  15. podManagementPolicy: OrderedReady
  16. template:
  17. metadata:
  18. labels:
  19. app: gogs
  20. app.kubernetes.io/name: gogs
  21. spec:
  22. volumes:
  23. - name: appconf
  24. configMap:
  25. # Provide the name of the ConfigMap you want to mount.
  26. name: gogs-app-ini
  27. # An array of keys from the ConfigMap to create as files
  28. items:
  29. - key: "app.ini"
  30. path: "app.ini"
  31. - name: gogs-data
  32. persistentVolumeClaim:
  33. claimName: gogs-pvc
  34. containers:
  35. - name: gogs
  36. volumeMounts:
  37. - name: appconf
  38. mountPath: "/data/gogs/conf"
  39. readOnly: true
  40. - name: gogs-data
  41. mountPath: /data
  42. subPath: 'gogs-data'
  43. - name: gogs-data
  44. mountPath: /etc/ssh
  45. subPath: 'ssh'
  46. image: gogs/gogs
  47. imagePullPolicy: IfNotPresent
  48. ports:
  49. - name: web
  50. containerPort: 6161
  51. protocol: TCP
  52. - name: ssh
  53. containerPort: 22
  54. protocol: TCP
  55. resources:
  56. limits:
  57. memory: 1000Mi
  58. cpu: 1000m
  59. ephemeral-storage: 10Gi
  60. securityContext:
  61. allowPrivilegeEscalation: false
  62. #runAsGroup: ''
  63. env:
  64. - name: TZ
  65. value: "Asia/Shanghai"
  66. - name: SOCAT_LINK
  67. value: "false"