Skip to content

Instantly share code, notes, and snippets.

set -o errexit
set -o nounset
set -o pipefail
set -o errtrace
sudo modprobe vfio_pci
sudo modprobe vfio_iommu_type1 allow_unsafe_interrupts
bus_slot="03:00.0"
@jcvenegas
jcvenegas / tricks.md
Created February 6, 2020 16:24
Github tricks

Checkout to a PR

PR_NUMBER=
git fetch origin pull/${PR_NUMBER}/head:TARGET
git checkout TARGET
@jcvenegas
jcvenegas / overhead.md
Last active October 8, 2019 12:43
Kata overhead

Test based workloads from: kata-containers/tests#1975

Pod size (using limits): cpus: 4 memory: 2Gbi

Notes: 721.423095: Odd this should be at most 4 cpus cpu stats are in percentage so 400 is = 5 cpus

@jcvenegas
jcvenegas / get_kata.sh
Created August 20, 2019 19:18
get kata tarball
#!/bin/bash
#
# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
set -o errexit
set -o nounset
set -o pipefail
@jcvenegas
jcvenegas / Readme.md
Created August 7, 2019 23:08
Use one Cgroup per Pod in Kata

Create one cgroup per Pod.

Kata Containers is an OCI compatible runtime, but sometimes with the extra security layer (VM), compatibility is difficult.

One feature that is difficult to be compatible is cgroups in host.

The runtime caller will provide in the config.json a set requeriments for cgroups.

  • CgroupPath
@jcvenegas
jcvenegas / bug.yaml
Created July 31, 2019 22:33
iperf bug
apiVersion: batch/v1
kind: Job
metadata:
name: iperf-overlay-client
spec:
template:
metadata:
labels:
app: iperf-overlay-client
spec:

Kata Containers cgroup overhead.

Containers stats are based on cgroup. Cgroups are usually set to limit resources.

In kubernetes there are 2 resorces allowd to limit by the user.

Memory:

Kubectl top pod pod-id will provide the of the pod.

@jcvenegas
jcvenegas / output
Last active July 19, 2019 19:57
Calculating Cgroup memory usage
create runc container
ef10581a552ca4bc529be8789e63acb662501f78fbc1856d5c42a29c8b364a61
cgroup info: runc-1/ef10581a552ca4bc529be8789e63acb662501f78fbc1856d5c42a29c8b364a61
type: memory
procs:
process:bash�
pid: 4083
tasks:
process:bash�
pid: 4083
@jcvenegas
jcvenegas / k8s.sh
Created May 30, 2019 14:13
K8s + Containerd + Kata: In a fresh ubuntu system.
setup_url=https://raw.githubusercontent.com/jcvenegas/cloud-native-setup/setup_system_ubuntu.sh/clr-k8s-examples/setup_system_ubuntu.sh
curl ${setup_url} | bash /dev/stdin all