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
|
kind: StorageClass
|
||||||
apiVersion: storage.k8s.io/v1
|
apiVersion: storage.k8s.io/v1
|
||||||
metadata:
|
metadata:
|
||||||
name: longhorn-ssd
|
name: longhorn-single-replica-best-effort
|
||||||
namespace: darkdork-dev
|
namespace: darkdork-dev
|
||||||
provisioner: driver.longhorn.io
|
provisioner: driver.longhorn.io
|
||||||
allowVolumeExpansion: true
|
allowVolumeExpansion: true
|
||||||
parameters:
|
parameters:
|
||||||
numberOfReplicas: "3"
|
numberOfReplicas: "1"
|
||||||
staleReplicaTimeout: "2880" # 48 hours in minutes
|
staleReplicaTimeout: "30"
|
||||||
|
fsType: "ext4"
|
||||||
fromBackup: ""
|
fromBackup: ""
|
||||||
fsType: "xfs"
|
data-locality: "best-effort"
|
||||||
# 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,
|
|
||||||
# }
|
|
||||||
# ]'
|
|
||||||
---
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,36 @@ spec:
|
||||||
volumeName: pvc-43c3a05b-5556-4d7c-83e3-ee6436f1a48e
|
volumeName: pvc-43c3a05b-5556-4d7c-83e3-ee6436f1a48e
|
||||||
accessModes: ["ReadWriteOnce"]
|
accessModes: ["ReadWriteOnce"]
|
||||||
storageClassName: longhorn-ssd
|
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:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 10Gi
|
storage: 10Gi
|
||||||
|
|
@ -50,7 +50,7 @@ spec:
|
||||||
- name: PGDATA
|
- name: PGDATA
|
||||||
value: /var/lib/postgresql/data/pgdata
|
value: /var/lib/postgresql/data/pgdata
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: postgres-storage
|
- name: postgres-local
|
||||||
mountPath: /var/lib/postgresql/data
|
mountPath: /var/lib/postgresql/data
|
||||||
subPath: pgdata # Using subPath to avoid permission issues
|
subPath: pgdata # Using subPath to avoid permission issues
|
||||||
- name: dshm
|
- name: dshm
|
||||||
|
|
@ -60,6 +60,8 @@ spec:
|
||||||
- name: postgres-config-volume
|
- name: postgres-config-volume
|
||||||
mountPath: /etc/postgresql/postgresql.conf
|
mountPath: /etc/postgresql/postgresql.conf
|
||||||
subPath: postgresql.conf
|
subPath: postgresql.conf
|
||||||
|
- name: postgres-local
|
||||||
|
mountPath: /mnt
|
||||||
command:
|
command:
|
||||||
- docker-entrypoint.sh
|
- docker-entrypoint.sh
|
||||||
- -c
|
- -c
|
||||||
|
|
@ -114,4 +116,7 @@ spec:
|
||||||
name: postgres-config
|
name: postgres-config
|
||||||
- name: postgres-storage
|
- name: postgres-storage
|
||||||
persistentVolumeClaim:
|
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