mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-ansible-private.git
synced 2025-12-16 11:27:10 +00:00
stolon
This commit is contained in:
@ -33,22 +33,32 @@ spec:
|
||||
- "/bin/bash"
|
||||
- "-ec"
|
||||
- |
|
||||
|
||||
echo "COMECANDO com user 1013"
|
||||
useradd -u 1013 -r -s /usr/sbin/nologin fenixuser
|
||||
id
|
||||
id stolon
|
||||
id root
|
||||
# Generate our keeper uid using the pod index
|
||||
IFS='-' read -ra ADDR <<< "$(hostname)"
|
||||
export STKEEPER_UID="keeper${ADDR[-1]}"
|
||||
export POD_IP=$(hostname -i)
|
||||
export STKEEPER_PG_LISTEN_ADDRESS=$POD_IP
|
||||
mkdir -p /stolon-data/data
|
||||
|
||||
which psql
|
||||
which postgres
|
||||
which pg_ctl
|
||||
|
||||
|
||||
export STOLON_DATA=/stolon-data/data
|
||||
chown root:root /stolon-data
|
||||
chown root:root $STOLON_DATA
|
||||
exec gosu root stolon-keeper --data-dir $STOLON_DATA
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
runAsGroup: 0
|
||||
allowPrivilegeEscalation: true
|
||||
mkdir -p $STOLON_DATA
|
||||
|
||||
|
||||
ls -la $STOLON_DATA
|
||||
|
||||
exec gosu 1013 stolon-keeper --data-dir $STOLON_DATA
|
||||
|
||||
|
||||
|
||||
env:
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
@ -92,7 +102,7 @@ spec:
|
||||
- containerPort: 8080
|
||||
volumeMounts:
|
||||
- mountPath: /stolon-data
|
||||
name: data
|
||||
name: stolon-data
|
||||
- mountPath: /etc/secrets/stolon
|
||||
name: stolon
|
||||
volumes:
|
||||
@ -103,7 +113,7 @@ spec:
|
||||
- kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: data
|
||||
name: stolon-data
|
||||
namespace: postgresql
|
||||
spec:
|
||||
accessModes:
|
||||
@ -111,4 +121,6 @@ spec:
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
storageClassName: stolon-nfs-csi
|
||||
selector:
|
||||
matchLabels:
|
||||
postgres-id: "stolon-0"
|
||||
111
roles/stolon/files/stolon-pvcs.yaml
Normal file
111
roles/stolon/files/stolon-pvcs.yaml
Normal file
@ -0,0 +1,111 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: stolon-pv-0
|
||||
namespace: postgresql
|
||||
labels:
|
||||
postgres-id: "stolon-0"
|
||||
spec:
|
||||
capacity:
|
||||
storage: 10Gi
|
||||
storageClassName: stolon-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/postgresql-stolon/keeper-0
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: stolon-pv-1
|
||||
namespace: postgresql
|
||||
labels:
|
||||
postgres-id: "stolon-0"
|
||||
spec:
|
||||
capacity:
|
||||
storage: 10Gi
|
||||
storageClassName: stolon-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/postgresql-stolon/keeper-1
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: stolon-pv-2
|
||||
namespace: postgresql
|
||||
labels:
|
||||
postgres-id: "stolon-0"
|
||||
spec:
|
||||
capacity:
|
||||
storage: 10Gi
|
||||
storageClassName: stolon-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/postgresql-stolon/keeper-2
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: stolon-data-stolon-keeper-0
|
||||
namespace: postgresql
|
||||
labels:
|
||||
postgres-id: "stolon-0"
|
||||
spec:
|
||||
storageClassName: stolon-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: stolon-pv-0
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
selector:
|
||||
matchLabels:
|
||||
postgres-id: "stolon-0"
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: stolon-data-stolon-keeper-1
|
||||
namespace: postgresql
|
||||
labels:
|
||||
postgres-id: "stolon-0"
|
||||
spec:
|
||||
storageClassName: stolon-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: stolon-pv-1
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
selector:
|
||||
matchLabels:
|
||||
postgres-id: "stolon-0"
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: stolon-data-stolon-keeper-2
|
||||
namespace: postgresql
|
||||
labels:
|
||||
postgres-id: "stolon-0"
|
||||
spec:
|
||||
storageClassName: stolon-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: stolon-pv-2
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
selector:
|
||||
matchLabels:
|
||||
postgres-id: "stolon-0"
|
||||
---
|
||||
Reference in New Issue
Block a user