Giter Site home page Giter Site logo

akihirosuda / critest-rootless-cgroup2 Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 11 KB

critest example (rootless+cgroup2)

Home Page: https://github.com/rootless-containers/usernetes

License: Apache License 2.0

Shell 100.00%
containerd rootless-containers kubernetes

critest-rootless-cgroup2's Introduction

critest-rootless-cgroup2

critest example (rootless+cgroup2)

Usage

Boot Ubuntu 20.04 (systemd 245, kernel 5.4) with systemd.unified_cgroup_hierarchy=1.

Download binaries:

$ ./bin-download.sh
Downloading crictl
Downloading rootlesskit
Downloading slirp4netns
Downloading containerd
NOTE: CRI-O is not supported yet
Downloading crun
NOTE: If you want to try runc, compile it by yourself and place the binary under ./bin .

Start containerd:

$ ./containerd.sh

Run a pod, an Alpine container, and execute a shell within it (using crun):

$ ./run.sh
...
+ ./crictl.sh exec -it d214040f8023a6938ffac05ff6db2aa0f884e86778d5f40a9a3171d2d1e8fc7c sh
/ # cat /sys/fs/cgroup/cpu.weight
5
/ # cat /sys/fs/cgroup/memory.max
67108864

The shell is executed in a cgroup like /user.slice/user-1001.slice/[email protected]/user.slice/cri-containerd-d214040f8023a6938ffac05ff6db2aa0f884e86778d5f40a9a3171d2d1e8fc7c.scope. Note that cat /proc/1/cgroup in the container shows / as the cgroup because cgroup namespaces are enabled for non-privileged pods on cgroup v2.

To use runc (runc binary need to be installed under ./bin):

$ ./run.sh runc
...

Clean up:

$ ./kill.sh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.