CloudNative Days Spring 2021 ONLINE キーノートでの発表資料です。
https://event.cloudnativedays.jp/cndo2021/talks/1071
本セッションでは、DockerとKubernetesのもつ基本的な機能の概要を、コンテナの仕組みをふまえつつイラストを用いて紹介していきます。一般にあまり焦点をあてて取り上げられることは多くありませんが、コンテナの作成や管理を担う低レベルなソフトウェア「コンテナランタイム」も本セッションの中心的なトピックのひとつです。
本セッションは、拙著「イラストで分かるDockerとKubernetes」(技術評論社)の内容を参考にしています。
https://www.amazon.co.jp/dp/4297118378
CloudNative Days Tokyo 2020での、lazypullに関する発表資料です。https://event.cloudnativedays.jp/cndt2020/talks/16
Stargz Snapshotterのリポジトリ:
https://github.com/containerd/stargz-snapshotter
The document discusses Apache OpenWhisk, a serverless computing platform or Function as a Service (FaaS) that allows running code in response to events. It provides an overview of OpenWhisk architecture including the controller, invoker, and provider components. Examples of using OpenWhisk with Yahoo! Japan and for FaaS are described. Monitoring and developer tools for OpenWhisk are also mentioned.
CloudNative Days Spring 2021 ONLINE キーノートでの発表資料です。
https://event.cloudnativedays.jp/cndo2021/talks/1071
本セッションでは、DockerとKubernetesのもつ基本的な機能の概要を、コンテナの仕組みをふまえつつイラストを用いて紹介していきます。一般にあまり焦点をあてて取り上げられることは多くありませんが、コンテナの作成や管理を担う低レベルなソフトウェア「コンテナランタイム」も本セッションの中心的なトピックのひとつです。
本セッションは、拙著「イラストで分かるDockerとKubernetes」(技術評論社)の内容を参考にしています。
https://www.amazon.co.jp/dp/4297118378
CloudNative Days Tokyo 2020での、lazypullに関する発表資料です。https://event.cloudnativedays.jp/cndt2020/talks/16
Stargz Snapshotterのリポジトリ:
https://github.com/containerd/stargz-snapshotter
The document discusses Apache OpenWhisk, a serverless computing platform or Function as a Service (FaaS) that allows running code in response to events. It provides an overview of OpenWhisk architecture including the controller, invoker, and provider components. Examples of using OpenWhisk with Yahoo! Japan and for FaaS are described. Monitoring and developer tools for OpenWhisk are also mentioned.
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
Rootless mode is a technique to harden containers by running the container engine as a non-root user. The support for rootless mode has been merged into Docker since v19.03 (2019) and in Kubernetes since v1.22 (2021). However, setting up Rootless Kubernetes has been more challenging than setting up Rootless Docker due to its complexity. This session presents Usernetes Generation 2, a Kubernetes distribution that wraps Kubernetes in Rootless Docker for ease of setting up multi-node Rootless Kubernetes clusters. Unlike the original Usernetes (Generation 1) that was based on "Kubernetes The Hard Way", Usernetes Generation 2 supports kubeadm. Usernetes Generation 2 is similar to `kind` and `minikube`, however, unlike them Usernetes Generation 2 supports forming real multi-node clusters using Flannel (VXLAN) and it can be potentially used for production clusters. https://github.com/rootless-containers/usernetes
20240321 [KubeCon EU Pavilion] Lima.pdf_Akihiro Suda
Lima is a tool for running Linux virtual machines and containers on macOS. It provides automatic host filesystem sharing, port forwarding, and integration with container runtimes like Docker and Kubernetes. Users can launch preconfigured Linux distro and container engine templates with a single command.
20240320 [KubeCon EU Pavilion] containerd.pdfAkihiro Suda
An industry-standard container runtime that is graduated by the CNCF and adopted by major Kubernetes services and distributions. It is designed to be pluggable and support new features through plugins like remote snapshotters and WASM runtimes. It provides plugins for runtimes like runc and runhcs, snapshotters like overlayfs and btrfs, and tools like nerdctl and containerd v2.0 which focus on cleaning up deprecated features and improving user namespace support.
20240201 [HPC Containers] Rootless Containers.pdfAkihiro Suda
Rootless containers put the container runtime in a user namespace to limit privileges. This improves security by preventing access to other users' files, ability to modify the kernel or firmware. Rootless containers have been supported by container runtimes since 2014 and are useful for shared computing environments. Key aspects include user namespaces remap UIDs to limit privileges to inside namespaces, and networking solutions like slirp4netns or bypass4netns to provide networking without privileges. Rootless Kubernetes called Usernetes allows running Kubernetes without root privileges and supports multi-node clusters.
[Podman Special Event] Kubernetes in Rootless PodmanAkihiro Suda
- Kubernetes can run in rootless containers using techniques like Podman, Docker, and containerd which map the root user inside containers to a non-root user on the host for improved security.
- Popular ways to run rootless Kubernetes include kind, minikube wrapped in Podman containers, and Usernetes which supports real multi-node clusters across multiple hosts using networking like Flannel.
- Future work includes promoting the "KubeletInUserNamespace" feature flag and eliminating overhead of user-mode TCP/IP for containers to improve the rootless Kubernetes experience.
Lima is a tool for running Linux virtual machines on macOS to run containers. It provides automatic host filesystem sharing, port forwarding, and integration with container runtimes like Docker and Kubernetes. It uses QEMU or macOS's Virtualization.framework as the hypervisor and supports networking and filesystem options like sshfs, virtio-9p-pci, and virtiofs. It includes templates for common Linux distros and container engines that can be launched with a single command.
Containerd is a CNCF graduated, open source container runtime with many enterprise users. It uses plugins to support features like remote images, WASM runtimes, and different OSes. The runtime provides snapshotters for storage like overlayfs and btrfs, and runtime plugins for Linux, Windows, FreeBSD and WASM. Nerdctl is a container CLI similar to Docker but optimized for Containerd experiments. Recent updates include sandboxing for "pauseless" pods and image transfer APIs, with a focus on cleaning deprecated features and improving user namespaces in upcoming versions.
https://github.com/rootless-containers/usernetes
Usernetes (Gen2) deploys a Kubernetes cluster inside Rootless Docker, so as to mitigate potential container-breakout vulnerabilities.
Usernetes (Gen2) is similar to Rootless kind and Rootless minikube, but Usernetes (Gen 2) supports creating a cluster with multiple hosts.
[DockerCon 2023] Reproducible builds with BuildKit for software supply chain ...Akihiro Suda
Images maintained by a reputable organization or an individual are often considered to be trustworthy; however, it is hard to deny the possibility that they might have silently injected malicious codes that are not present in the source repo. Also, even if they have no malicious intent, their images can still be compromised on an accidental leakage of registry credentials.
The latest release of BuildKit solves this supply chain security concern with reproducible builds. Reproducible builds is a technique to ensure that a bit-for-bit identical image can be reproduced from its source code, by anybody, at any time. When multiple actors can attest to an image's reproducibility, it signifies that the image contains no code of a secret origin.
Audiences of this talk will learn how they can and how sometimes they cannot make their images reproducible to improve their trust.
The internals and the latest trends of container runtimesAkihiro Suda
The document discusses the internals and latest trends of container runtimes. It describes how container runtimes like Docker use kernel features like namespaces and cgroups to isolate containers. It explains how containerd and runc work together to manage the lifecycles of container processes. It also covers security measures like capabilities, AppArmor, and SELinux that container runtimes employ to safeguard the host system.
This document summarizes Lima, an open-source tool for running Linux virtual machines and containers on macOS. Lima provides automatic host filesystem sharing and port forwarding, and integrates with container engines like Docker and container orchestrators like Kubernetes. It uses QEMU or macOS's Virtualization.framework as the hypervisor and supports networking and storage drivers. Templates are provided for common Linux distributions and container tools.
An industry-standard container runtime that is graduated by the CNCF since 2019 and adopted by major Kubernetes services and distributions. It is designed to be pluggable to support new features like remote snapshotting and WASM runtimes. Containerd provides plugins for snapshotting storage backends, runtimes for different operating systems, and tools like nerdctl for experimenting with new containerd capabilities. Upcoming versions will focus on cleaning deprecated features and improving APIs for image transfer and user namespaces.
[Container Plumbing Days 2023] Why was nerdctl made?Akihiro Suda
nerdctl (contaiNERD CTL) was made to facilitate development of new technologies in the containerd platform.
Such technologies include:
- Lazy-pulling with Stargz/Nydus/OverlayBD
- P2P image distribution with IPFS
- Image encryption with OCIcrypt
- Image signing with Cosign
- “Real” read-only mounts with mount_setattr
- Slirp-less rootless containers with bypass4netns
- Interactive debugging of Dockerfiles, with buildg
nerdctl is also useful for debugging Kubernetes nodes that are running containerd.
Through this session, the audiences will learn these functionalities of nerdctl, relevant projects, and the roadmap for the future.
https://containerplumbing.org/sessions/2023/why_was_nerdctl_
[FOSDEM2023] Bit-for-bit reproducible builds with DockerfileAkihiro Suda
This document discusses techniques for making container builds reproducible, including:
- Using BuildKit v0.11 which supports deterministic timestamps through SOURCE_DATE_EPOCH
- Using repro-get to cryptographically lock package versions to ensure reproducible package installation
- Future work including simplifying Dockerfiles, caching packages locally, and integrating with provenance standards
Lima is a Linux virtual machine for macOS that allows running container workloads like containerd and k3s. It provides automatic host filesystem sharing and port forwarding between the Linux VM and macOS host. Lima uses QEMU virtualization and virtio-9p-pci for filesystem sharing. It supports building and running containers without requiring root on the host. Lima aims to provide an easy way to run containers on macOS for development and testing purposes.
23. TLSを用いたDockerソケットの保護
23
TLSの設定方法: https://docs.docker.com/engine/security/https/
$ openssl genrsa -aes256 -out ca-key.pem 4096
Generating RSA private key, 4096 bit long modulus
..................................................................
..................................................................
........................................................++
........++
e is 65537 (0x10001)
Enter pass phrase for ca-key.pem:
Verifying - Enter pass phrase for ca-key.pem:
$ openssl req -new -x509 -days 365 -key ca-key.pem -sha256 out
ca.pem
Enter pass phrase for ca-key.pem:
You are about to be asked to enter information that will be
incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name
or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:
State or Province Name (full name) [Some-State]:Queensland
Locality Name (eg, city) []:Brisbane
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Docker
Inc
Organizational Unit Name (eg, section) []:Sales
Common Name (e.g. server FQDN or YOUR name) []:$HOST
Email Address []:[email protected]
$ openssl genrsa -out server-key.pem 4096
Generating RSA private key, 4096 bit long modulus
.............................
........................................++
....................................
.............................................................++
e is 65537 (0x10001)
$ openssl req -subj "/CN=$HOST" -sha256 -new -key server-key.pem
-out server.csr
$ echo subjectAltName = DNS:$HOST,IP:10.10.10.20,IP:127.0.0.1 >>
extfile.cnf
$ echo extendedKeyUsage = serverAuth >> extfile.cnf
$ openssl x509 -req -days 365 -sha256 -in server.csr -CA ca.pem
-CAkey ca-key.pem -CAcreateserial -out server-cert.pem -extfile
extfile.cnf
Signature ok subject=/CN=your.host.com
Getting CA Private Key
Enter pass phrase for ca-key.pem:
$ openssl genrsa -out key.pem 4096
Generating RSA private key, 4096 bit long modulus
.........................................................++
................++
e is 65537 (0x10001)
$ openssl req -subj '/CN=client' -new -key key.pem -out client.csr
$ echo extendedKeyUsage = clientAuth >> extfile.cnf
$ openssl x509 -req -days 365 -sha256 -in client.csr -CA ca.pem
-CAkey ca-key.pem -CAcreateserial -out cert.pem -extfile
extfile.cnf
Signature ok
subject=/CN=client
Getting CA Private Key
Enter pass phrase for ca-key.pem:
$ rm -v client.csr server.csr
$ chmod -v 0400 ca-key.pem key.pem server-key.pem
$ chmod -v 0444 ca.pem server-cert.pem cert.pem
$ dockerd --tlsverify --tlscacert=ca.pem --tlscert=server-cert.pem
--tlskey=server-key.pem -H=0.0.0.0:2376
$ docker --tlsverify --tlscacert=ca.pem --tlscert=cert.pem
--tlskey=key.pem -H=$HOST:2376 version
出典: 上記URL
24. TLSを用いたDockerソケットの保護
24
TLSの設定方法: https://docs.docker.com/engine/security/https/
$ openssl genrsa -aes256 -out ca-key.pem 4096
Generating RSA private key, 4096 bit long modulus
..................................................................
..................................................................
........................................................++
........++
e is 65537 (0x10001)
Enter pass phrase for ca-key.pem:
Verifying - Enter pass phrase for ca-key.pem:
$ openssl req -new -x509 -days 365 -key ca-key.pem -sha256 out
ca.pem
Enter pass phrase for ca-key.pem:
You are about to be asked to enter information that will be
incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name
or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:
State or Province Name (full name) [Some-State]:Queensland
Locality Name (eg, city) []:Brisbane
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Docker
Inc
Organizational Unit Name (eg, section) []:Sales
Common Name (e.g. server FQDN or YOUR name) []:$HOST
Email Address []:[email protected]
$ openssl genrsa -out server-key.pem 4096
Generating RSA private key, 4096 bit long modulus
.............................
........................................++
....................................
.............................................................++
e is 65537 (0x10001)
$ openssl req -subj "/CN=$HOST" -sha256 -new -key server-key.pem
-out server.csr
$ echo subjectAltName = DNS:$HOST,IP:10.10.10.20,IP:127.0.0.1 >>
extfile.cnf
$ echo extendedKeyUsage = serverAuth >> extfile.cnf
$ openssl x509 -req -days 365 -sha256 -in server.csr -CA ca.pem
-CAkey ca-key.pem -CAcreateserial -out server-cert.pem -extfile
extfile.cnf
Signature ok subject=/CN=your.host.com
Getting CA Private Key
Enter pass phrase for ca-key.pem:
$ openssl genrsa -out key.pem 4096
Generating RSA private key, 4096 bit long modulus
.........................................................++
................++
e is 65537 (0x10001)
$ openssl req -subj '/CN=client' -new -key key.pem -out client.csr
$ echo extendedKeyUsage = clientAuth >> extfile.cnf
$ openssl x509 -req -days 365 -sha256 -in client.csr -CA ca.pem
-CAkey ca-key.pem -CAcreateserial -out cert.pem -extfile
extfile.cnf
Signature ok
subject=/CN=client
Getting CA Private Key
Enter pass phrase for ca-key.pem:
$ rm -v client.csr server.csr
$ chmod -v 0400 ca-key.pem key.pem server-key.pem
$ chmod -v 0444 ca.pem server-cert.pem cert.pem
$ dockerd --tlsverify --tlscacert=ca.pem --tlscert=server-cert.pem
--tlskey=server-key.pem -H=0.0.0.0:2376
$ docker --tlsverify --tlscacert=ca.pem --tlscert=cert.pem
--tlskey=key.pem -H=$HOST:2376 version
出典: 上記URL