-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Kubernetes + Persistent storage(Azure file) vs. Postgres = Fail! #548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
My setup:
kind: PersistentVolumeClaim kind: StorageClass
|
I don't know if users to these repositories would be very familiar with Kubernetes, have you tried a Kubernetes forum or Stack Overflow? Since I don't think there's anything that could be changed in the image to alleviate this |
I did find kubernetes/minikube#2 which has your exact error: kubernetes/minikube#2 (comment) |
|
Damn........all this hard work for nothing - Could be good to know, that Azure files is not supported - Or that Postgres is dependant on hardlinks. Thanks for a quick reponse though :-) Will now have to look at other deployment options - Azure Disks(yak!) or maybe MariaDB for container solution. |
I have tried to run MySQL and Postgre using StorageAccount, and I'm getted the same error. (permission for change directory). Your have tried again? |
Having same issue using MariaDB, does anyone have a solution ? a working database ? |
The problem only happen to postgres for me. I've tested with Mysql and it works fine. using this mount point options for mysql mountOptions:
|
The issue occurs because Azure Files does not support hard links by default, which is required by postgres. You will need to create a NFS backed Azure File storage for it to work: https://docs.microsoft.com/en-us/azure/aks/azure-files-csi#nfs-file-shares |
Thanks @christianskovholm your solution works! |
Amazing @christianskovholm, this was really hard to find. This solved my issue, cheers. |
can someone please provide details on how this was resolved ? `The files belonging to this database system will be owned by user "postgres". The database cluster will be initialized with locale "en_US.utf8". Data page checksums are disabled. fixing permissions on existing directory /var/lib/postgresql/data ... ok Can you help me with the manifest files for the pv and pvc that are used to create the share that is eventually mounted for the /var/lib/postgresql/data to be mounted from azure files |
Hi @christianskovholm I have tried https://docs.microsoft.com/en-us/azure/aks/azure-files-csi#nfs-file-shares as per your suggestion but in this doc there is no mention about storage account where fileshare available. Assuming It will create dynamic but it should create new fileshare right? |
@leepereira You will have to disable "Secure transfer required" since it is not supported when using NFS to access the file shares of an azure Premium FileStorage account. Go to Storage Account -> "Configuration" -> "Secure transfer required" -> Set to disabled From the azure docs:
|
I have to give many thanks to this post, I was struggling with this for more than 2-3 days.
My final question, when using file.csi with protocol NFS we are using Azure Files or Azure NetApp files? |
I fixed this with the following Storage Class:
You also must give your AKS cluster Contributor access to the Resource Group. I used this Bicep code to do that (I have an AKS resource called
|
Uh oh!
There was an error while loading. Please reload this page.
Have tried now for 2 days to get a running postgres database up and running on Kubernetes with Azure files mountes as persistent volume - and it just does not work!
It works WITHOUT persistent storage - but as soon as I mount Azure files the pod end in a crashloop.
Have tried both Alpine and Debian in multiple versions:
I have tried the following on storageclass:
in multiple combinations with setting this on the container
securityContext:
runAsUser: 999
fsGroup: 999
Even tried to chowning manually (without effec) AND trying with initContainers - but it just won't run
Note: The volume works(incl. setting ownership) if I mount it anywhere else than /var/lib/postgresql/data
Error from the logs:
initdb: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted
2019-01-25 12:29:05.963 UTC [36] LOG: could not link file "pg_wal/xlogtemp.36" to "pg_wal/000000010000000000000001": Operation not supported
2019-01-25 12:29:05.998 UTC [36] FATAL: could not open file "pg_wal/000000010000000000000001": No such file or directory
child process exited with exit code 1
I GIVE UP! 👎
The combination of these 3 components is far from simple or intuitive - Just reading the caveats on the README.md
Any good intentions of securing the database by an entryscript like this, just makes it unusable......but that also guarantees 100% security!?
Hope someone can help and/or make this installation working and simple - Else i'm about to spin up some BAREMETAL from the 90s to host a MSSQL database! :-)
_Sorry for the yelling..........just feeling stupid spending 2 full work days on this shit.....counterfeits the whole purpose of using docker _
The text was updated successfully, but these errors were encountered: