kubernetes/minikube

Changing a Service from type: LoadBalancer to type: ClusterIP doesn't remove status.loadBalancer.ingress[]

Open

#9,972 创建于 2020年12月15日

在 GitHub 查看
 (7 评论) (0 反应) (1 负责人)Go (5,222 fork)batch import
help wantedkind/buglifecycle/frozenlong-term-supportpriority/backlog

仓库指标

Star
 (31,799 star)
PR 合并指标
 (平均合并 12天 19小时) (30 天内合并 43 个 PR)

描述

Steps to reproduce the issue:

  1. minikube start --memory 8192 --cpus 8 --disk-size 80g
  2. minikube tunnel
  3. Create a Service my-svc with type: LoadBalancer
  4. Observe kubectl get service my-svc -o yaml shows status.loadBalancer.ingress[0].ip with the service's clusterIP
  5. kubectl patch service my-svc --type=merge -p "spec: {type: ClusterIP}"

Actual:

status.loadBalancer.ingress[0].ip remains.

Expected:

status.loadBalancer.ingress should be removed.

This would help automated tests that need to work with both minikube and cloud k8s clusters like GKE, that test adding and removing external access on Service.

We took a look at LoadBalancerEmulator, and saw that it has a method cleanupService(). However, it is only called on Services with type: LoadBalancer, and the cleanup methods are only called during shutdown.

Ideally, it seems like PatchServices should reconcile all Services to add or remove status.loadBalancer.ingress as appropriate.

贡献者指南