<p>I've been trying to deploy a small API using FastAPI(and uvicorn to serve) framework on GKE.
I made a deployment and an associated service that are working well but I have trouble understanding how https should be implemented.</p>
<p>Is it internal to FastAPI? Or is it on GKE's side?</p>

<p>it's more depends on the requirement you are looking for.</p>
<p><strong>Option 1</strong> : HTTPS termination at LB level</p>
<p>If you are using the <strong>LB</strong> with the <strong>GKE</strong> and don't want <strong>End to end</strong> <strong>HTTPS</strong> connection you can add the <strong>SSL/TLS</strong> cert at Load balancer level <strong>GKE</strong> and terminate SSL and backend it will be HTTP.</p>
<p><strong>Option 2</strong> : End to end encryption with HTTPS</p>
<p>If you want the End to end encryption with <strong>HTTPS</strong> you have to add the certificate with Code and the application will use that cert.</p>
<p>In both cases, you create the self-signed(not good option) certificate and use it.</p>
<p>If you don't want to use <strong>self-signed</strong> certificate, you can use the GCP <a href="https://cloud.google.com/certificate-manager/docs/overview" rel="nofollow noreferrer">cert-manager</a> to create/use the certificates.</p>
<p>here is the tutorial with steps to use the managed certificates with <strong>GKE</strong> : <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/managed-certs" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/how-to/managed-certs</a></p>
