This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: passt-binding-cni | |
namespace: kube-system | |
--- | |
apiVersion: security.openshift.io/v1 | |
kind: SecurityContextConstraints | |
metadata: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Or Mergi | |
# | |
# This script build basic container image to deploy Kubevirt passt binding CNI. | |
# | |
# | |
#!/bin/bash | |
curl -LO https://github.com/kubevirt/kubevirt/releases/download/v1.2.0/kubevirt-passt-binding | |
chmod +x kubevirt-passt-binding | |
cat <<EOF > Containerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /bin/bash | |
set -ex | |
vm_name="myvmi" | |
vm_pod_name=$(kubectl get po -o custom-columns=:.metadata.name --no-headers | grep $vm_name | grep Running) | |
vm_node_name=$(kubectl get po $vm_pod_name -o custom-columns=:.spec.nodeName --no-headers) | |
vm_node_virt_handler_pod=$(kubectl get pod -n kubevirt -l kubevirt.io=virt-handler -o wide --no-headers | grep "$vm_node_name" | awk '{print $1}') | |
vm_pod_pid=$(kubectl exec -it $vm_node_virt_handler_pod -n kubevirt -c virt-handler -- bash -c "ps -ef | grep /usr/bin/virt-launcher.*--name.*$vm_name" | grep -Pv "grep|virt-launcher-monitor" | awk '{print $2}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script enable faster development iterations in Kubevirt | |
# when working on a change that might affect backward compatibility, | |
# upgrades or legacy VMs (a VM that existed before an upgrade) disruption. | |
# | |
# Use case: | |
# 1. Changing virt-launcher pods secondary networks interfaces name scheme. | |
# Different network interfaces name-schemes breaks migration for legacy VMs | |
# when Kubevirt is updated. | |
# | |
# In order to test this, its necessary to have both versions images, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Or Mergi <[email protected]> | |
# | |
# This script runs a demonstration to reproduce the following issue: | |
# https://github.com/k8snetworkplumbingwg/sriov-cni/issues/219 | |
# | |
# Warnings: | |
# * This script creates pods and re-configure you cluster node | |
# SR-IOV Physical Function (PF) interface and its Virtual Functions (VF). | |
# * Do not run this on production cluster. | |
# * Make sure no VF is attached to any workload on the node you picked. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
set -ex | |
function cleanup() { | |
set +e | |
ip netns exec blue ip link del dev veth-blue | |
ip netns exec red ip link del dev veth-red | |
ip netns del blue | |
ip netns del red |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ex | |
CRI=${CRI:-podman} | |
# download kind | |
kind="./kind" | |
! [ -f $kind ] && \ | |
curl -L "https://github.com/kubernetes-sigs/kind/releases/download/v0.11.1/kind-linux-amd64" -o $kind && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ex | |
CRI=${CRI:-podman} | |
kind="./kind" | |
! [ -f $kind ] && \ | |
wget -nv "https://github.com/kubernetes-sigs/kind/releases/download/v0.11.1/kind-linux-amd64" -O $kind && \ | |
chmod +x $kind |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: k8s.cni.cncf.io/v1 | |
kind: NetworkAttachmentDefinition | |
metadata: | |
name: sriov-net-vlan100 | |
namespace: default | |
annotations: | |
k8s.v1.cni.cncf.io/resourceName: kubevirt.io/sriov_net | |
spec: | |
config: | | |
{ |