Create Node Pool¶
In this section you will add a node pool to your GKE cluster. This will host all Arrikto EKF related workloads.
Note
When creating the GKE cluster, a default node pool is created as well. If you want to use the default node pool, you may proceed to the What’s Next section.
Overview
What You’ll Need¶
- A management environment with Google Cloud SDK.
- An existing GKE cluster.
- Access to the GKE cluster.
Procedure¶
Specify the name of the node pool:
root@rok-tools:~# export NEW_NODE_POOL_NAME=workersSpecify the Kubernetes version of the node pool. Choose one of the following options, based on the Kubernetes version of your cluster:
root@rok-tools:~# export NODE_VERSION=1.23.11-gke.300root@rok-tools:~# export NODE_VERSION=1.22.15-gke.100root@rok-tools:~# export NODE_VERSION=1.21.14-gke.7100Specify the machine type:
root@rok-tools:~# export MACHINE_TYPE=n1-standard-8Specify the number of nodes to create:
root@rok-tools:~# export NUM_NODES=3Specify the number of local NVMe SSDs to add:
root@rok-tools:~# export NUM_SSD=3Note
Each local NVMe SSD is 375 GB in size. You can attach a maximum of 24 local SSD partitions for 9 TB per instance.
Create the node pool:
root@rok-tools:~# gcloud alpha container node-pools create ${NEW_NODE_POOL_NAME?} \ > --account ${CLUSTER_ADMIN_ACCOUNT?} \ > --cluster ${GKE_CLUSTER?} \ > --node-version ${NODE_VERSION?} \ > --machine-type ${MACHINE_TYPE?} \ > --image-type UBUNTU \ > --disk-type pd-ssd \ > --disk-size 200 \ > --local-ssd-volumes count=${NUM_SSD?},type=nvme,format=block \ > --metadata disable-legacy-endpoints=true \ > --workload-metadata=GKE_METADATA \ > --scopes gke-default \ > --num-nodes ${NUM_NODES?} \ > --max-surge-upgrade 1 \ > --max-unavailable-upgrade 0 \ > --enable-autoupgrade \ > --enable-autorepair
Verify¶
Verify that the node pool exists and its status is RUNNING:
root@rok-tools:~# gcloud container node-pools describe ${NEW_NODE_POOL_NAME?} \ > --cluster=${GKE_CLUSTER?} \ > --format="value(status)" RUNNINGVerify that the nodes show up in the Kubernetes cluster:
root@rok-tools:~# kubectl get nodes NAME STATUS ROLES AGE VERSION ... gke-arrikto-cluster-workers-1108b534-3rgs Ready <none> 26m v1.23.11-gke.300 gke-arrikto-cluster-workers-1108b534-jztj Ready <none> 26m v1.23.11-gke.300 gke-arrikto-cluster-workers-1108b534-wm2j Ready <none> 26m v1.23.11-gke.300Verify that all instances of your node pool have the necessary storage attached:
Find the instance group that corresponds to the workers node pool:
root@rok-tools:~# export INSTANCE_GROUP=$(gcloud container node-pools describe ${NEW_NODE_POOL_NAME?} \ > --cluster=${GKE_CLUSTER?} \ > --format="value(instanceGroupUrls)")Find the template of the instance group:
root@rok-tools:~# export TEMPLATE=$(gcloud compute instance-groups managed describe ${INSTANCE_GROUP?} \ > --format="value(instanceTemplate)")Inspect the template and ensure that
kube-env
metadata key has the expectedNODE_LOCAL_SSDS_EXT
:root@rok-tools:~# gcloud compute instance-templates describe ${TEMPLATE?} --format json | \ > jq -r '.properties.metadata.items[] | select(.key == "kube-env") | .value' | \ > grep NODE_LOCAL_SSDS NODE_LOCAL_SSDS_EXT: 3,nvme,blockInspect the template and ensure that it has NVMe local SSDs attached. List all disks of type
SCRATCH
and show their interface. It should beNVME
:root@rok-tools:~# gcloud compute instance-templates describe ${TEMPLATE?} --format json | \ > jq -r '.properties.disks[] | select(.type == "SCRATCH") | .index, .deviceName, .interface' | paste - - - 1 local-ssd-0 NVME 2 local-ssd-1 NVME 3 local-ssd-2 NVMEEnsure that all instances inside the instance group run with the desired template:
root@rok-tools:~# gcloud compute instance-groups managed describe ${INSTANCE_GROUP?} \ > --format="value(status.versionTarget.isReached)" True
What’s Next¶
Check out the rest of the maintenance operations that you can perform on your cluster.