Skip to content

Instantly share code, notes, and snippets.

@orimanabu
orimanabu / w4-pod-to-clusterip-different-node-ovs-oftrace-src.txt
Created September 17, 2021 15:55
ovs-appctl ofproto/trace on src node: OCP4.8 Pod-to-ClusterIP different node
[core@worker-4 ~]$ sudo ovs-vsctl --columns=ofport find interface external_ids:iface-id=proj1_client
ofport : 19
[core@worker-4 ~]$ sudo ovs-appctl ofproto/trace --ct-next new,trk br-int in_port=19,dl_src=0a:58:0a:83:02:28,dl_dst=0a:58:0a:83:02:01,tcp,nw_src=10.131.2.40,nw_dst=172.30.11.18,tcp_src=33333,tcp_dst=80,nw_ttl=64,dp_hash=1
Flow: dp_hash=0x1,tcp,in_port=19,vlan_tci=0x0000,dl_src=0a:58:0a:83:02:28,dl_dst=0a:58:0a:83:02:01,nw_src=10.131.2.40,nw_dst=172.30.11.18,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=33333,tp_dst=80,tcp_flags=0
bridge("br-int")
----------------
0. in_port=19, priority 100, cookie 0x680ddb98
set_field:0x2d->reg13
set_field:0xd->reg11
@orimanabu
orimanabu / w4-pod-to-clusterip-different-node-ovs.txt
Last active September 17, 2021 15:56
ovn-trace (with `--ovs`): OCP4.8 Pod-to-ClusterIP different node
##
## ovn-trace command line
##
oc -n openshift-ovn-kubernetes exec -c ovnkube-node ovnkube-node-k2bsf -- \
ovn-trace -p /ovn-cert/tls.key -c /ovn-cert/tls.crt -C /ovn-ca/ca-bundle.crt --db 'ssl:172.16.13.102:9642' \
worker-4 --ct new '
inport == "proj1_client" &&
eth.src == 0a:58:0a:83:02:28 &&
eth.dst == 0a:58:0a:83:02:01 &&
@orimanabu
orimanabu / w4-pod-to-clusterip-different-node-detail-with-lb-dst.txt
Created September 17, 2021 13:21
ovn-trace: OCP4.8 Pod-to-ClusterIP different node (with `--lb-dst`)
##
## ovn-trace command line
##
oc -n openshift-ovn-kubernetes exec -c ovnkube-node ovnkube-node-k2bsf -- \
ovn-trace -p /ovn-cert/tls.key -c /ovn-cert/tls.crt -C /ovn-ca/ca-bundle.crt --db 'ssl:172.16.13.102:9642' \
worker-4 --ct new '
inport == "proj1_client" &&
eth.src == 0a:58:0a:83:02:28 &&
eth.dst == 0a:58:0a:83:02:01 &&
@orimanabu
orimanabu / w4-pod-to-clusterip-different-node-detail.txt
Last active September 14, 2021 14:26
ovn-trace: OCP4.8 Pod-to-ClusterIP different node
##
## ovn-trace command line
##
# oc -n openshift-ovn-kubernetes exec -c northd ovnkube-master-h2qh7 -- \
# ovn-trace -p /ovn-cert/tls.key -c /ovn-cert/tls.crt -C /ovn-ca/ca-bundle.crt --db 'ssl:172.16.13.102:9642' \
# worker-4 --ct new ' \
# inport == \"proj1_client\" &&
# eth.src == 0a:58:0a:83:02:28 &&
# eth.dst == 0a:58:0a:83:02:01 &&
@orimanabu
orimanabu / ansible_v2.9_collection_test.txt
Created March 25, 2021 06:14
ansible v2.9 collection test
[root@rhel7 collections_set]# cat podman.yml
---
- hosts: all
gather_facts: no
collections:
- community.general
tasks:
- name: podman image
podman_image:
@orimanabu
orimanabu / libkrun_cs8.md
Last active March 23, 2021 01:30
libkrun on CentOS Stream 8
sudo sed -i -e 's/enabled=0/enabled=1/' /etc/yum.repos.d/CentOS-Stream-PowerTools.repo
sudo dnf install -y git vim-enhanced yum-utils rust cargo python3 python3-virtualenv make tar gcc patch flex bison bc elfutils-libelf-devel elfutils podman dmidecode strace lsof psmisc glibc-static
mkdir /tmp/venv
virtualenv-3 /tmp/venv
. /tmp/venv/bin/activate
pip3 install pyelftools

git clone https://github.com/containers/libkrunfw
git clone https://github.com/containers/libkrun
@orimanabu
orimanabu / mount_rhcos_qcow2_root_partition_log.txt
Created August 20, 2020 02:43
How to mount rhcos qcow2 root partition
$ sudo qemu-nbd --connect /dev/nbd0 rhcos-4.5.2-x86_64-openstack.x86_64.qcow2
$ lsblk /dev/nbd0
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nbd0 43:0 0 16G 0 disk
├─nbd0p1 43:1 0 384M 0 part
├─nbd0p2 43:2 0 127M 0 part
├─nbd0p3 43:3 0 1M 0 part
└─nbd0p4 43:4 0 3G 0 part
@orimanabu
orimanabu / coreos_image_mount_root.sh
Created August 1, 2020 06:39
Mount luks_root partition in RHCOS qcow2 image
#!/bin/bash
if [ x"$#" != x"2" ]; then
echo "$0 image mountpoint"
exit 1
fi
image=$1; shift
mountpoint=$1; shift
nbd=/dev/nbd0
@orimanabu
orimanabu / multus-daemonset-kube-ansible.yml
Created January 14, 2020 05:14
multus-daemonset-kube-ansible.yml for my PoC setup
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: network-attachment-definitions.k8s.cni.cncf.io
spec:
group: k8s.cni.cncf.io
scope: Namespaced
names:
plural: network-attachment-definitions
@orimanabu
orimanabu / .vimrc
Created November 11, 2019 07:09
my .vimrc
xxx