postgres-operator
postgres-operator copied to clipboard
Database initialization fails on Azure Kubernetes Service (AKS)
Using the minimal postgres example and azurefile-premium
SC, initialization fails with the following message:
creating configuration files ... initdb: error: could not change permissions of "/home/postgres/pgdata/pgroot/data/postgresql.conf": Operation not permitted initdb: removing data directory "/home/postgres/pgdata/pgroot/data" pg_ctl: database system initialization failed
Might be related: #676
I suspect this is an issue with any azurefile
Storage. We are using AKS dynamic PVCs with no issue, but we're using managed-premium
storage class.
Azure File is SMB 3.0 protocol vs Azure Disk is a raw disk attached to the VM. Microsoft says structured app data should use Azure Disks. https://docs.microsoft.com/en-us/azure/aks/operator-best-practices-storage#choose-the-appropriate-storage-type
Hope that helps!
FWIW, we're shifting to either Rook or Portworx for disk management in order to have better control of the underlying volume size and backups.
I used azurefile
with ext4 and it worked fine
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: k8id-azurefile-ext4
provisioner: file.csi.azure.com
reclaimPolicy: Delete
volumeBindingMode: Immediate
allowVolumeExpansion: true
parameters:
skuName: Standard_LRS
fsType: ext4