postgresql-rc.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. apiVersion: v1
  2. kind: ReplicationController
  3. metadata:
  4. name: postgresql
  5. namespace: public-service
  6. spec:
  7. replicas: 1
  8. selector:
  9. name: postgresql
  10. template:
  11. metadata:
  12. name: postgresql
  13. labels:
  14. name: postgresql
  15. spec:
  16. containers:
  17. - name: postgresql
  18. image: sameersbn/postgresql:10
  19. env:
  20. - name: DB_USER
  21. value: gitlab
  22. - name: DB_PASS
  23. value: passw0rd
  24. - name: DB_NAME
  25. value: gitlab_production
  26. - name: DB_EXTENSION
  27. value: pg_trgm
  28. ports:
  29. - name: postgres
  30. containerPort: 5432
  31. volumeMounts:
  32. - mountPath: /var/lib/postgresql
  33. name: data
  34. livenessProbe:
  35. exec:
  36. command:
  37. - pg_isready
  38. - -h
  39. - localhost
  40. - -U
  41. - postgres
  42. initialDelaySeconds: 30
  43. timeoutSeconds: 5
  44. readinessProbe:
  45. exec:
  46. command:
  47. - pg_isready
  48. - -h
  49. - localhost
  50. - -U
  51. - postgres
  52. initialDelaySeconds: 5
  53. timeoutSeconds: 1
  54. volumes:
  55. - name: data
  56. persistentVolumeClaim:
  57. claimName: gitlab-pg
  58. ---
  59. kind: PersistentVolumeClaim
  60. apiVersion: v1
  61. metadata:
  62. name: gitlab-pg
  63. namespace: public-service
  64. spec:
  65. accessModes: [ "ReadWriteMany" ]
  66. storageClassName: "gitlab-pg-data"
  67. resources:
  68. requests:
  69. storage: 5Gi