0
votes

Is there support in GKE or Helm to have k8s create a reserved GCP address for me that I will be using in externalIPs?

I can script it myself, but I'd like this reservation to be part of the Kubernetes config itself instead of having to create it outside of the k8s config with my own scripts or manually.

Perhaps the new k8s Service Catalog can provision a reserved static IP for me?

1

1 Answers

0
votes

EDIT:

For incoming traffic:

You can define a static IP for a service type LoadBalancer. You must hav the static IP reserved before hand and you can define the spec.loadBalancerIP field to use the reserved IP address.

You can also assign a static IP to an Ingress resource using an annotation

For outbound or Egress traffic:

There is no way to have GKE use predefined static IPs as the nodes are created from a single template which can't include the static IPs.

Nodes, like many k8s components, are meant to be ephemeral and stateless. In most cases where static IPs are necessary, it is because the cluster will be making calls to an outside application or end point and the IPs must be whitelisted. In those situations, it is recommended to use a NAT which will use a static IP.

You can follow this tutorial or consider using Cloud NAT with GKE