Submit

Back to the channels

#primate

  1. * phaleth joined #primate
  2. phaleth bye bye blue
  3. * blue joined #primate
  4. phaleth wb blue, I'll deploy theanswerisc blog onto podman today, just to test the stability
  5. blue thx phaleth
  6. blue alright, so it's podman inside nspawn or vice versa or what?
  7. blue just remember, I don't plan on using podman at all in the long run. per customer will be kvm, inside customer will be nspawn
  8. phaleth oh, ok, sounds like I should do more reading of archwiki
  9. blue basically the ideal is, we'll be having barebones, then we put kvm on it
  10. blue every customer (=namespace) gets put in one kvm (or several, but it's only ever one customer per kvm)
  11. blue a barebones can have unlimited number of kvm spaces or whatever the term is
  12. blue kvm ensures proper separation
  13. blue within a kvm space, we use nspawn to separate all the machines
  14. blue so take dreamreal: if his user is dreamreal, he gets a kvm space. within that, he could have many repos, with many apps. all of them run within his space (or several spaces, depending on the size/number of apps)
  15. blue so he can never access the nspawn machines within another kvm space
  16. phaleth ok, but it could happen that if he deploys many apps to one kvm then one of them could get compromised and all the other apps could get hacked
  17. phaleth why? cause nspawn containers run as root, that's why I'm messing around with rootless podman these days
  18. phaleth I mean the isolation will prolly not be perfect, but any extra isolation is good
  19. phaleth also we will be able to use podman-compose, which is very very nice
  20. blue isn't there rootless nspawn?
  21. blue I think the limitation was creating networks, for that you need root privileges
  22. blue anyway podman is probably not great isolation either. if you really want perfect isolation we need kvm
  23. blue how about one kvm per repo, will that be enough?
  24. blue I guess no, since if your test app is compromised someone could compromise your prod app
  25. phaleth I'll just update the theanswerisc deployment today and so you can read it, for sure I'll try rootless nspawn too, but nspawn is such an underdocumented tech so I don't know, but I'll try
  26. blue coo
  27. blue btw phaleth, did you look into this? https://katacontainers.io/
  28. nevet Kata Containers - Open Source Container Runtime Software
  29. blue definitely big red flag there that it's written in rust
  30. phaleth yeah, noticed that several months ago, but didn't try that
  31. blue you did try firecracker, right
  32. phaleth nope, firecracker has memory issues, I'm willing to go with qemu/kvm
  33. blue for that we'd need a dedi though
  34. blue I mean, it's likely our own vps runs in kvm
  35. phaleth it does, contabo does not hide the fact they use qemu/kvm
  36. phaleth firecracker is also written in rust
  37. blue I think kvm should be enough, but obviously an overkill per app
  38. blue so the question becomes at what boundary level do you use it
  39. blue per customer, you said is too broad
  40. phaleth I think nspawn and podman is a good solution, just need to avoid the use of root user like I do in all these mariadb containers
  41. blue but why both?
  42. blue they're competing products
  43. phaleth customer -> project(s) -> machine(s) for builds/deployments... builds/deployments are linked together via one table as stack layers
  44. phaleth containers within containers are done to gain more isolation, nothing is as perfect as a VM, but for containers there's non need for dedis
  45. phaleth also I think crun and pasta are really great, maybe later on we could consider podman within podman
  46. phaleth both rootless
  47. blue oki, I'll let you be the master of that
  48. blue as long as we fget proper security I don't really care how it's done
  49. phaleth yeah, I'm not so inclined towards nspawn anymore cause of security, but I'll try if it can run rootless containers
  50. phaleth always assume the tech will be changing anyway, maybe katacontainers will win the game in few years
  51. blue ya
  52. phaleth rootless and also distroless are the buzzwords nowadays, also nspawn is heavily dependent on systemd which means the bottom layer of each container is huge and that will add up
  53. blue ya
  54. blue phaleth: what about one dedi + several kvms (one per customer) + firecrackers inside kvm
  55. blue or is that still the memory issue
  56. phaleth yeah, you can try fly again if you want to, the way they deal with OOMs related to firecracker is that they auto restart these microvms, no clue how they deploy postgres, prolly somehow differently
  57. phaleth the good think about nspawn container is that one can run anything on it
  58. blue maybe we should just have a mixed security model, free customers share dedis, premiums are fully separated, get their own dedi + potentially kvm + nspawn
  59. blue the ultimate security win is one dedi per customer, but it's also the most expensive
  60. phaleth yeah, I think that's a good opportunity for marketing, having these shared vs. dedicated terms in the portfolio
  61. phaleth also not everybody will need dynamic apps with dbs behind them, if it's just a static site we can deploy it to a freebsd server where the only thing needed is a piece of nginx config
  62. phaleth I mean there are already lots of services like that, but still
  63. blue ua
  64. blue ya
  65. phaleth another cool thing about podman is that it runs on freebsd, while nspawn is linux only
  66. blue I mean if you prefer podman, let's do it. I'm not sold on nspawn
  67. blue I just don't want to mix a thousand different technologies because in the end we need an abstraction API over them, we can't do it manually, and every one of them means the abstraction layer gets more complex
  68. blue does podman have a nice http-based API like docker?
  69. blue maybe that solves our need to create an abstraction around calls to nspawn
  70. blue I wouldn't mind that, that would be great, would save me a lot of headache
  71. phaleth yeah, I'd also like to use haproxy APIs
  72. phaleth podman does have docker compatible API https://medium.com/@pingkunga/how-to-enable-remote-api-in-podman-e32cede96309
  73. blue that would be cool: in that case, the podman machien for repopack.com would use this API for management, that's amazing, no?
  74. blue I'm gonna try to install podman here locally and activate the API, so I can develop against it
  75. phaleth yeah, it's great
  76. phaleth I'd like to mess around with freebsd later on again, but now I'll be slowly introducing podman into the setup we already have
  77. blue ok
  78. blue phaleth: I installed podman & ran a rootless container on it, lovely!
  79. phaleth yeah, very simple
  80. blue podman run -d --name hello-http --rm \ -p 127.0.0.1:8080:8080 \ docker.io/hashicorp/http-echo:latest \ -listen=:8080 -text="hello world"
  81. blue phaleth: ^ will start a new test container you can test with
  82. blue `podman stop hello-http` to kill it
  83. blue you might need to remove the \
  84. blue it was a multiline command
  85. blue podman run -d --name hello-http --rm -p 127.0.0.1:8080:8080 docker.io/hashicorp/http-echo:latest -listen=:8080 -text="hello world"
  86. blue ^
  87. blue phaleth: systemctl --user enable --now podman.socket
  88. blue check that it worked: `systemctl --user status podman.socket --no-pager`
  89. blue should say `Active: active (listening)`
  90. phaleth on the vps?
  91. blue sure.. it'd be scoped to your user anyway, so no harm
  92. blue curl --silent --unix-socket "$XDG_RUNTIME_DIR/podman/podman.sock" http://d/_ping
  93. blue should say `OK`
  94. phaleth you can try this image ghcr.io/ammnt/freenginx:latest, it's a very hardened one
  95. blue also try this
  96. blue curl --silent --unix-socket "$XDG_RUNTIME_DIR/podman/podman.sock" http://d/v1.0.0/libpod/info | jq
  97. blue "version": {
  98. blue "APIVersion": "5.8.0",
  99. blue "GoVersion": "go1.26.0-X:nodwarf5",
  100. blue "Version": "5.8.0",
  101. blue "GitCommit": "07efc23e05c3d9aa15a0f30d57194737bfc4b6b1",
  102. blue "BuiltTime": "Sun Feb 22 22:45:50 2026",
  103. blue "Built": 1771796750,
  104. blue "OsArch": "linux/amd64",
  105. blue "Os": "linux"
  106. blue }
  107. blue it's written in go, hurrah!
  108. blue this is amazing phaleth
  109. blue this is exactly what we needed
  110. phaleth yeah, only the crucial components to podman are written in C, crun and pasta
  111. blue phaleth: what'st he idea here? customer=user, podman runs in the context of the user?
  112. phaleth yeah
  113. phaleth I'd still do orgs already, but we said we will not do orgs
  114. blue yes, I meant orgs
  115. blue user=org
  116. phaleth org can have multiple users
  117. blue yes but the podman would run under the org user?
  118. blue anywayt we can nail down the particulars later
  119. phaleth yeah, for now just have orgs and users tables with 1:1 relationship
  120. phaleth this image works with podman docker.io/library/nginx:alpine-slim and it's only 5.46 MB
  121. blue cool
  122. blue phaleth: https://gitea.repopack.app/repopack/website
  123. blue can you check if this works for you locally?
  124. blue clone repo & npm install & npx primate
  125. blue this assumes you have podman running under your user
  126. phaleth yeah, I'll try
  127. blue if all goes well, localhost:6161/networks should show networks, localhost:6161/containers should show containers
  128. blue if you don't have any containers running, just try the command earlier that creates an echo server
  129. phaleth you could add all that usage instructions into a README
  130. blue I could, but this will be fast changing. you won't see the networks or containers like that, directly anymore
  131. phaleth I get Not Found error on both of those pages
  132. blue curl --silent --unix-socket "$XDG_RUNTIME_DIR/podman/podman.sock" http://d/v5.8.0/libpod/containers/json | jq
  133. blue does this work? (Your version might be different)
  134. phaleth nope, that curl call return nothing
  135. phaleth I guess I was supposed to enable the API
  136. blue curl --silent --unix-socket "$XDG_RUNTIME_DIR/podman/podman.sock" http://d/v1.0.0/libpod/info | jq
  137. blue what about this?
  138. blue yeah, I don't think your API is working
  139. blue 14:08 < blue> phaleth: systemctl --user enable --now podman.socket
  140. blue 14:08 < blue> check that it worked: `systemctl --user status podman.socket --no-pager`
  141. blue 14:09 < blue> should say `Active: active (listening)`
  142. phaleth yeah, you could add at least that to the README as that should not change
  143. phaleth ok, now I see the default network on the networks page
  144. phaleth and no containers on the containers page since I just installed podman
  145. blue yes
  146. blue very good
  147. phaleth yeah, but not very self explorable
  148. blue yes
  149. blue I'm experimenting as we speak, so I haven't got to document much yet
  150. blue the main question is if it reliably works for you, on another machine
  151. blue and we answered it now
  152. phaleth yup
  153. phaleth notice the shell changing here https://images4.imagebam.com/da/99/f3/ME1B56O7_o.png
  154. phaleth root -> non-root -> root -> non-root
  155. blue yes

Search posts