I am running a the official PHP-apache image in a Kubernetes cluster. All works fine and gets deployed as expected. When i run the image locally also all is working as expected.
However when running this inside the cluster something weird happens with some of the assets. When i try to download a file or image, these are returned as some sort of binary when it happens via http. When i check the files itself all is fine.
shopware@app-685bf796f5-bxn47:/app/public/media$ curl localhost:8080/media/test.txt
s: bytes
Content-Length: 4
Content-Type: text/plain
foo
��|��w��AsR����)�rs�uc_���NY��[4��)������[^_8��U�0Gϲ��z�5��5�������B٬X�l�;�I��)�@S��{R���)� �B�
��"d����IQ����J�=�jQ�^z���+���,����*qa�����4�
shopware@app-685bf796f5-bxn47:/app/public/media$ cat test.txt
foo
After some further investigation the issue seems to be related to the PersistentStorageClaim to with an azurefile. When i change this back to an emptyDir all seems to work fine again.
I tried also to add a custom storageclass for this but without success:
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: azurefile-retain
provisioner: kubernetes.io/azure-file
mountOptions:
- dir_mode=0777
- file_mode=0777
- uid=1000
- gid=1000
- mfsymlinks
- cache=strict
- nouser_xattr
reclaimPolicy: Retain
allowVolumeExpansion: true
parameters:
skuName: Standard_LRS