deployment.yaml 894 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: gogs
  5. namespace: git
  6. spec:
  7. replicas: 1
  8. selector:
  9. matchLabels:
  10. app: gogs
  11. template:
  12. metadata:
  13. labels:
  14. app: gogs
  15. spec:
  16. containers:
  17. - name: gogs
  18. image: gogs/gogs:latest
  19. ports:
  20. - containerPort: 3000
  21. - containerPort: 22
  22. env:
  23. - name: DB_TYPE
  24. value: postgres
  25. - name: DB_HOST
  26. value: postgres.default.svc.cluster.local:5432
  27. - name: DB_NAME
  28. value: gogs
  29. - name: DB_USER
  30. value: gogs
  31. - name: DB_PASSWD
  32. value: strongpassword
  33. volumeMounts:
  34. - name: gogs-data
  35. mountPath: /data
  36. volumes:
  37. - name: gogs-data
  38. persistentVolumeClaim:
  39. claimName: gogs-data