postgres.yaml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. ---
  2. # Copyright Materialize, Inc. and contributors. All rights reserved.
  3. #
  4. # Use of this software is governed by the Business Source License
  5. # included in the LICENSE file at the root of this repository.
  6. #
  7. # As of the Change Date specified in that file, in accordance with
  8. # the Business Source License, use of this software will be governed
  9. # by the Apache License, Version 2.0.
  10. apiVersion: v1
  11. kind: PersistentVolumeClaim
  12. metadata:
  13. name: postgres-pv-claim
  14. namespace: materialize
  15. spec:
  16. accessModes:
  17. - ReadWriteOnce
  18. resources:
  19. requests:
  20. storage: 5Gi
  21. ---
  22. apiVersion: apps/v1
  23. kind: Deployment
  24. metadata:
  25. name: postgres
  26. namespace: materialize
  27. spec:
  28. replicas: 1
  29. selector:
  30. matchLabels:
  31. app: postgres
  32. template:
  33. metadata:
  34. labels:
  35. app: postgres
  36. spec:
  37. containers:
  38. - name: postgres
  39. image: postgres:13
  40. ports:
  41. - containerPort: 5432
  42. env:
  43. - name: POSTGRES_DB
  44. value: "materialize_db"
  45. - name: POSTGRES_USER
  46. value: "materialize_user"
  47. - name: POSTGRES_PASSWORD
  48. value: "materialize_pass"
  49. args:
  50. - "postgres"
  51. - "-c"
  52. - "max_connections=1000"
  53. - "-c"
  54. - "wal_level=logical"
  55. - "-c"
  56. - "max_wal_senders=10"
  57. - "-c"
  58. - "max_replication_slots=10"
  59. - "-c"
  60. - "shared_buffers=256MB"
  61. - "-c"
  62. - "work_mem=4MB"
  63. - "-c"
  64. - "maintenance_work_mem=64MB"
  65. volumeMounts:
  66. - mountPath: /var/lib/postgresql/data
  67. name: postgres-storage
  68. volumes:
  69. - name: postgres-storage
  70. persistentVolumeClaim:
  71. claimName: postgres-pv-claim
  72. ---
  73. apiVersion: v1
  74. kind: Service
  75. metadata:
  76. name: postgres
  77. namespace: materialize
  78. spec:
  79. selector:
  80. app: postgres
  81. ports:
  82. - protocol: TCP
  83. port: 5432
  84. targetPort: 5432