3.7 KiB
Installing eBPF into a Test VM
Follow the VM Installation Instructions for one-time setup of a test VM. Once the one-time setup has been completed, the following steps will install or update the eBPF installation in the VM.
Method 1 (Install a release)
Do the following from within the VM:
- Download the .msi file from the latest release
- Execute the .msi file you downloaded
Method 2 (Install files you built yourself)
This method uses a machine that has already built the binaries for x64/Debug or x64/Release.
-
Deploy the binaries to
C:\Temp
in your VM, as follows: a. If you built the binaries from inside the VM, then from your ebpf-for-windows directory in the VM, do.\scripts\deploy-ebpf -l
. Otherwise, b. If you built the binaries on the host machine, then from your ebpf-for-windows directory on the host machine, start an admin Powershell on the host machine and do.\scripts\deploy-ebpf
, or to also copy files needed to run various tests, do.\scripts\deploy-ebpf -t
. -
From within the VM, install the binaries as follows:
- Start an admin command shell (cmd.exe).
- Do 'cd C:\temp'.
- Do 'powershell -ExecutionPolicy Bypass .\scripts\setup-ebpf.ps1'.
Method 3 (Install files you built yourself, with a VM checkpoint)
This method uses a machine that has already built the binaries for x64/Debug or x64/Release.
Copy the build output to the host of the test VM and run the following in powershell.
Checkpoint-VM -Name <test-vm-name> -CheckpointName baseline
-- Creates a snapshot of the test VM named baseline.- Store the VM administrator credential:
Install-Module CredentialManager -force
New-StoredCredential -Target
TEST_VM
-Username <VM Administrator> -Password <VM Administrator account password> -Persist LocalMachine
- Modify
vm_list.json
to specify the name of the test VM underVMList
. Set-ExecutionPolicy unrestricted -Force
Setup_ebpf_cicd_tests.ps1
Installing eBPF with host-process container
The following instructions will build an ebpf-for-windows image and deploy a daemonset referencing the image. This is the easiest way to install eBPF on all Windows nodes in a Kubernetes cluster.
-
Deploy the binaries to
C:\Temp
on the machine (Windows Host) where you built the binaries. Start an admin Powershell on the Windows Host and do.\scripts\deploy-ebpf
. -
Build ebpf-for-windows image.
a. To build the image on the Windows Host, make sure docker is installed. install docker on Windows Server. Start an admin Powershell on the Windows Host and run
.\images\build-images.ps1
and provide parameters forrepository
,tag
andOSVersion
.b. To build the image on a Linux machine (e.g. Ubuntu), make sure docker is installed. install docker on Ubuntu.
-
Run the following Powershell command on the Windows Host to create zip files containing the binaries.
Compress-Archive -Update -Path C:\temp -DestinationPath ebpf-for-windows-c-temp.zip
-
Copy
images\*
andebpf-for-windows-c-temp.zip
from the Windows Host to a directory on the Linux machine (e.g.$HOME/ebpf-for-windows-image
). -
Run
$HOME/ebpf-for-windows-image/build-images.sh
and provide parameters forrepositry
,tag
andOSVersion
.
-
-
Push the ebpf-for-windows image to your repository.
-
Update
manifests/Kubernetes/ebpf-for-windows-daemonset.yaml
with the container image pointing to your image path. Run the following command:
kubectl apply -f manifests/Kubernetes/ebpf-for-windows-daemonset.yaml