postgres-operator icon indicating copy to clipboard operation
postgres-operator copied to clipboard

Database initialization fails on Azure Kubernetes Service (AKS)

Open markszente opened this issue 2 years ago • 2 comments

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

markszente avatar Oct 31 '21 15:10 markszente

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.

treyhendon avatar Dec 03 '21 14:12 treyhendon

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

ashish1099 avatar Sep 13 '22 09:09 ashish1099