Создаю под с postgres, не стартует. В описании: Warning FailedScheduling 32s default-scheduler 0/3 nodes are available: 3 pod has unbound immediate PersistentVolumeClaims. preemption: 0/3 nodes are available: 3 Preemption is not helpful for scheduling.
---
apiVersion: v1
kind: ConfigMap
metadata:
name: postgres
data:
POSTGRES_DB: db1
---
apiVersion: v1
kind: Secret
metadata:
name: postgres
data:
POSTGRES_PASSWORD: password
stringData:
POSTGRES_USER: user
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-pv-claim
labels:
app: postgres
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:14.7
ports:
- containerPort: 5432
envFrom:
- secretRef:
name: postgres-secrets
- configMapRef:
name: postgres-configmap
volumeMounts:
- name: postgres-database-storage
mountPath: /var/lib/pgsql/data
volumes:
- name: postgres-database-storage
persistentVolumeClaim:
claimName: postgres-pv-claim
Есть локальный под, подходящий по размеру:
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-local-node-2
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: local-storage
local:
path: /var/lib/postgres
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- node2
В чём проблема?