Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Whats_new_in_Podman_and_CRI-O_2025-06

 Whats_new_in_Podman_and_CRI-O_2025-06

What's New in Podman and CRI-O - Summer 2025 Edition - CNCJ Joint Event: Japan Community Day at KubeCon+CloudNativeCon

Avatar for orimanabu

orimanabu

June 15, 2025
Tweet

More Decks by orimanabu

Other Decks in Technology

Transcript

  1. Japan Community Day at KubeCon+CloudNativeCon Container Runtime Meetup What's New

    in Podman and CRI-O (Summer 2025 Edition) Manabu Ori Red Hat 2025-06-15 1 v1.0
  2. 2 ▸ Manabu Ori (@orimanabu) ▸ Working at Red Hat

    ▸ OpenShift consultant Who am I
  3. 3 ▸ Podman ・ Container Engine, run via CLI (like

    Docker Engine) ・ GUI tool also - Podman Desktop (like Docker Desktop) ・ Runs on macOS and Windows as well as Linux ▸ CRI-O ・ High level runtime, called from Kubernetes CRI (like Containerd) ・ Runs on Linux only ▸ conmon ・ Works as a subreaper of a container process (like containerd shim) ▸ crun ・ OCI runtime (like runc) Short introduction: Podman and CRI-O Podman CRI-O OCI Runtime (runc, crun, youki, ...) Docker Containerd runc c/storage, c/image, c/common shim conmon
  4. 5 ▸ crun: OCI compliant container runtime ・ Written in

    C ・ Originally created for the PoC of cgroups v2 (over the Christmas vacations...) ・ https://www.redhat.com/en/blog/introduction-crun ▸ Features ・ Small binary size, short startup time, small memory footprint ・ Effective when running on Edge/IoT devices ・ Simple logic when starting container process ・ ...compared to runc ▸ Handlers enable execution in container environments other than normal binary ・ VM in a container (with libkrun) ・ Confidential Computing (with libkrun) ・ AMD SEV (SEV, SEV-ES and SEV-SNP) ・ WebAssembly binary in a container ・ WasmEdge, WasmTime, Wasmer, WAMR (WebAssembly Micro Runtime) ▸ Mirantis Container Runtime supports crun recently ・ v25.0.9 Release Notes crun
  5. 6 Binary size & memory footprint comparison $ podman run

    --runtime /usr/bin/crun --memory 384k hello-world !... Hello Podman World ...! .--"--. / - - \ / (O) (O) \ ~~~| -=(,Y,)=- | .---. /` \ |~~ ~/ o o \~~~~.----. ~~ | =(X)= |~ / (O (O) \ ~~~~~~~ ~| =(Y_)=- | ~~~~ ~~~| U |~~ Project: https://github.com/containers/podman Website: https://podman.io Desktop: https://podman-desktop.io Documents: https://docs.podman.io YouTube: https://youtube.com/@Podman X/Twitter: @Podman_io Mastodon: @[email protected] $ podman run --runtime /usr/bin/runc --memory 512k hello-world Error: OCI runtime error: /usr/bin/runc: runc create failed: unable to start container process: container init was OOM-killed (memory limit too low?) $ podman run --runtime /usr/bin/runc --memory 1m hello-world Error: OCI runtime error: /usr/bin/runc: runc create failed: unable to start container process: container init was OOM-killed (memory limit too low?) $ podman run --runtime /usr/bin/runc --memory 2m hello-world !... Hello Podman World ...! .--"--. / - - \ / (O) (O) \ ~~~| -=(,Y,)=- | .---. /` \ |~~ ~/ o o \~~~~.----. ~~ | =(X)= |~ / (O (O) \ ~~~~~~~ ~| =(Y_)=- | ~~~~ ~~~| U |~~ Project: https://github.com/containers/podman Website: https://podman.io Desktop: https://podman-desktop.io Documents: https://docs.podman.io YouTube: https://youtube.com/@Podman X/Twitter: @Podman_io Mastodon: @[email protected] $ ls -lh /usr/bin/{crun,runc} -rwxr-xr-x. 1 root root 516K 3月 28 09:00 /usr/bin/crun -rwxr-xr-x. 1 root root 13M 4月 29 09:00 /usr/bin/runc
  6. 9 ▸ https://github.com/cri-o/cri-o ▸ High level runtime, called from Kubernetes

    CRI, runs OCI containers ▸ CNCF graduated project ▸ Focused on being called from Kubernetes ・ Should pass all the Kubernetes e2e tests ・ Other use cases are out of scope, no extra functionality is included. ・ E.g. can pull container image, but no push functionality ・ Support lifecycle, version (major, minor) aligned to Kubernetes ・ CRI-O v1.29.* runs on Kubernetes v1.29.* ・ CRI-O v1.28.* runs on Kubernetes v1.28.* ▸ Focus on security, performance and stability ▸ Users ・ Red Hat OpenShift, Oracle Linux Cloud Native Environment, Lyft, Reddit, Adobe, ... ・ https://github.com/cri-o/cri-o/blob/main/ADOPTERS.md CRI-O
  7. 11 ▸ OCI runtime ・ runc, crun, kata ▸ Go

    libraries ・ containers/storage ・ Deploy layered container image and assemble root file system ・ Forked from Docker graphdrivers and rewritten significantly ・ containers/image ・ Pull image from container registry ・ containers/common ・ Commonly used routines in containers org ・ Input parse, systemd scope operations, operations around cgroup, authentication, sysinfo, seccomp, capabilities, selinux/apparmor, configuration file related, etc. ▸ CNI plugins ▸ conmon (container monitor) ・ A small resident program written in C that manages the container lifecycle ・ one conmon per container ・ equivalent to containerd-shim (subreaper of container process) ・ logging, TTY control, attach process, etc CRI-O related components
  8. 12 ▸ OCI Artifact ・ https://kubernetes.io/blog/2024/08/16/kubernetes-1-31-image-volume-source/ ・ https://kubernetes.io/blog/2024/03/07/cri-o-seccomp-oci-artifacts/ ▸ OCI

    Artifact initial support ・ Add OCI artifact support using libimage #8996 ▸ Volume subpath ・ Add image volume subpath support #9050 ▸ Mount ・ OCPNODE-3016: support mount OCI artifact #9062 ▸ Disable/enable mount ・ Add the option to disable/enable OCI Artifact mount #9147 ▸ Image verification ・ Add signature verification for image volumes #9060 ▸ Multi arch support ・ Support multi arch artifact #9194 OCI Artifact support - CRI-O
  9. 13 ▸ Demo at KubeCon 2024 EU WASM Day ・

    https://medium.com/@sohank2602/exploring-wasm-based-ai-models-in-kubernetes-with -cri-o-213acea91544 ・ https://www.youtube.com/watch?v=opX7PGwVO1c ▸ Model serving by WASM, model via OCI Artifact ▸ CRI-O + crun runs WASM binary in a container image Exploring WASM-based AI Models in Kubernetes with CRI-O apiVersion: v1 kind: Pod metadata: name: llama-pod spec: containers: - name: llama-container image: quay.io/sohankunkerkar/llama-crun:v3 volumeMounts: - name: wasm-volume mountPath: /app volumes: - name: wasm-volume image: reference: quay.io/sohankunkerkar/wasm-ai-model:v1 pullPolicy: IfNotPresent # Use a base image FROM scratch ENV WASMEDGE_PLUGIN_PATH=${WASMEDGE_PLUGIN_PATH:-"/usr/lib/wasmedge"} ENV WASMEDGE_WASINN_PRELOAD=${WASMEDGE_WASINN_PRELOAD:-"default:GGML:AUTO:/app/mo del.gguf"} WORKDIR /work # Copy wasm files to the directory COPY llama-chat.wasm /work # COPY model.gguf /app ENTRYPOINT ["/work/llama-chat.wasm"]
  10. 14 ▸ Dockerfile can set Stop signal ・ STOPSIGNAL SIGTERM

    ▸ Previously, there was no API to set STOPSIGNAL for Kubernetes Pod/Container. ・ If you wanted to customize it, you had to update the Dockerfile and recreate the image. ▸ KEP-4960: Container Stop Signals ・ spec.containers[*].lifecycle.stopSignal ・ CRI API is changed ▸ CRI-O supports STOPSIGNAL ・ https://github.com/cri-o/cri-o/pull/9086 Container Stop Signals support
  11. 15 ▸ CRI-O uses crun as a default OCI runtime

    ・ default to crun #8497 ・ Triggered 契機はruncがgo 1.22で動かなくなった問題 ・ runc doesn't work with go1.22 #4233 ・ 一応事前にvotingして意思決定したテイになっているものの ... ・ https://github.com/cri-o/cri-o/discussions/8507 ▸ /dev/net/tunをデフォルトで作成 ・ config: add /dev/net/tun to default allowed devices #8525 ・ コンテナ内でPodmanを動かすため ▸ Fine-grained SupplementalGroupsサポート (KEP-3619) ・ SecurityContextでRunAsUser, RunAsGroup, SupplementalGroupsを指定したときの動きを改 善 ・ server/*: add fine-grained SupplementalGroups control for enhanced security #8268 Miscellaneous
  12. 16 ▸ systemd watchdogのサポート ・ Add systemd watchdog support #8791

    ・ CRI-Oからsystemdに対してsd_notify(3)で定期的にkeep-alive pingし、service unitの WatchdogSecで設定した時間(60秒)反応がなければ再起動させる ▸ NRI v0.9.0のサポート ・ Update NRI to v0.9.0 #8855 ▸ Privilegedコンテナ用のseccompを設定できるようになった ・ Add option to allow seccomp profiles for privileged containers #9190 ▸ FreeBSDサポート ・ Add FreeBSD container support #7727 ▸ Podのhostport実装をiptablesからnftablesに変更 (#8684) ・ Port hostport code from iptables to nftables #8684 ・ RHEL10でiptablesがなくなったので... ・ そう言えばkube-proxyもnftables modeが追加されましたね Miscellaneous
  13. 18 ▸ https://github.com/containers/podman ▸ コンテナを構築、管理、実行する次世代のコンテナエンジン ▸ Open Container Initiative(OCI)を標準フォーマットとして採用 ▸

    Dockerとの互換性(コマンドライン、 Dockerイメージ、Compose、Docker互換API、など) ▸ Red Hatの開発チームを中心に OSSで開発 → CNCF Sandboxプロジェクトに申請 ▸ Fedora/CentOS/RHEL 系 Linux ディストリビューションに同梱 ・ RHEL8 以降、OS 同梱のコンテナエンジンが Docker から Podman に変更(RHEL 8以降は Docker非サポート) ・ Red Hat 製品の中ではPodmanが多く使われる ▸ Linuxだけでなく、macOS、Windowsでも使用可能 Podmanとは podman desktop
  14. 19 ▸ デーモンレス ▸ Fork & Execモデル ▸ ルートレス実行前提の設計 ▸

    systemdとの連携 ▸ Kubernetesと互換のあるPod ▸ Podmanの関連ツール(Buildah、Skopeo) ▸ etc… Podmanの特徴
  15. 21 ▸ 粛々とCNCF Sandboxプロジェクトとしての onboardingプロセスが進行中 ・ podman.ioのドメイン移管、artworkの提供、Code of Conductの更新、Slackチャネルの作成、 etc

    ▸ GitHub repoの移動は時間をかけて行う予定 ・ CI/CDに影響があるため ▸ Stale issueの扱い ・ auto closeの方針をISSUE.mdに明記 CNCF onboarding
  16. 22 ▸ podman artifact ・ サブコマンド ・ create, list, push,

    pull, inspect, extract ・ add --append ・ CLIのUIは変わるかもしれない ▸ 追加予定 ・ Artifactsディレクトリをコンテナ内にマウントする Volumeドライバ OCI Artifactサポート - Podman
  17. 23 ▸ macOSのRosettaサポート ▸ podman kube generateでのuser namespaceのサポート ▸ podman

    kube playでのimage type volumeのサポート ▸ host.containers.internal というFQDNで、Pasta使用時にコンテナからホストへの通信が可能に ▸ podman network create bridge --opt mode=unmanaged で既存ブリッジの流用が可能に ▸ image type mountのsubpathサポート (podman run --mouyt type=image,...) ▸ volume type mountのsubpathサポート (podman run --mouyt type=volume,...) ▸ podman updateの拡張 ・ Restart Policyの変更、ヘルスチェックの変更、ディスク I/Oの上限設定、環境変数の設定変更、 etc その他もろもろ
  18. 24 ▸ Intel Macサポートがベストエフォートベースに ・ テスト用ハードウェアが (開発者の手元に)ない ・ バイナリとMachineイメージはビルドする、パッチは受け付ける、がバグ修正は限定的 ▸

    Firewalld v2.3.0に導入された “Strict forward ports” が有効になっていると、 podman run -pによるポー トフォワードが効かない ・ 管理者がポートフォワードを明示的に管理するときに有効化する ・ なので動きとしては意図通り ・ デフォルトでは無効化されている ・ この問題に遭遇した際の Netavarkのエラーメッセージをわかりやすくするよう改善 ・ 有効化されている場合は、 Podmanでポートフォワードする際に Firewalld側の設定が必要 その他もろもろ
  19. 26 ▸ crunのハンドラを利用して、 crun経由で通常のコンテナプロセス以外のいろいろを実行可能 ・ WASMバイナリ ・ コンテナイメージのEntrypointをWASMバイナリに設定 ・ Podman実行時に

    run.oci.handler=wasm のannotationを指定 ・ 通常バイナリのKVM隔離環境での実行 ・ 通常のコンテナイメージ ・ Podman実行時に run.oci.handler=krun のannotationを指定 ・ 仮想マシンの実行 ・ コンテナイメージ内に qcow2のディスクイメージファイルを格納 ・ OCIランタイムとしてcrun-vmを指定 ・ crunとlibkrunを組み合わせて、仮想マシンを実行できるようにした OCIランタイム Podmanを使ったコンテナ以外の実行
  20. 27 Podman+crun+WasmEdgeでWasmバイナリを実行 • Wasmバイナリを生成する準備をする $ rustup target add wasm32-wasi •

    Wasmバイナリをビルドする • Wasmバイナリをそのまま実行してみる $ wasmedge target/wasm32-wasi/debug/hello.wasm world hello world • Dockerを作成する $ cat > Dockerfile <<END FROM scratch COPY target/wasm32-wasi/debug/hello.wasm / CMD ["/hello.wasm" "world"] END • コンテナイメージをビルドする $ buildah build -t mywasm-hello . • コンテナとしてWasmバイナリを実行する $ podman run --annotation=run.oci.handler=wasm localhost/mywasm-hello hello world $ git clone https://github.com/second-state/wasm-learning.git $ cd wasm-learning/cli/hello $ cat src/main.rs use std::env; fn main() { println!("hello"); for argument in env::args().skip(1) { println!("{}", argument); } } $ cargo build --target wasm32-wasi
  21. 28 Podman+crun+libkrunでKVM isolation実行 • crun+libkrunでコンテナを実行する $ podman run -d \

    -v /dev/kvm:/dev/kvm \ --annotation=run.oci.handler=krun \ --name nginx nginx • コンテナプロセスのPIDを確認する • KVMの仮想環境でコンテナプロセスが動いていることを確認する $ ls -l /proc/${pid}/fd | grep kvm lrwx------. 1 ori ori 64 Nov 16 00:40 19 -> anon_inode:kvm-vm lrwx------. 1 ori ori 64 Nov 16 00:43 29 -> anon_inode:kvm-vcpu:0 lrwx------. 1 ori ori 64 Nov 16 00:43 31 -> anon_inode:kvm-vcpu:1 lrwx------. 1 ori ori 64 Nov 16 00:43 33 -> anon_inode:kvm-vcpu:2 lrwx------. 1 ori ori 64 Nov 16 00:43 35 -> anon_inode:kvm-vcpu:3 lrwx------. 1 ori ori 64 Nov 16 00:43 37 -> anon_inode:kvm-vcpu:4 lrwx------. 1 ori ori 64 Nov 16 00:43 39 -> anon_inode:kvm-vcpu:5 lrwx------. 1 ori ori 64 Nov 16 00:43 41 -> anon_inode:kvm-vcpu:6 lrwx------. 1 ori ori 64 Nov 16 00:43 43 -> anon_inode:kvm-vcpu:7 $ podman inspect nginx | jq '.[].State.Pid' 190597 $ pid=$(podman inspect nginx | jq '.[].State.Pid') $ ps -p ${pid} f PID TTY STAT TIME COMMAND 190597 ? Ssl 0:00 [libcrun:krun] /docker-entrypoint.sh nginx -g daemon off;
  22. 32 ▸ https://ramalama.ai/ ▸ https://github.com/containers/ramalama ▸ ローカル環境でOCIコンテナを使ってAIモデルを扱うためのオープンソースのツール ▸ 推論やRAGのサービスを提供 ▸

    OCIコンテナを活用 ▸ 様々な環境をサポート ・ AIモデルレジストリ: Ollamaライブラリ、Hugging Face Hub、OCIレジストリ等 ・ コンテナエンジン: Docker、Podman ・ 推論エンジン: llama.cpp、vLLM ・ AIアクセラレータ: Apple Silicon GPU on macOS + Vulkan/Metal、Apple Silicon GPU on Asahi + Vulkan、AMD GPU + ROCm、NVIDIA GPU + CUDA、Intel GPU + oneAPI、Huawei Ascend + CANN、等 RamaLama
  23. 33 ▸ ユーザー空間ランタイムをコンテナで提供 ・ llama.cpp or vLLM ・ CUDA, ROCm,

    ... ・ コンテナではなくネイティブバイナリも実行可能 ・ macOS上で ramalama --nocontainer run ... ▸ rootless実行 ▸ daemonless実行も可能 ▸ モデルはOCI Artifactとして利用 ・ Hugging Face, Ollama Libraryもサポート ▸ Kubernetesのmanifestを生成可能 OCIコンテナの技術を活用 OCIコンテナ技術を活用し、 信頼できないモデルを、セキュアな隔離環境で実行
  24. 34 ▸ 実際のところ、RamaLamaのユーザー体験、できることは Ollamaとよく似ています ▸ RamaLama開発メンバーは当初、 Ollamaを使おうと考え、改善点を見つけては Pull Requestを送ってい た

    → ...が、ごく一部を除いてほとんどのパッチが取り込まれない → RamaLama爆誕 ▸ なんだかDockerとPodmanの関係に似てなくもない ...? Ollamaとの違い
  25. 35 ▸ Ollamaでこれまで見られた光景 ・ サポートするアクセラレータが限られている (OllamaはNVIDIA CUDA, AMD ROCmのみ) ・

    Vulkanサポートほしい... → GitHubでfork repo乱立 ・ モデルライブラリの取得プロトコルが独自 (OllamaライブラリはOCIコンテナレジストリを独自拡張したもの ) ・ サポートするモデルレジストリが限られている (Ollamaライブラリのみ) ・ 後にHagging Faceにも対応 ・ 推論エンジンの選択肢が限られている (ollamaが独自にforkしたllama.cppのみ) ・ llama.cppに独自拡張や修正を加えているが、 llama.cppのupstreamには全くフィードバックしない ・ llama.cppを使っていることのクレジットがほとんどない ・ チャットテンプレートが golang templateなのは使いにくい (OllamaはほぼGoで書かれているので ) ・ 上記に対するPRやIssueを上げてもほとんど無視される ▸ 参考 ・ https://news.ycombinator.com/item?id=36802582 ・ https://news.ycombinator.com/item?id=42886680 Ollamaとの違い
  26. +---------------------------+ | | | ramalama run granite3-moe | | |

    +-------+-------------------+ | | | +------------------+ +------------------+ | | Pull inferencing | | Pull model layer | +-----------| runtime (cuda) |---------->| granite3-moe | +------------------+ +------------------+ | Repo options: | +-+-------+------+-+ | | | v v v | | | v v v +------------------+ | Start with | | cuda runtime | | and | | granite3-moe | +------------------+ 36 実行の流れ
  27. linkedin.com/company/red-hat youtube.com/user/RedHatVideos facebook.com/redhatinc twitter.com/RedHat 37 Red Hat is the world’s

    leading provider of enterprise open source software solutions. Award-winning support, training, and consulting services make Red Hat a trusted adviser to the Fortune 500. Thank you