Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

[GKE] allow setting svc spec.loadBalancerIP for GKE reserved/static IPs #296

Merged
merged 1 commit into from
Jan 5, 2020

Conversation

drnic
Copy link
Contributor

@drnic drnic commented Jan 4, 2020

[GKE] To use a reserved/static IP for LoadBalancer services you need to set spec.loadBalancerIP, rather than spec.externalIPs. This PR allows the following values to be set for GKE:

services:
  router:
    loadBalancerIP: 34.82.240.78
    externalIPs: []
  ssh-proxy:
    loadBalancerIP: 34.82.240.79
    externalIPs: []
  tcp-router:
    loadBalancerIP: 34.82.240.80
    externalIPs: []

How Has This Been Tested?

  • against cf-operator v1.0.0
  • on GKE
  • only for services.router.loadBalancerIP to confirm my kube service switched to use my reserved IP

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code has security implications.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@fargozhu fargozhu added Priority: High Type: Bug Something isn't working labels Jan 4, 2020
@fargozhu fargozhu added this to the 0.2.0 milestone Jan 4, 2020
@fargozhu fargozhu requested a review from f0rmiga January 4, 2020 09:27
@fargozhu
Copy link
Contributor

fargozhu commented Jan 4, 2020

fixes #291

@f0rmiga
Copy link
Member

f0rmiga commented Jan 5, 2020

@drnic Thanks for fixing this one!
@fargozhu We need a doc update for GKE.

@f0rmiga f0rmiga merged commit f5c263f into cloudfoundry-incubator:master Jan 5, 2020
@f0rmiga f0rmiga mentioned this pull request Jan 5, 2020
@drnic drnic deleted the loadBalancerIP branch January 5, 2020 20:08
@fargozhu
Copy link
Contributor

fargozhu commented Jan 6, 2020

after deploying kubecf with PR merged and set the values.yaml to support the described approach, I can see the endpoints created with the specified IPs but the k8s cluster EXTERNAL-IP column (router, ssh and tcp) are in pending state.

kubecf        kubecf-router-public           LoadBalancer   10.88.10.228   <pending>     80:32697/TCP,443:30861/TCP                                                                                                                        129m
❯ k describe svc kubecf-router-public -n kubecf
Name:                     kubecf-router-public
Namespace:                kubecf
Labels:                   app.kubernetes.io/component=router
                          app.kubernetes.io/instance=kubecf
                          app.kubernetes.io/managed-by=Helm
                          app.kubernetes.io/name=kubecf
                          app.kubernetes.io/version=0.1.0
                          helm.sh/chart=kubecf-0.1.0
Annotations:              <none>
Selector:                 app.kubernetes.io/component=router,app.kubernetes.io/instance=kubecf,app.kubernetes.io/version=0.1.0
Type:                     LoadBalancer
IP:                       10.88.10.228
IP:                       35.214.153.155
Port:                     http  80/TCP
TargetPort:               8000/TCP
NodePort:                 http  32697/TCP
Endpoints:                10.24.1.11:8000
Port:                     https  443/TCP
TargetPort:               443/TCP
NodePort:                 https  30861/TCP
Endpoints:                10.24.1.11:443
Session Affinity:         None
External Traffic Policy:  Cluster
Events:
  Type    Reason                Age                    From                Message
  ----    ------                ----                   ----                -------
  Normal  EnsuringLoadBalancer  2m18s (x33 over 138m)  service-controller  Ensuring load balancer

bikramnehra pushed a commit that referenced this pull request Apr 21, 2020
[GKE] allow setting svc spec.loadBalancerIP for GKE reserved/static IPs
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Priority: High Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants