istio/istio · error

components.pilot.k8s.replicaCount should not be set when val

Error message

components.pilot.k8s.replicaCount should not be set when values.pilot.autoscaleEnabled is true

What it means

Error "components.pilot.k8s.replicaCount should not be set when values.pilot.autoscaleEnabled is true" thrown in istio/istio.

Source

Thrown at operator/pkg/apis/validation/validation.go:294

	for _, validator := range validators {
		newWarnings, newErrs := validator(values, spec)
		errs = util.AppendErrs(errs, newErrs)
		warnings = append(warnings, newWarnings...)
	}

	return warnings, errs
}

// checkAutoScaleAndReplicaCount warns when autoscaleEnabled is true and k8s replicaCount is set.
func checkAutoScaleAndReplicaCount(values *apis.Values, spec apis.IstioOperatorSpec) (Warnings, util.Errors) {
	if spec.Components == nil {
		return nil, nil
	}
	var warnings Warnings
	if values.GetPilot().GetAutoscaleEnabled().GetValue() {
		if spec.Components.Pilot != nil && spec.Components.Pilot.Kubernetes != nil && spec.Components.Pilot.Kubernetes.ReplicaCount > 1 {
			warnings = append(warnings,
				fmt.Errorf("components.pilot.k8s.replicaCount should not be set when values.pilot.autoscaleEnabled is true"))
		}
	}

	validateGateways := func(gateways []apis.GatewayComponentSpec, gwType string) {
		const format = "components.%sGateways[name=%s].k8s.replicaCount should not be set when values.gateways.istio-%sgateway.autoscaleEnabled is true"
		for _, gw := range gateways {
			if gw.Kubernetes != nil && gw.Kubernetes.ReplicaCount != 0 {
				warnings = append(warnings, fmt.Errorf(format, gwType, gw.Name, gwType))
			}
		}
	}

	if values.GetGateways().GetIstioIngressgateway().GetAutoscaleEnabled().GetValue() {
		validateGateways(spec.Components.IngressGateways, "ingress")
	}

	if values.GetGateways().GetIstioEgressgateway().GetAutoscaleEnabled().GetValue() {
		validateGateways(spec.Components.EgressGateways, "egress")

View on GitHub (pinned to 8dc789c5cf)

When it happens

Trigger: Thrown at operator/pkg/apis/validation/validation.go:294 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of istio/istio@8dc789c5cf (2026-08-15). Data as JSON: /api/errors/2371cd53e640377a. Report an issue: GitHub.