我在.net core 2.0中编写了一些Web API,并使用kubernetes集群内部的docker容器进行了部署。我正在使用以下日志记录配置,但无法在kubernetes pod控制台中看到任何日志。我在这里错过了什么吗?
appsettings.json和appsettings.Development.json中的日志记录部分
{
"Logging": {
"IncludeScopes": true,
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
},
"Console": {
"LogLevel": {
"Default": "Information",
"System": "Information",
"Microsoft": "Information"
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
内部Program.cs:
public static IWebHost BuildWebHost(string[] args)
{
return new WebHostBuilder()
.UseKestrel()
.ConfigureAppConfiguration((hostingContext, config) =>
{
var env = hostingContext.HostingEnvironment;
config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true);
if (env.IsDevelopment())
{
var appAssembly = Assembly.Load(new AssemblyName(env.ApplicationName));
if (appAssembly != null)
{
config.AddUserSecrets(appAssembly, optional: true);
} …Run Code Online (Sandbox Code Playgroud) 我正在使用 spring 批处理开发ETL批处理应用程序。我的 ETL 过程从一个基于分页的 REST API 获取数据并将其加载到 Google Big-query。我想在 kubernetes 集群中部署这个批处理应用程序,并希望利用 pod 可扩展性功能。我知道 Spring Batch 支持水平和垂直缩放。我有几个问题:-
1) 如何在 kubernetes 上部署这个 ETL 应用程序,以便它使用远程分块/远程分区按需创建 pod?
2) 我假设会有主主 Pod 和基于负载配置的不同从属 Pod。这是正确的吗?
3) 还有一个 kubernetes 批处理 API 也可用。使用 kubernetes 批处理 API 或使用 Spring Cloud 功能。哪个选项更好?
我正在使用 .Net 使用一个 REST API (GET) HttpClient。我想用long polling调用这个 API 。
我有几个问题:
c# concurrency multithreading long-polling dotnet-httpclient
我正在编写一个 grpc 服务并在 Kubernetes ( https://github.com/grpc-ecosystem/grpc-health-probe )上使用 gRPC 健康检查。在我的服务器中,我添加了不同的端点实现(一个用于活动,另一个用于准备)。我想知道这个探针实用程序二进制文件如何区分活动检查与准备检查?在 yaml 中应该有一些其他的方式来定义它,而不仅仅是 ["bin/grpc_health_probe", "-addr=:8801"]
server = ServerBuilder.forPort(port)
.addService(new GrpcModuleHealthCheck())
.addService(new GrpcModuleReadinessCheck())
.addService(ProtoReflectionService.newInstance())
.build.start
Run Code Online (Sandbox Code Playgroud)
在 kubernetes 部署 yaml 中,我使用以下配置
livenessProbe:
failureThreshold: 3
exec:
command: ["bin/grpc_health_probe", "-addr=:8801"]
initialDelaySeconds: 240
periodSeconds: 20
successThreshold: 1
timeoutSeconds: 15
readinessProbe:
failureThreshold: 3
exec:
command: ["bin/grpc_health_probe", "-addr=:8801"]
initialDelaySeconds: 20
periodSeconds: 20
successThreshold: 1
timeoutSeconds: 15
Run Code Online (Sandbox Code Playgroud)
我刚刚测试并发现“GrpcModuleReadinessCheck”(我最后添加的健康类)实现在我刚刚执行我的 kubernetes pod 时生效
kubectl exec -it <MY_POD_NAME> -- /bin/bash
bash-4.4$ ./grpc_health_probe -addr=localhost:8801
status: SERVING
Run Code Online (Sandbox Code Playgroud) c# ×2
kubernetes ×2
.net-core ×1
concurrency ×1
docker ×1
grpc-java ×1
java ×1
long-polling ×1
spring-batch ×1
spring-cloud ×1