Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

static ip and ssl issue in gke

Hi,

i deployed a java-springboot-react as monolithic application in gcp by gitlab automated pipeline, after deploying when i switched the workload screen created it showed pop up to expose, so i exposed with loadbalancer with 8080 port, it automatically assigned an ephemeral ip. So i tried changing it to static by reserving an ip in vpc and tried assigning it to loadbalancer .Load balancer ip changed but in ingress yaml and workload the ip was same as before. also tried by creating new yaml file for service and ingress and applying it to cluster ,but that also created load balancer with different ip, it didnt take up my static ip ,if it takes also my site was not reachable. Also tried with nodeport option which assigned me cluster ip but i dont want that.So someone guide me in this issue.

Thanks in advance

Solved Solved
0 2 515
1 ACCEPTED SOLUTION

You need to add the `https://kubernetes.io/ingress.global-static-ip-name` annotation on your Ingress resource:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: basic-ingress
 
annotations:
    kubernetes.io/ingress.global-static-ip-name: "web-static-ip"
spec:
  defaultBackend:
    service:
      name: web
     
port:
        number: 8080

See https://cloud.google.com/kubernetes-engine/docs/tutorials/http-balancer#optional_configuring_a_stati... for more details

 

 

View solution in original post

2 REPLIES 2

You need to add the `https://kubernetes.io/ingress.global-static-ip-name` annotation on your Ingress resource:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: basic-ingress
 
annotations:
    kubernetes.io/ingress.global-static-ip-name: "web-static-ip"
spec:
  defaultBackend:
    service:
      name: web
     
port:
        number: 8080

See https://cloud.google.com/kubernetes-engine/docs/tutorials/http-balancer#optional_configuring_a_stati... for more details

 

 

thanks it worked

 

Top Labels in this Space
Top Solution Authors