apiVersion: v1
kind: ConfigMap
metadata:
name: postgresql-config
data:
POSTGRES_USER: admin
POSTGRES_PASSWORD: admin
---
apiVersion: v1
kind: Service
metadata:
name: postgresql
labels:
app: postgresql
spec:
ports:
- port: 5432
name: postgresql
clusterIP: None
selector:
app: postgresql
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: postgresql-pv
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/data"
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: postgresql
spec:
serviceName: "postgresql"
replicas: 1
selector:
matchLabels:
app: postgresql
template:
metadata:
labels:
app: postgresql
spec:
tolerations:
- key: "node-role.kubernetes.io/control-plane"
operator: "Exists"
effect: "NoSchedule"
containers:
- name: postgresql
image: postgres:15
ports:
- containerPort: 5432
name: postgresql
envFrom:
- configMapRef:
name: postgresql-config
volumeMounts:
- name: postgresql-data
mountPath: /var/lib/postgresql/data
subPath: postgresql
volumeClaimTemplates:
- metadata:
name: postgresql-data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 10Gi
postgresql yaml yapılandırması ile
chmod: changing permissions of ‘/var/lib/postgresql/data’: Permission denied
find: ‘/var/lib/postgresql/data’: Permission denied
chown: changing ownership of ‘/var/lib/postgresql/data’: Permission denied
Hatası almaktayim pod içinde yetki vermem gerekir yoksa başka birşeyden mi bu hata kaynaklanmakta