<p>I currently have a docker-compose setup for ASP.NET Core. However when moving to test the cluster in Kubernetes I ran into SSL issues with Kestrel. Originally with Docker/Docker-compose you can set up local SSL with</p>
<pre class="lang-sh prettyprint-override"><code>dotnet dev-certs https -ep %USERPROFILE%\.aspnet\https\&lt;app_name&gt;.pfx -p &lt;password&gt;
</code></pre>
<p>Then</p>
<pre class="lang-sh prettyprint-override"><code>dotnet dev-certs https --trust
</code></pre>
<p>Finally</p>
<pre class="lang-sh prettyprint-override"><code>dotnet user-secrets set &quot;Kestrel:Certificates:Development:Password&quot; &quot;&lt;password&gt;&quot;
</code></pre>
<p>And in Docker-compose I setup the volumes to point to this cert</p>
<pre class="lang-yaml prettyprint-override"><code>volumes:
      - ${APPDATA}\microsoft\UserSecrets\:/root/.microsoft/usersecrets
      - ${USERPROFILE}\.aspnet\https:/root/.aspnet/https/
</code></pre>
<p>I am curious how I can test locally https with kubernetes. I saw a git repo <a href="https://github.com/Lybecker/k8s-friendly-aspnetcore" rel="nofollow noreferrer">https://github.com/Lybecker/k8s-friendly-aspnetcore</a>, however I did not figure out how to get the .pfx file from my local computer into the secret, I would think copy and paste is not the way to go.</p>
<p>I looked at this SO post <a href="https://stackoverflow.com/questions/59661594/access-net-core-app-on-kubernetes-on-both-http-and-https">Access .NET Core app on Kubernetes on both http and https</a></p>
<p>However it looks like they are using .Net 5 which uses .key and .crt. I am on .Net 3.1 which uses a .pfx file.</p>

mjwrazor
<p>Rather than deploying your .NET core container with https, you should deploy it with http and use nginx-ingress to provide https as described here: <a href="https://cert-manager.io/docs/tutorials/acme/nginx-ingress/" rel="nofollow noreferrer">https://cert-manager.io/docs/tutorials/acme/nginx-ingress/</a></p>
