Search code examples
google-cloud-platformgoogle-kubernetes-enginegcloud

Unable to use 'gcloud alpha' command to create GKE with local SSDs using NVMe interface


I am trying to create a GKE with a preconfigured local SSD configuration - namely I'd like for the devices to use the NVMe interface and do not format/mount the devices.

The gcloud alpha container clusters create command, as documented here, has a command line option called --local-ssd-volumes which supports these options.

A example is provided:

gcloud alpha container clusters create example_cluster --local-ssd-volumes count=2,type=nvme,format=fs

'count' must be between 1-8
'type' must be either scsi or nvme
'format' must be either fs or block

Whenever I try and use the --local-ssd-volumes option, I get:

ERROR: (gcloud.alpha.container.clusters.create) ResponseError: code=404, message=Method not found.

While troubleshooting, I found a suggestion to use the GCP web console to generate most of the gcloud configuration. This has led me to using the following commandline:

$ gcloud alpha container --project "<REDACTED>" clusters create "gcp-ceph" \
  --zone "europe-west2-b" --no-enable-basic-auth \
  --cluster-version "1.20.8-gke.900" --release-channel "None" \
  --machine-type "n2-standard-2" --image-type "UBUNTU_CONTAINERD" \
  --disk-type "pd-standard" --disk-size "100" \
  --metadata disable-legacy-endpoints=true \
  --scopes "https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write","https://www.googleapis.com/auth/monitoring","https://www.googleapis.com/auth/servicecontrol","https://www.googleapis.com/auth/service.management.readonly","https://www.googleapis.com/auth/trace.append" \
  --max-pods-per-node "110" \
  --enable-kubernetes-alpha \
  --num-nodes "5" --enable-stackdriver-kubernetes \
  --enable-ip-alias --network "projects/<REDACTED>/global/networks/default" 
  --subnetwork "projects/<REDACTED>/regions/europe-west2/subnetworks/default" \
  --no-enable-intra-node-visibility --default-max-pods-per-node "110" \
  --no-enable-master-authorized-networks \
  --addons HorizontalPodAutoscaling,HttpLoadBalancing,GcePersistentDiskCsiDriver \
  --no-enable-autoupgrade --no-enable-autorepair \
  --max-surge-upgrade 1 --max-unavailable-upgrade 0 --enable-shielded-nodes \
  --node-locations "europe-west2-b" \
  --local-ssd-volumes "count=8,type=nvme,format=block"

The GCP console suggested I use gcloud beta when press Equivalent COMMAND LINE. When I run this, I get an expected error saying the command is not in Beta, but is found in alpha.

ERROR: (gcloud.beta.container.clusters.create) unrecognized arguments:

 --local-ssd-volumes flag is available in one or more alternate release tracks. Try:

  gcloud alpha container clusters create --local-ssd-volumes

When I then use gcloud alpha I the the 404 Method Not Found error.

How can I run this command? Do I need my project whitelisted?


Solution

  • To answer your questions, product is still in alpha and you might need to be whitelisted/invited. Check notes section at the bottom.

    In beta I did not see the other options for local disk apart from the count, so I do not believe it will work with gcloud beta at this point.

    Possible ways to get invited. Note this answer is more for the general community and does not guarantee success:

    1. Depending on product a form might be made available, eg at Google blog. This could happen with new products as an example.
    2. Have access to an Account Manager at Google. Meaning you are currently working with Google.
    3. Contact sales.
    4. Post in Google Discussion as those are monitored by Googlers but does not guarantee success of invite. Perhaps if you explain your business needs you might see some traction.