Kubernetes Volume Setup Guide? Files get Corrupted on redployment!
Hello Every One. this is My First question in this forum.
I've been able to successfully deploy mssql2019 + volume for persistence also deploying Umbraco as Unattended on Kubernetes was a great success.
I thought that it would help if I get two volumes and attach them to /wwwroot and /Views directories. Here is My manifest:
Every thing works fine at this scenario🎉.
But If I set replicas to 0 and back to 1
For whom that don't know what this means Kubernetes will just simply stop the app, delete and everything except the volumes Redeploy the app and re-mount the volumes to the folders I specified before.
Here is the issue: after redeploy Views and Media Files are Corrupted!
I was wondering if anyone else managed to deploy Umbraco on Kubernetes and How did him/her Persist these folders. If any one knows how to solve this issue I'd appreciate his/her Help. Maybe I'm just dumb and missing something?
Ok looks like I was dumb 🤣. checked the folder from my pod's console looks like when volume attaches the disk is empty and there is no way to initialize volume with a preloaded data fixed the issue with a dirty .sh script hack 😁 cheers 🍻
here my docker file and bash script btw:
dockerfile:
# syntax=docker/dockerfile:1
FROM mcr.microsoft.com/dotnet/sdk AS build-env
WORKDIR /app
# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN curl https://api.nuget.org/v3/index.json -k
RUN dotnet restore
# Copy everything else and build
COPY . .
RUN dotnet publish -c Release -o out
# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet
WORKDIR /app
COPY --from=build-env /app/out .
COPY --from=build-env /app/out /src
COPY ./run.sh /src
RUN chmod +x /src/run.sh
ENTRYPOINT ["/src/run.sh"]
Kubernetes Volume Setup Guide? Files get Corrupted on redployment!
Hello Every One. this is My First question in this forum.
I've been able to successfully deploy mssql2019 + volume for persistence also deploying Umbraco as Unattended on Kubernetes was a great success. I thought that it would help if I get two volumes and attach them to
/wwwroot
and/Views
directories. Here is My manifest:Every thing works fine at this scenario🎉. But If I set replicas to 0 and back to 1
Here is the issue: after redeploy Views and Media Files are Corrupted! I was wondering if anyone else managed to deploy Umbraco on Kubernetes and How did him/her Persist these folders. If any one knows how to solve this issue I'd appreciate his/her Help. Maybe I'm just dumb and missing something?
Ok looks like I was dumb 🤣. checked the folder from my pod's console looks like when volume attaches the disk is empty and there is no way to initialize volume with a preloaded data fixed the issue with a dirty .sh script hack 😁 cheers 🍻
here my docker file and bash script btw:
dockerfile:
run.sh:
is working on a reply...