OK I´m new to ASP.NET Core 6 and k8s. So far all apps I was hosting (java, js, python) didn't have any issue.
Deployment service and ingress were created successfully but I was having error in pod:
{"EventId":3,"LogLevel":"Warning","Category":"Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware","Message":"Failed to determine the https port for redirect.","State":{"Message":"Failed to determine the https port for redirect.
I have always managed certificates at ingress level and so far with no issues. I'm always using Nginx also as IC.
After some research I end up with following post:
How to make sure my .NET Core service running in EKS can find the https port?
So basically I decided to remove the C# code the https redirection I saw in developers code and rebuild image app.UseHttpsRedirection();
. This way I can managed security ssl as I said, from ingress level. (Here is the commented line)
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
//app.UseHttpsRedirection();
So now I tested new Docker image locally and it works.
But inside kubernetes I'm getting:
There are no redirects errors but I'm just getting "application is shutting down now".
Any idea what this can be related to?
Ingres secret with certificates were created successfully and ingres is using that secret for tls.
here describe pod.