Skip to content

Instantly share code, notes, and snippets.

@mcastelino
mcastelino / debugging-cc-agent.md
Created April 23, 2018 23:16 — forked from devimc/debugging-kata-agent.md
Debugging cc-agent

Create a functional Clear Container image using osbuilder

sudo -E IMG_SIZE=520M EXTRA_PKGS="dbus-bin dbus-autostart util-linux-bin p11-kit-bin bash shadow ca-certs dist-pam-configs xz-bin tar-bin grep-bin sed-bin pigz-bin iproute2-bin procps-ng-bin psstop-bin htop-bin curl nano make-bin" make rootfs
sudo -E IMG_SIZE=520M make image

Start a new VM

@mcastelino
mcastelino / build.sh
Created May 31, 2018 21:23 — forked from jcvenegas/build.sh
build static qemu for kata
#git status
#On branch stable-2.11
#Your branch is up-to-date with 'origin/stable-2.11'.
#nothing to commit, working directory clean
./configure --disable-bluez --disable-brlapi --disable-docs --disable-curses --disable-gtk --disable-opengl --disable-sdl --disable-spice --disable-vte --disable-vnc --disable-vnc-jpeg --disable-vnc-png --disable-vnc-sasl --disable-fdt --disable-glusterfs --disable-libiscsi --disable-libnfs --disable-bzip2 --disable-lzo --disable-snappy --disable-seccomp --disable-tpm --disable-slirp --disable-libusb --disable-usb-redir --disable-tcg --disable-uuid --disable-debug-tcg --disable-qom-cast-debug --disable-tcg-interpreter --disable-tcmalloc --disable-curl --disable-rdma --disable-tools --disable-xen --disable-linux-aio --enable-kvm --enable-vhost-net --enable-virtfs --enable-attr --enable-cap-ng --target-list=x86_64-softmmu --extra-cflags=" -O3 -fno-semantic-interposition -falign-functions=32 -D_FORTIFY_SOURCE=2 -fPIE" --extra-ldflags=" -z noexecstack -z relro -z now" --static --

NEMU build

Configure script: configure.sh

git clone https://github.com/intel/nemu
cd nemu
git checkout -b topic/virt-x86 origin/topic/virt-x86
mkdir build-x86-64
cd build-x86-64
@mcastelino
mcastelino / mirror-port.sh
Created October 27, 2017 00:34 — forked from lonelymtn/mirror-port.sh
Mirror traffic between two interfaces using Linux's traffic controll subsystem (tc)
#!/usr/bin/env bash
# Time-stamp: <2014-07-31 13:31:43 (ryanc)>
#
# Description: Mirror traffic between two interfaces using Linux's
# traffic control subsystem (tc)
trap cleanup EXIT
CLEANUP=1
SRC_IFACE=$1
@mcastelino
mcastelino / Release.md
Created December 21, 2018 17:42 — forked from jcvenegas/Release.md
Kata Containers Release

In the not-dockershim and not-CRIO normal socket path case, we are handled by the cri stats provider: https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/stats/cri_stats_provider.go

The 'magic' happens in the listPodStats function

Looping over each managed container, kubelet calculates the container statics at https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/stats/cri_stats_provider.go#L198, then calculate a running total of the pod usage at https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/stats/cri_stats_provider.go#L200, and then eventually return the results.

Potential issue

Initial potential issue I noticed was that we will run into is at the top of addPodCPUMemoryStats function. The

@mcastelino
mcastelino / notes.md
Created April 12, 2019 19:02 — forked from egernst/notes.md
containerd + kubernetes, and making clr-examples do what i want on Bionic

Quick guide for getting Kata+containerd (using v2 shim) up and running super quick on bionic

Installation of Kube stuff on bionic:

Use the following sh:

sudo bash -c "cat <<EOF > /etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial-unstable main
EOF"
@mcastelino
mcastelino / macvlan-ipvlan.md
Created July 10, 2019 16:27 — forked from krsna1729/canal.md
tracing network stack for MACVLAN IPVLAN

MACVLAN

ip netns del net1
ip netns add net1
ip link add macvlan1 link enp130s0f0 type macvlan mode bridge
ip link set macvlan1 netns net1 up
ip netns exec net1 ip a add 192.168.1.200/24 dev macvlan1
ip netns exec net1 ping 192.168.1.101 -c1
@mcastelino
mcastelino / README.md
Created December 13, 2021 20:48 — forked from smoser/README.md
qemu to linux mapping of smbios / dmi information

Mappings for DMI/SMBIOS to Linux and dmidecode

Information can be put into dmi tables via some qemu-system hosts (x86_64 and aarch64). That information is exposed in Linux under /sys/class/dmi/id and can be read with dmidecode. The names are very annoyingly inconsistent. The point of this doc is to map them.

Mappings

Example qemu cmdline:

qemu-system-x86_64 -smbios type=<type>,field=value[,...]

qemu-system-x86_64 -smbios type=0,vendor=superco,version=1.2.3