我正在嘗試將包含我的 ASP.NET Core Web API 的 docker 容器部署到我的 kubernetes 集群,但出現以下錯誤:>kubectl logs myapp -pIt was not possible to find any compatible framework versionThe specified framework 'Microsoft.AspNetCore.All', version '2.1.2' was not found. - Check application dependencies and target a framework version installed at: /usr/share/dotnet/ - Installing .NET Core prerequisites might help resolve this problem: http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409 - The .NET Core framework and SDK can be installed from: https://aka.ms/dotnet-download - The following versions are installed: 2.1.1 at [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]當我檢查節點上已安裝的版本時,一切看起來都應該支持容器:yum info aspnetcore-runtime-2.1Installed PackagesName : aspnetcore-runtime-2.1Arch : x86_64Version : 2.1.2Release : 1Size : 71 MRepo : installedFrom repo : packages-microsoft-com-prodSummary : Microsoft ASP.NET Core 2.1.2 Shared FrameworkURL : https://www.asp.net/License : Apache-2.0Description : Shared Framework for hosting of Microsoft ASP.NET Core : applications. It is open source, cross-platform and is supported : by Microsoft. We hope you enjoy using it! If you do, please : consider joining the active community of developers that are : contributing to the project on GitHub : (https://github.com/aspnet/home). We happily accept issues and : PRs.yum info dotnet-sdk-2.1Installed PackagesName : dotnet-sdk-2.1Arch : x86_64Version : 2.1.400Release : 1Size : 221 MRepo : installedFrom repo : packages-microsoft-com-prodSummary : Microsoft .NET Core SDK 2.1.400 2.1.400URL : https://github.com/dotnet/coreLicense : MIT甚至文件夾結構 (/usr/share/dotnet/shared/Microsoft.AspNetCore.All) 也只有 2.1.2 子文件夾。一切看起來都應該有效,但我似乎仍然缺少對舊版本的引用。
1 回答

POPMUISE
TA貢獻1765條經驗 獲得超5個贊
節點上安裝了什么并不重要,因為 Kubernetes 運行容器。您需要構建一個包含所有依賴項的 Docker 鏡像,并讓 pod 運行該 Docker 鏡像。
讓它在 Docker 中工作,將映像推送到 Kubernetes 集群可以訪問它的注冊表,然后在您的 pod 中使用該映像。
- 1 回答
- 0 關注
- 486 瀏覽
添加回答
舉報
0/150
提交
取消