简体   繁体   中英

How to apply kubernetes DaemonSet using Terraform in Google Cloud

I'm create k8s in Google Cloud using Terraform, several node pools contains GPU, according documentation there should be applied DaemonSet with GPU drivers. It's possible to do it with Terraform or this operation requires my attention?

As @Patric W and Google Cloud documentation mentioned:

After adding GPU nodes to your cluster, you need to install NVIDIA's device drivers to the nodes. Google provides a DaemonSet that automatically installs the drivers for you.

So all We have to do is to apply DaemonSet provided by Google.

For Container-Optimized OS (COS) nodes:

kubectl apply -f https://raw.githubusercontent.com/GoogleCloudPlatform/container-engine-accelerators/master/nvidia-driver-installer/cos/daemonset-preloaded.yaml

For Ubuntu Nodes:

kubectl apply -f https://raw.githubusercontent.com/GoogleCloudPlatform/container-engine-accelerators/master/nvidia-driver-installer/ubuntu/daemonset-preloaded.yaml

Based on Terraform documentation You can use provisioner "local-exec" to run kubectl apply command for DaemonSet after successful cluster deployment.

provisioner "local-exec" {
    command = "kubectl apply -f https://raw.githubusercontent.com/GoogleCloudPlatform/container-engine-accelerators/master/nvidia-driver-installer/cos/daemonset-preloaded.yaml"
  }
}

Note that example above is for COS node version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM