Skip to content

Instantly share code, notes, and snippets.

View shettyg's full-sized avatar

Gurucharan Shetty shettyg

  • Google
  • Sunnyvale
View GitHub Profile
PS C:\Windows\system32> hnsdiag list all
Networks:
Name ID
l2bridge 4B50C87A-4D40-4942-B5C7-AEBACB9B2986
External F75BCC96-E38E-4F43-BBD1-714C57E20603
Endpoints:
Name ID Virtual Network Name
db6f9018d102ccc5c17d17e0205f11e06b8a19a9de32e5f715f9702a4cf7a0d2_l2bridge de23ff03-1f61-4e4f-8118-c8518cbaa579 l2bridge
Ethernet ab6d4ed1-c2e8-40f3-bfde-a53d18e33bc3 l2bridge
@shettyg
shettyg / gist:b028011663dcf95209d963d358a4b809
Created November 8, 2018 18:05
OVN policy with port groups
Ingress Policy Testing
=========
=========
* Create namespace "ns1"
kubectl create -f ~/policy/ns1.yaml
# Should create an empty address_set for that namespace
from ovsdbapp.backend.ovs_idl import connection
from ovsdbapp.schema.ovn_northbound import impl_idl
import ovs.db.idl
# If you need to register specific tables, custom schema, etc.
# helper = ovs.db.idl.SchemaHelper("/opt/stack/ovs/ovn/ovn-nb.ovsschema")
# helper.register_all()
#idl = ovs.db.idl.Idl("ptcp:127.0.0.1:12345", helper)
# generic helper function that pulls schema from server and
@shettyg
shettyg / gist:455ff78605ea4c45febe7b5aa345c87d
Created May 14, 2018 17:33
Ubuntu cloud images and virt-manager
* How to create a Ubuntu VM on your local Ubuntu KVM from Ubuntu cloud images.
1. Get the ubuntu cloud image (.img file from)
mkdir temp; cd temp;
wget http://cloud-images.ubuntu.com/trusty/20140101.55/trusty-server-cloudimg-amd64-disk1.img
2. Create a file "seed"
OVS/OVN installation on Centos:
==============================
# Get the kernel module RPM build for your specific kernels and install them on all the hosts. e.g:
sudo rpm -ivh kmod-openvswitch-2.8.2-1.el7.centos.x86_64.rpm openvswitch-kmod-2.8.2-1.el7.centos.x86_64.rpm
# Building the above kernel rpms. The instructions are at the below link. You only need to build the kernel module rpms.
# You can ignore about the need to read the fedora instructions for RHEL 7.x series.
http://docs.openvswitch.org/en/latest/intro/install/rhel/
{
"name": "task2",
"task_id": {"value" : "9234"},
"agent_id": {"value" : ""},
"container": {
"type": "MESOS",
"mesos": {
"image": {
"type": "DOCKER",
"docker": {
@shettyg
shettyg / gist:75edf1d1f3e9fa504e980424a9275b01
Last active July 17, 2017 18:06
Mesos task file with apache webserver for ovn
{
"name": "task1",
"task_id": {"value" : "1234"},
"agent_id": {"value" : ""},
"container": {
"type": "MESOS",
"mesos": {
"image": {
"type": "DOCKER",
"docker": {
{
"name": "task1",
"task_id": {"value" : "1234"},
"agent_id": {"value" : ""},
"container": {
"type": "MESOS",
"mesos": {
"image": {
"type": "DOCKER",
"docker": {
<interface type='bridge'>
<mac address='00:23:20:77:fc:3c'/>
<source bridge='breth2'/>
<virtualport type='openvswitch'>
<parameters interfaceid='b58dd804-5bcd-4504-abce-910512244654'/>
</virtualport>
<target dev='vm80c3-vif0'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
A new pod:
apiVersion: v1
kind: Pod
metadata:
name: apachetwin
labels:
name: apache
spec:
containers: