rework postgres storage to single-replica best-effort
This commit is contained in:
parent
7dd21eefae
commit
b86e2a63cc
3 changed files with 42 additions and 21 deletions
|
|
@ -2,27 +2,13 @@
|
|||
kind: StorageClass
|
||||
apiVersion: storage.k8s.io/v1
|
||||
metadata:
|
||||
name: longhorn-ssd
|
||||
name: longhorn-single-replica-best-effort
|
||||
namespace: darkdork-dev
|
||||
provisioner: driver.longhorn.io
|
||||
allowVolumeExpansion: true
|
||||
parameters:
|
||||
numberOfReplicas: "3"
|
||||
staleReplicaTimeout: "2880" # 48 hours in minutes
|
||||
numberOfReplicas: "1"
|
||||
staleReplicaTimeout: "30"
|
||||
fsType: "ext4"
|
||||
fromBackup: ""
|
||||
fsType: "xfs"
|
||||
# backupTargetName: "default"
|
||||
# mkfsParams: "-I 256 -b 4096 -O ^metadata_csum,^64bit"
|
||||
# diskSelector: "ssd,fast"
|
||||
# nodeSelector: "storage,fast"
|
||||
# recurringJobSelector: '[
|
||||
# {
|
||||
# "name":"snap",
|
||||
# "isGroup":true,
|
||||
# },
|
||||
# {
|
||||
# "name":"backup",
|
||||
# "isGroup":false,
|
||||
# }
|
||||
# ]'
|
||||
---
|
||||
data-locality: "best-effort"
|
||||
|
|
|
|||
|
|
@ -10,6 +10,36 @@ spec:
|
|||
volumeName: pvc-43c3a05b-5556-4d7c-83e3-ee6436f1a48e
|
||||
accessModes: ["ReadWriteOnce"]
|
||||
storageClassName: longhorn-ssd
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: postgres-local-pvc
|
||||
namespace: darkdork-dev
|
||||
labels:
|
||||
app: postgres
|
||||
spec:
|
||||
accessModes: ["ReadWriteOnce"]
|
||||
storageClassName: longhorn-single-replica-best-effort
|
||||
resources:
|
||||
requests:
|
||||
storage: 15Gi
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistenVolumeClaim
|
||||
metadata:
|
||||
name: postgres-local-path-test-pvc
|
||||
namespace: darkdork-dev
|
||||
labels:
|
||||
app: postgres
|
||||
spec:
|
||||
accessModes: ["ReadWriteOnce"]
|
||||
storageClassName: local-path
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
|
|
@ -50,7 +50,7 @@ spec:
|
|||
- name: PGDATA
|
||||
value: /var/lib/postgresql/data/pgdata
|
||||
volumeMounts:
|
||||
- name: postgres-storage
|
||||
- name: postgres-local
|
||||
mountPath: /var/lib/postgresql/data
|
||||
subPath: pgdata # Using subPath to avoid permission issues
|
||||
- name: dshm
|
||||
|
|
@ -60,6 +60,8 @@ spec:
|
|||
- name: postgres-config-volume
|
||||
mountPath: /etc/postgresql/postgresql.conf
|
||||
subPath: postgresql.conf
|
||||
- name: postgres-local
|
||||
mountPath: /mnt
|
||||
command:
|
||||
- docker-entrypoint.sh
|
||||
- -c
|
||||
|
|
@ -114,4 +116,7 @@ spec:
|
|||
name: postgres-config
|
||||
- name: postgres-storage
|
||||
persistentVolumeClaim:
|
||||
claimName: postgres-pvc
|
||||
claimName: postgres-pvc
|
||||
- name: postgres-local
|
||||
persistentVolumeClaim:
|
||||
claimName: postgres-local-pvc
|
||||
Loading…
Add table
Add a link
Reference in a new issue