Skip to content

Service type change from LoadBalancer to ClusterIP is not reflected in host cluster #2728

Open
@Lanyujiex

Description

@Lanyujiex

What happened?

When a Service is changed from type LoadBalancer to another type, the update is not properly synchronized to the host cluster.

2025-04-30 08:00:17 ERROR controller/controller.go:341 Reconciler error {"component": "vcluster", "controller": "service", "namespace": "default", "name": "svc-test", "reconcileID": "ba7b75a0-ee77-483a-a00a-538bc9bccfef", "error": "sync: patch virtual object: update object status: Service \"svc-test\" is invalid: status.loadBalancer.ingress: Forbidden: may only be used when spec.type is 'LoadBalancer'"}

What did you expect to happen?

I expected that after changing the Service type from LoadBalancer to another type (e.g., ClusterIP), the updated Service would be correctly synchronized to the host cluster, reflecting the new type and removing any LoadBalancer-related fields.

How can we reproduce it (as minimally and precisely as possible)?

  1. In the virtual cluster, create a Service of type LoadBalancer.
  2. Then, modify the Service and change its type to ClusterIP.
  3. The change will not be reflected in the host cluster.

Anything else we need to know?

No response

Host cluster Kubernetes version

1.30.3+

vcluster version

0.20.1
0.24.1

VCluster Config

use the default values.yaml in the chart

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions