0

I am fairly experienced with kuberenetes but very new to Google cloud. I have an haproxy-ingress controller running with nodeports of 30080 30443. I need to have a static IP that can forward port 80 and 443 to those ports with proxy protocol to all nodes in the cluster. Preferably with a tcp health check to bring nodes in and out. What are the basic pieces I should create for this?

1 Answers1

2

To have a static IP that can forward port 80 and 443 you would have to reserve an IP address. Once you have a reserved IP address you can use it for your GKE configuration. I have found this GitHub article which describes a similar scenario.

I have also found a youtube video on "The ins and outs of networking in Google Container Engine and Kubernetes" from Google Cloud Next '17. In this video, it describes how to expose the service (the discussion that begins at around 38:00). This is where they get into exposing the service. The infrastructure knows how to treat the 'loadBalancer' tag (mentioned at 40:20) and automatically creates the forwarding rules.

The command for that in the gcloud shell is described at https://cloud.google.com/kubernetes-engine/docs/quickstart, namely.

kubectl expose deployment hello-server --type LoadBalancer \ --port 80 --target-port 8080

This creates a forwarding rule with a public IP that can be returned with; $ kubectl get service hello-server

This should also show up in the output of; $ gcloud compute forwarding-rules list

Nur
  • 386
  • 1
  • 7