kubernetes/kops · error

ExternalCloudControllerManager is nil

Error message

ExternalCloudControllerManager is nil

What it means

A nil-check guard in CloudControllerConfigArgv: the cluster spec has no ExternalCloudControllerManager block, yet the template asked to build the external cloud-controller-manager argv. kOps only populates this field when the external CCM feature is enabled, so rendering its flags without it is a configuration inconsistency.

Source

Thrown at upup/pkg/fi/cloudup/template_functions.go:686

func (tf *TemplateFunctions) HasHighlyAvailableControlPlane() bool {
	cp := 0
	for _, ig := range tf.AllInstanceGroups {
		if ig.Spec.Role.HasControlPlane() {
			cp++
			if cp > 1 {
				return true
			}
		}
	}
	return false
}

// CloudControllerConfigArgv returns the args to external cloud controller
func (tf *TemplateFunctions) CloudControllerConfigArgv() ([]string, error) {
	cluster := tf.Cluster

	if cluster.Spec.ExternalCloudControllerManager == nil {
		return nil, fmt.Errorf("ExternalCloudControllerManager is nil")
	}

	argv, err := flagbuilder.BuildFlagsList(cluster.Spec.ExternalCloudControllerManager)
	if err != nil {
		return nil, err
	}

	// default verbosity to 2
	if cluster.Spec.ExternalCloudControllerManager.LogLevel == 0 {
		argv = append(argv, "--v=2")
	}

	// take the cloud provider value from clusterSpec if unset
	if cluster.Spec.ExternalCloudControllerManager.CloudProvider == "" {
		if cluster.GetCloudProvider() != "" {
			argv = append(argv, fmt.Sprintf("--cloud-provider=%s", cluster.GetCloudProvider()))
		} else {
			return nil, fmt.Errorf("Cloud Provider is not set")

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Enable the external cloud controller manager in the cluster spec (spec.externalCloudControllerManager)
  2. Guard the template/helper call behind a check that the CCM config exists
  3. Ensure the template is only rendered for cloud providers that use an external CCM
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/template_functions.go:686 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/d9fc45a39cee7b00. Report an issue: GitHub.