Skip to content

Kubernetes cluster creation fails - CLOUD_API_URL env var not documented and not in docker-compose.yml #468

@poyrazK

Description

@poyrazK

Why is this an issue?

When creating a Kubernetes cluster, provisioning fails with "CLOUD_API_URL is required but not set in environment" even after setting CLOUD_API_KEY. The CLOUD_API_URL env var is required by the k8s provisioner but is not documented and not set in docker-compose.yml.

What is causing it?

The k8s provisioner at internal/repositories/k8s/provisioner.go lines 123-126 checks for both CLOUD_API_KEY and CLOUD_API_URL:

apiURL := os.Getenv("CLOUD_API_URL")
if apiURL == "" {
    return p.failCluster(ctx, cluster, "CLOUD_API_URL is required but not set in environment", nil)
}

Neither docker-compose.yml nor .env set this variable.

How can it be solved?

Add CLOUD_API_URL to docker-compose.yml environment variables.

Category

  • Small
  • Medium
  • Large
  • Critical

Severity

  • Low
  • Medium
  • High
  • Critical

Steps to reproduce

# Without CLOUD_API_URL:
cloud kubernetes create -n test-cluster -v <vpc-id> -w 1
# API log: "CLOUD_API_URL is required but not set in environment"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions