mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-ansible-private.git
synced 2025-12-17 03:34:28 +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"
|
||||
Reference in New Issue
Block a user