<p>I am trying to deploy a complete web application using GKE on Google Cloud (backend as nodejs, and frontend angular). Then enable SSL for it afterward.</p>
<p>I created a global IP address (And saw it in the list afterward):
gcloud compute addresses create mathbux-static-ip --global</p>
<p>After that I have deployed both my backend and frontend - containers and yaml files.</p>
<p><a href="https://i.stack.imgur.com/q94OG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q94OG.png" alt="How it looks like in Google Cloud" /></a></p>
<p>The problem here is that the IP address reflected on the ingress controller comes from nowhere, and is different from what I set it to (the static IP address I just made above).</p>
<p>I have followed the guidelines of how to install Nginx-ingress setup on GKE by following this: <a href="https://kubernetes.github.io/ingress-nginx/deploy/#gce-gke" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-nginx/deploy/#gce-gke</a></p>
<pre><code>kubectl create clusterrolebinding cluster-admin-binding \
  --clusterrole cluster-admin \
  --user $(gcloud config get-value account)

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.34.1/deploy/static/provider/cloud/deploy.yaml
</code></pre>
<p>Here is a <strong>snippet</strong> part of my ingress.yaml:</p>
<pre><code>.... truncated . . .
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: mathbux-ingress-frontend
  namespace: default
  annotations:
    kubernetes.io/ingress.class: nginx
    kubernetes.io/ingress.global-static-ip-name: &quot;mathbux-static-ip&quot;
    networking.gke.io/managed-certificates: mathbux-ssl
    nginx.ingress.kubernetes.io/rewrite-target: /
</code></pre>
<p>And here's a snippet of my managed certificate file as in Google Documentation:</p>
<pre><code>apiVersion: networking.gke.io/v1beta2
kind: ManagedCertificate
metadata:
  name: mathbux-ssl
spec:
  domains:
    - mathbux.com
    - www.mathbux.com
</code></pre>
<p>The whole application works perfectly when I go to the generated IP address, and works as intended only that:</p>
<p><strong>1.) The IP address is not the specific static global IP address I created and supposedly set on my ingress.yaml</strong></p>
<p><strong>2.) Respectively, SSL also fails. (Do note I have already pointed my Domain Names to the Static IP address I manually made)</strong></p>

<p>The annotation that you are using - <code>kubernetes.io/ingress.global-static-ip-name</code> - is available for default GKE ingress, which is essentially a google load balancer - see documentation here - <a href="https://cloud.google.com/kubernetes-engine/docs/tutorials/http-balancer" rel="noreferrer">https://cloud.google.com/kubernetes-engine/docs/tutorials/http-balancer</a>.</p>
<p>However, what you did instead is you deployed ingress-nginx (which is a different ingress provider) and assigned your ingress resource to it via  <code>kubernetes.io/ingress.class: nginx</code> which essentially makes your static ip annotation meaningless.</p>
<p>So, you need to decide which ingress you want to use. If you want to use GKE's load balancer, remove ingress nginx and follow documentation for default GKE ingress that I linked above.</p>
<p>If instead you want to use ingress nginx, you can find its documentation, including ssl configuration, here - <a href="https://kubernetes.github.io/ingress-nginx/" rel="noreferrer">https://kubernetes.github.io/ingress-nginx/</a>.</p>
