Running with Kubernetes
New in version 2.0.
Installing Docker
First you will need to set up the repository.
Update the apt package index with the command below:
Install packages to allow apt to use a repository over HTTPS:
Next you will need to add Docker’s official GPG key with the command below:
Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint:
Use the following command to set up the stable repository:
Install Docker Engine - Community Update the apt package index:
Install Docker Engine:
Please refer to Install Docker Engine on Ubuntu | Docker Documentation for a current installation procedure for Ubuntu.
Verify that Docker Engine - Community is installed correctly by running the hello-world image:
More information on how to install Docker can be found in the Installing Docker section.
Installing Kubernetes
Make sure Docker has been started and enabled before beginning installation:
Execute the following to add apt keys:
Create kubernetes.list:
Now execute the below to install kubelet, kubeadm and kubectl:
Reload the system daemon:
Disable swap
Add a # before all the lines that start with /swap. # is a comment, and the result should look something like this:
Initializing the Kubernetes cluster to run as a control-plane node
Execute the following command:
Output:
Following the instructions in the output, execute the commands as shown below:
With the following command, you install a pod-network add-on to the control plane node. We are using calico as the pod-network add-on here:
You can execute the below commands to ensure that all pods are up and running:
Output:
The get nodes command shows that the control-plane node is up and ready:
Output:
Since we are using a single-node Kubernetes cluster, the cluster will not schedule pods on the control plane node by default. To schedule pods on the control plane node, we have to remove the taint by executing the following command:
Refer to https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/ for more information.
Installing Helm
Execute the following command to download and install Helm 3.5.4:
Refer to https://github.com/helm/helm/releases and Installing Helm for more information.
NVIDIA Network Operator
New in version 2.0.
Prerequisites
If Mellanox NICs are not connected to your nodes, please skip this step and proceed to NVIDIA GPU Operator.
The below instructions assume that Mellanox NICs are connected to your machines.
Execute the below command to verify Mellanox NICs are enabled on your machines:
Output:
Execute the below command to know which Mellanox Device is Active:
Use the Device whichever shows as Link Detected: yes in further steps. Below command works only if you add the NICs before installing the Operating System.
Output:
Create the custom network operator values.yaml.
Update the active Mellanox device from the above command.
For more information about custom network operator values.yaml, please refer Network Operator.
Add the NVIDIA repo:
Installing Helm is required to install GPU Operator.
Update the Helm repo:
Install NVIDIA Network Operator
Execute the commands below:
Validating the State of Network Operator
Please note that the installation of the Network Operator can take a couple of minutes. How long the installation will take depends on your internet speed.
Please refer to the Network Operator page for more information.
NVIDIA GPU Operator
New in version 2.0.
NVIDIA AI Enterprise customers have access to a pre-configured GPU Operator within the NVIDIA NGC Catalog. The GPU Operator is pre-configured to simplify the provisioning experience with NVIDIA AI Enterprise deployments.
The pre-configured GPU Operator differs from the GPU Operator in the public NGC catalog. The differences are:
- It is configured to use a prebuilt vGPU driver image (Only available to NVIDIA AI Enterprise customers).
- It is configured to use the NVIDIA License System (NLS).
Install GPU Operator
The GPU Operator with NVIDIA AI Enterprise requires some tasks to be completed prior to installation. Refer to the document Getting Started for instructions prior to running the below commands.
License GPU Operator for CLS
Add the NVIDIA AI Enterprise Helm repository, where api-key is the NGC API key for accessing the NVIDIA Enterprise Collection that you generated.
-
Copy the NLS license token in the file named
client_configuration_token.tok. -
Create an empty gridd.conf file using the command below.
-
Create Configmap for the NLS Licensing using the command below.
-
Create K8s Secret to Access NGC registry.
-
Install the GPU Operator with the command below.
License GPU Operator for DLS
Add the NVIDIA AI Enterprise Helm repository, where api-key is the NGC API key for accessing the NVIDIA Enterprise Collection that you generated.
Prior to GPU Operator v1.9, the operator was installed in the default namespace while all operands were installed in the gpu-operator-resources namespace.
Starting with GPU Operator v1.9, both the operator and operands get installed in the same namespace. The namespace is configurable and is determined during installation. For example, to install the GPU Operator in the gpu-operator namespace.
If a namespace is not specified during installation, all GPU Operator components will be installed in the default namespace.
GPU Operator with RDMA (Optional)
Prerequisites
- Please install the NVIDIA Network Operator to ensure that the MOFED drivers are installed.
After NVIDIA Network Operator installation is completed, execute the below command to install the GPU Operator to load nv_peer_mem modules.
Validating the Network Operator with GPUDirect RDMA
Execute the below command to list the Mellanox NIC’s with the status:
Output:
Edit the networkdefinition.yaml.
Create network definition for IPAM and replace the ens192f0 with active Mellanox device for master.
If you do not have VLAN-based networking on the high-performance side, please set “vlan”: 0
Validate the state of the GPU Operator
Please note that the installation of the GPU Operator can take a couple of minutes. How long the installation will take depends on your internet speed.
Results:
Please refer to the GPU Operator page on NGC for more information.