<p>I am new at Kubernetes and GKE. I have some microservices written in Spring Boot 2 and deployed from GitHub to GKE. I would like to make these services secure and I want to know if it's possible to use ingress on my gateway microservice to make the entry point secure just like that. I created an ingress with HTTPS but it seems all my health checks are failing. </p>

<p>Is it possible to make my architecture secure just by using ingress and not change the spring boot apps?</p>

2dor
<p>Yes, It would be possible to use a GKE ingress given your scenario, there is an official <a href="https://cloud.google.com/kubernetes-engine/docs/tutorials/http-balancer" rel="nofollow noreferrer">guide</a> on how to do this step by step.</p>

<p>Additionally, here's a step by step <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/managed-certs" rel="nofollow noreferrer">guide</a> on how to implement Google Managed certs.</p>

<p>Also, I understand that my response is somewhat general, but I can only help you so much without knowing your GKE infrastructure (like your DNS name for said certificate among other things).</p>

<p>Remember that you must implement this directly on your GKE infrastructure and not on your GCP side, if you modify or create something new outside GKE but that it's linked to GKE, you might see that either your deployment rolled back after a certain time or that stopped working after a certain time.</p>

<p>Edit:</p>

<p>I will assume several things here, and since I don't have your Spring Boot 2 deployment yaml file, I will replace that with an nginx deployment.</p>

<p>cert.yaml</p>

<pre><code>apiVersion: networking.gke.io/v1beta1
kind: ManagedCertificate
metadata:
  name: ssl-cert
spec:
  domains:
    - example.com
</code></pre>

<p>nginx.yaml</p>

<pre><code>apiVersion: "apps/v1"
kind: "Deployment"
metadata:
  name: "nginx"
  namespace: "default"
  labels:
    app: "nginx"
spec:
  replicas: 1
  selector:
    matchLabels:
      app: "nginx"
  template:
    metadata:
      labels:
        app: "nginx"
    spec:
      containers:
      - name: "nginx-1"
        image: "nginx:latest"
</code></pre>

<p>nodeport.yaml (please modify "targetPort: 80" to your needs)</p>

<pre><code>apiVersion: "v1"
kind: "Service"
metadata:
  name: "nginx-service"
  namespace: "default"
  labels:
    app: "nginx"
spec:
  ports:
  - protocol: "TCP"
    port: 80
    targetPort: 80
  selector:
    app: "nginx"
  type: "NodePort"
</code></pre>

<p>ingress-cert.yaml</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: nginx-ingress
  annotations:
    networking.gke.io/managed-certificates: ssl-cert
spec:
  backend:
    serviceName: nginx-service
    servicePort: 80
</code></pre>

<p>Keep in mind that assuming your DNS name "example.com" is pointing into your Load Balancer external IP, it could take a while to your SSL certificate to be created and applied.</p>
