Skip to content

Instantly share code, notes, and snippets.

View maiqueb's full-sized avatar

Miguel Duarte Barroso maiqueb

  • Red Hat
  • Madrid, Spain
View GitHub Profile
package main
import (
"flag"
"fmt"
"net"
"os"
"syscall"
"github.com/golang/glog"
# create the VMI
kubectl apply -f examples/vmi-masquerade.yaml
virtualmachineinstance.kubevirt.io/vmi-masquerade created
# install guest agent in VMI
./_out/cmd/virtctl/virtctl console vmi-masquerade
Successfully connected to vmi-masquerade console. The escape sequence is ^]
vmi-masquerade login: fedora
Password:
Hello all
Miguel (in CC) and I have been working on adding macvtap support to Kubevirt. This allows setting up a macvtap interface for a VM that is directly attached to one of the node interfaces.
Why?
Macvtap interfaces are commonly used to simplify bridged virtualized networking. In the case of Kubevirt, the benefit is two-fold; it not only simplifies the networking at host level, but also at pod level, avoiding the extra bridge setup required there in a standard setup.
How?
---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: macvtap0
spec:
config: '{
"cniVersion": "0.3.1",
"type": "macvtap",
"master": "eth0",
---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: macvtap0
spec:
config: '{
"cniVersion": "0.3.1",
"type": "macvtap",
"master": "eth0",
@maiqueb
maiqueb / enable_port_mirroring.py
Created February 15, 2019 10:15
ovirt-engine: update vnic profile port mirroring through python API
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2019 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0