Skip to content
Flux
Six Checks Before You Deploy a Container on Flux

Six Checks Before You Deploy a Container on Flux

Most containers that run on your laptop will run on Flux unchanged. The ones that don’t usually trip over the same few things, and all of them are quick to check before you deploy. Every limit below comes from the FluxOS 8.24 source.

1. The image is built for amd64 or arm64

Flux runs images for amd64 and arm64. If your app has several components, they need at least one architecture in common so the network can find nodes that run all of them. Private apps are stricter: ArcaneOS nodes are amd64-only, so every component of a private app must ship an amd64 build. If you build on an Apple silicon Mac, that’s the one to watch, because a plain docker build there produces arm64 only. Build both at once with docker buildx build --platform linux/amd64,linux/arm64 -t you/app:1.0 --push . and the same tag serves either kind of node.

2. It’s under 5 GB, and ideally far under

The hard limit is 5 GB per image. Size matters well before that, though, because every node that runs your app pulls the image itself. A slim base image and a multi-stage build mean faster first starts and faster moves when an instance changes node.

3. Its ports are ones the network allows

Public apps can use most ports between 1 and 65535. A few are reserved. The well-known service ports are off the list, among them SSH (22), SMTP (25), DNS (53), NTP (123), RDP (3389), VNC (5900) and MongoDB’s default 27017, and so are Flux’s own ranges 16100 to 16299, 26100 to 26299 and 30000 to 30099. Ports below 1024, plus 8080, 8081, 8443 and 6667, are kept for enterprise apps.

Your container can still listen on 80 or 8080 inside, because the specification maps each public port to a container port. Pick something like 3000 or 31000 as the public side. You rarely need 443 anyway: every app gets HTTPS addresses under app.runonflux.io, and if you set your own domain, Flux obtains and renews a Let’s Encrypt certificate for it.

4. Anything worth keeping lives in the data path

An instance can be moved to another node, and only the folder you declare as container data goes with it. Anything else written inside the container is rebuilt from the image. The data path also decides how copies of your data relate to each other:

  • /data on its own is local to each instance.
  • r:/data keeps the folder synchronised across all instances.
  • g:/data runs one primary and keeps the others on standby with its data, ready to take over. This is the mode for databases and anything with a single writer, explained in One Live, One Standing By.

You aren’t limited to one folder. Extra directories (m:logs:/var/log), single files (f:config.yaml:/etc/app/config.yaml) and folders that never replicate (ml:cache:/var/cache) can sit next to the main path.

5. Secrets aren’t in a public specification

The specification of a public app is public: anyone can read it from the network, environment variables included. Don’t put API keys or database passwords there. For anything sensitive, deploy in private mode. It encrypts the whole specification so that only ArcaneOS nodes can read and run it.

6. You’ve chosen how many copies to run

Version 8 apps can run as a single instance, and any app can run up to 100. For anything people depend on, three or more is the safer choice: they run on separate machines, so one node going offline doesn’t take your app with it. Logs written to standard output show up live in FluxCloud, which makes it easy to watch the copies come up.

If all six check out, you’re ready. The quickest ways in are in Deploy Your First App on Flux, from typing what you want into FluxCloud to pushing a repository with Orbit.


Posted in Education

by RunonFlux

Tags:

Comments

Leave a Reply

You must be logged in to post a comment.