kubernetes/kops · error

egress mode %q is not supported

Error message

egress mode %q is not supported

What it means

A subnet's egress configuration is neither NatGateway nor External (empty defaults to NatGateway) when building the GCE router/NAT; an unsupported egress value in the cluster spec reached the switch default.

Source

Thrown at pkg/model/gcemodel/network.go:135

				continue
			}

			// If we're in an existing subnet, we assume egress is already configured.
			if subnet.ID != "" {
				continue
			}

			switch subnet.Egress {
			case kops.EgressExternal:
				// User has request we ignore this
				continue

			case kops.EgressNatGateway, "":
				// OK, should create
				subnetworks = append(subnetworks, b.LinkToSubnet(subnet))

			default:
				return fmt.Errorf("egress mode %q is not supported", subnet.Egress)
			}
		}

		if len(subnetworks) != 0 {

			network, err := b.LinkToNetwork()
			if err != nil {
				return nil
			}
			r := &gcetasks.Router{
				Name:                          s(b.NameForRouter("nat")),
				Lifecycle:                     b.Lifecycle,
				Network:                       network,
				Region:                        s(b.Region),
				NATIPAllocationOption:         s(gcetasks.NATIPAllocationOptionAutoOnly),
				SourceSubnetworkIPRangesToNAT: s(gcetasks.SourceSubnetworkIPRangesSpecificSubnets),
				Subnetworks:                   subnetworks,
			}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Set the subnet's egress to NatGateway or External
  2. Clear the egress field to accept the default
  3. Fix via kops edit cluster and re-run update
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/model/gcemodel/network.go:135 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/9ff348e9a54f923e. Report an issue: GitHub.