<p>I am working on a web project where the front-end is built on react and hosted over github using gh-pages. Now the backend is built on node.js and hosted on google cloud using kubernetes engine.</p>

<p>The problem is Front-end is on https and Back-end is on Http due to which I am facing mixed content error. I have tried adding ingress but things don't work out for me. This is first time I am hosting something on google cloud. </p>

<p>I don't know how to correctly add ssl certificate to kubernetes to convert http to http(s). I have tried all things present over google cloud documentation but still stuck with no clue what is going wrong.</p>

<p>And also I don't have any domain.</p>

Mayank
<p>Looking at the Documentation, GCP seems to favor the K8s Standard way of adding SSL/TLS to your Cluster:</p>

<p><a href="https://cloud.google.com/kubernetes-engine/docs/concepts/ingress-xlb" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/concepts/ingress-xlb</a></p>

<p>This means, you have to configure your Ingress entity to use a TLS secret:</p>

<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: my-ingress-2
spec:
  tls:
  - secretName: secret-name
  rules:
  - http:
      paths:
      - path: /*
        backend:
          serviceName: service-name
          servicePort: 60000
</code></pre>

<p>You require a valid Certificate that is stored in a <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#tls" rel="nofollow noreferrer">K8s TLS Secret</a>. To attain such a Certificate - and not only a self signed Cert that makes clients bring up additional prompts - you do require a valid Domain name.</p>

<p>For a full walk-through, please refer to this <a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nginx-ingress-with-cert-manager-on-digitalocean-kubernetes" rel="nofollow noreferrer">article</a>.</p>
