From 6f9a5345a32fbc68c2abfc70dadbd6dbb19daf8c Mon Sep 17 00:00:00 2001 From: ilitirit Date: Wed, 12 Apr 2023 20:59:22 +0200 Subject: [PATCH] Adjust ports in service and ingress --- Expedience.Api/Dockerfile | 3 ++- Expedience.Api/Program.cs | 2 ++ Expedience.Api/ingress.yaml | 3 ++- Expedience.Api/service.yaml | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Expedience.Api/Dockerfile b/Expedience.Api/Dockerfile index 98ede83..e4496dc 100644 --- a/Expedience.Api/Dockerfile +++ b/Expedience.Api/Dockerfile @@ -34,7 +34,8 @@ COPY --from=build /app/publish . ENV ASPNETCORE_ENVIRONMENT=Production # Expose the port the application will run on -EXPOSE 7033 +EXPOSE 80 +EXPOSE 443 # Set the entry point for the container ENTRYPOINT ["dotnet", "Expedience.Api.dll"] \ No newline at end of file diff --git a/Expedience.Api/Program.cs b/Expedience.Api/Program.cs index 8001867..8b50dbe 100644 --- a/Expedience.Api/Program.cs +++ b/Expedience.Api/Program.cs @@ -53,6 +53,8 @@ if (app.Environment.IsDevelopment()) app.UseSwaggerUI(); } +app.UseHttpsRedirection(); + app.UseAuthorization(); app.MapControllers(); diff --git a/Expedience.Api/ingress.yaml b/Expedience.Api/ingress.yaml index 6f6cb1c..78da131 100644 --- a/Expedience.Api/ingress.yaml +++ b/Expedience.Api/ingress.yaml @@ -6,6 +6,7 @@ metadata: annotations: kubernetes.io/ingress.class: "nginx" cert-manager.io/cluster-issuer: letsencrypt-prod + nginx.ingress.kubernetes.io/proxy-redirect-from-ssl: "true" spec: tls: - hosts: @@ -20,4 +21,4 @@ spec: service: name: expedience-api-service port: - number: 7033 + number: 80 diff --git a/Expedience.Api/service.yaml b/Expedience.Api/service.yaml index 8d4c99d..a3b8a97 100644 --- a/Expedience.Api/service.yaml +++ b/Expedience.Api/service.yaml @@ -8,6 +8,6 @@ spec: app: expedience-api ports: - protocol: TCP - port: 7033 + port: 80 targetPort: 80 type: ClusterIP