Benki β†’ All Posts

β‡  previous page next page β‡’
Matthias #

How to run Docker in a Kubernetes pod powered by a Kata container:

  1. Make sure that you are running containerd >= 1.3.
  2. Configure containerd as described at Kata Containers as a Runtime Class in the Kata Containers documentation.
  3. Add privileged_without_host_devices = true to the [plugins.cri.containerd.runtimes.kata] section of containerd’s config.toml file. This ensures that privileged Kata containers can only access the guest VM managed by the Kata containers runtime and not also the host system.
  4. Create a Kubernetes pod running an ubuntu:20.04 container with securityContext: {privileged: true} set and runtimeClassName: kata. You may wish to double-check that host devices are really inaccessible (for example by checking whether the host’s root disk is visible in /dev) before you proceed.
  5. Enter the Kubernetes pod, install Docker by running apt update; apt install -y --no-install-recommends docker.io, and type dockerd --storage-driver=vfs. Docker should now be running.

If you are migrating an existing kubeadm-managed, Docker-based cluster to Containerd, see my post on how to migrate kubeadm to Containerd.

Matthias #

I have reconfigured the server running this web site. The Kubernetes cluster can now run pods in Kata containers.

My hope is that I can use the isolation that it provides to run docker-compose inside a pod, as I use certain software that ships with a docker-compose file, which up to now I have always had to laboriously translate into a set of native Kubernetes deployments each time a new version would come out.

We’ll see if it’s as easy as I am hoping.

Apparently, linear types are landing in GHC 9. I’m sure they’re useful for resource management. I wonder what else they might do that makes a difference in practice.

Takeaways:

  • Use collection types judiciously. They have overhead.
  • Look out for empty collections. They are pure overhead. Sometimes, null can be a good alternative.
  • Collection types have default sizes that are all over the place. Sometimes it can be worth specifying the capacity at instance creation time.
  • Objects come with overhead. Use primitives where you can.

I’m suddenly experiencing a craving for inline types and generics specialization

The specification of the .editorconfig file, which you can put into your source code repository to configure a wide range of text editors and IDEs with consistent style settings.

A probe.rs-based Cargo runner that lets you run embedded Rust programs just like native ones. Logs to stdout as normal and prints stack traces on error as normal.

A kit with all the basics you need to do embedded programming in Rust: a debugging bridge, a way to flash and run binaries, and text editor integration.

Strives to support many different embedded targets (currently RISC-V, STM32, and other ARM targets) and debug probes (currently CMSIS-DAP, ST-Link, and J-Link).

An efficient Rust logging library for embedded devices. Logs in binary, formats on the host.

Matthias #

If you use Quarkus with Scala and you get a java.lang.NoClassDefFoundError or java.lang.ClassNotFoundException when recompiling in development mode, try adding an explicit scala-compiler dependency to your POM:

  <dependencies>
    ...
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-compiler</artifactId>
      <version>${scala.version}</version>
    </dependency>
    ...
  </dependencies>

This may help because Quarkus has an implicit dependency on a specific version of the compiler, which may not match the one that you are using in your project.

It worked for me, at least.

(I have since removed Scala from the MulkCMS 2 code base again as it only made the build time much longer without bringing in enough to make it worth it. Scala 3 might change that β€” we shall see.)

Computers today react less promptly to input than did computers from the 70s and 80s. After a period of really bad latency, we are getting close again, though.

The Asian giant hornet (β€˜murder hornet’), dangerous to both people and other insects, has arrived in the United States.

The hornet is known to kill whole beehives without resistance, chopping off bees’ heads and taking their thoraxes to feed their own young. While Japanese bees appear to have evolved a defense against them where they swarm each individual hornet and cook it alive by flexing their muscles to generate heat, American and European bees are defenseless, putting them in danger of extinction.

A small, but effective JIT compiler in C. Very new and not production-ready yet.

Organizations with loose or nonexistent formal structures tend to favor the strong and oppress the weak, who generally benefit from formal structure and bureaucracy. Informal structures and cliques are less transparent and harder to control than formal hierarchies.

A very small compiler back end in portable C. Only targets unixoid AMD64 ABIs at this time.

β‡  previous page next page β‡’