Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

standard GKE cluster creation fails when enableAutopilot is explicitly set to false #2881

Open
ba1ajinaidu opened this issue Jan 17, 2025 · 2 comments
Labels
awaiting-feedback Blocked on input from the author awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). kind/bug Some behavior is incorrect or out of spec

Comments

@ba1ajinaidu
Copy link

ba1ajinaidu commented Jan 17, 2025

Describe what happened

I'm trying to setup a GKE cluster using pulumi @pulumi/[email protected]. I see enableAutopilot flag defaults to false, but when I explicitly set it to false and set removeDefaultNodePool: true, the cluster creation fails with the below error. It works when I don't explicitly set enableAutopilot but doesn't when I do set it.
error:

gcp:container:Cluster gke-Cluster  error: gcp:container/cluster:Cluster resource 'gke-Cluster' has a problem: Conflicting configuration arguments. "remove_default_node_pool": conflicts with enable_autopilot. Examine values at 'gke-Cluster.removeDefaultNodePool'.
    pulumi:pulumi:Stack gcp-launchpad-dev
    gcp:container:Cluster gke-Cluster **failed** 1 error
Diagnostics:
  gcp:container:Cluster (gke-Cluster):
    error: gcp:container/cluster:Cluster resource 'gke-Cluster' has a problem: Conflicting configuration arguments. "remove_default_node_pool": conflicts with enable_autopilot. Examine values at 'gke-Cluster.removeDefaultNodePool'

Sample program

const gkeCluster = new gcp.container.Cluster("gke-Cluster", {
        addonsConfig: {
            gcePersistentDiskCsiDriverConfig: {
                enabled: true,
            },
            horizontalPodAutoscaling: {
                disabled: false,
            },
        },
        clusterTelemetry: {
            type: "SYSTEM_ONLY",
        },
        controlPlaneEndpointsConfig: {
            dnsEndpointConfig: {
                allowExternalTraffic: true,
            }
        },
        datapathProvider: "ADVANCED_DATAPATH",
        description: "GKE Cluster to deploy Fennel",
        enableAutopilot: false,
        initialNodeCount: 1,
        location: input.env.region,
        minMasterVersion: gkeVersion.latestMasterVersion,
        name: `test-gke-cluster`,
        network: vpc.selfLink,
        networkingMode: "VPC_NATIVE",
        privateClusterConfig: {
            enablePrivateNodes: true,
        },
        project: input.env.projectId,
        releaseChannel: {
            channel: "STABLE",
        },
        removeDefaultNodePool: true,
        resourceLabels: input.tags,
        subnetwork: input.vpcOutput.subnet.selfLink,
        workloadIdentityConfig: {
            workloadPool: `${projectId}.svc.id.goog`,
        }
    }, { provider: gcpProvider, protect: true });

Log output

No response

Affected Resource(s)

gcp.container.cluster

Output of pulumi about

❯ pulumi about
CLI
Version      3.130.0
Go Version   go1.22.6
Go Compiler  gc

Plugins
KIND      NAME        VERSION
resource  command     1.0.1
resource  gcp         8.13.1
resource  kubernetes  4.20.0
language  nodejs      unknown

Host
OS       darwin
Version  15.2
Arch     arm64

This project is written in nodejs: executable='/nix/store/9vkabbbbyfn8hv5l1r8fm59d27imq460-nodejs-22.11.0/bin/node' version='v22.11.0'

Current Stack: gcp-launchpad/dev

TYPE                                     URN
pulumi:pulumi:Stack                      urn:pulumi:dev::gcp-launchpad::pulumi:pulumi:Stack::gcp-launchpad-dev
pulumi:providers:gcp                     urn:pulumi:dev::gcp-launchpad::pulumi:providers:gcp::global-gcp-provider
gcp:compute/network:Network              urn:pulumi:dev::gcp-launchpad::gcp:compute/network:Network::vpc
gcp:compute/subnetwork:Subnetwork        urn:pulumi:dev::gcp-launchpad::gcp:compute/subnetwork:Subnetwork::dev-asia-south1-subnet
gcp:container/cluster:Cluster            urn:pulumi:dev::gcp-launchpad::gcp:container/cluster:Cluster::gke-Cluster


Dependencies:
NAME                VERSION
@pulumi/command     1.0.1
@pulumi/kubernetes  4.20.0
@pulumi/pulumi      3.145.0
@types/node         18.19.70
vitest              2.1.8
@pulumi/gcp         8.13.1
@types/netmask      2.0.5
netmask             2.0.2
ts-node             10.9.2
typescript          5.7.3

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@ba1ajinaidu ba1ajinaidu added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Jan 17, 2025
@guineveresaenger
Copy link
Contributor

Hi @ba1ajinaidu, thank you for filing this issue.

This does sound like inconsistency in checking for valid configuration, and we'll take a look.

Since the current way to avoid seeing this would be to not explicitly set enableAutopilot, is it feasible for you to just go with the implicit default setting for now? Please let us know if this doesn't work for you at this time.

@guineveresaenger guineveresaenger added awaiting-feedback Blocked on input from the author and removed needs-triage Needs attention from the triage team labels Jan 21, 2025
@guineveresaenger
Copy link
Contributor

I've reproduced this bug with a much more pared down version of this code.

The following fails on pulumi up:

const cluster = new gcp.container.Cluster("gke-cluster", {
    enableAutopilot: false,
    removeDefaultNodePool: true,
    });

The following succeeds:

const cluster = new gcp.container.Cluster("gke-cluster", {
    // enableAutopilot: false,
    removeDefaultNodePool: true,
    });

I was curious, since we have actually put quite a bit of work into related issues so I ran the same program in Terraform:

provider "google" {
  project = myproj
  region  = myregion
}

resource "google_container_cluster" "gke_cluster" {
  name                     = "gke-cluster"
  location                 = mylocation
  remove_default_node_pool = true
  enable_autopilot         = false
}

with the same error:

╷
│ Error: Conflicting configuration arguments
│ 
│   with google_container_cluster.gke_cluster,
│   on main.tf line 9, in resource "google_container_cluster" "gke_cluster":
│    9:   remove_default_node_pool = true
│ 
│ "remove_default_node_pool": conflicts with enable_autopilot
╵

I've filed hashicorp/terraform-provider-google#20991 upstream.

@guineveresaenger guineveresaenger added the awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-feedback Blocked on input from the author awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

2 participants