I am installing some apps (elasticsearch, redis, postgresql) through the applications catalog and realized postgresql is not among the available apps. Even mysql is not available.
Now I am curious if I can add somehow my own postgresql chart in order to have it working (single postgres, no master-slave nor ha installation).
There is anything I should care of? (storageclass, etc…)
Most of those more basic apps people will deploy as a docker container. There is a launch Docker button in the UI which lets you run a simple mysql or postgres container. Many of the apps leverage those databases built-into their chart, but they each get their own instance.
I have bunch of k8s clusters and I want to reuse most of what I already have.
Would be great install postgres and use persistent storage instead running an ephemeral container.
btw, if there is any way to use persistent storage with docker containers in truenas I would like to learn how. you never know when it can be handy.
Which complexity you mean?
I am not sure how it is supposed to be installed using docker-compose alone because the persistent volumes.
Using helm/kubernetes the storage volumes are going (at least I hope it) to be provisioned from the available space in the dataset in form of another volume/share/truenas-name-for-storageunits. That will protect the databse from loosing the data if the container/service has any outage or simply the container is removed.
I am not sure how to archieve that with simple docker-compose in Truenas scale.
That’s what ix-volumes and host volumes provide for Apps / Docker… That is your persistent location for storage in case you remove the app, restart it, etc. Those are stored on your ZFS pool by default and can be backed up or otherwise interfaced with.
Oh. I am a bit confused.
I have tried to install the cloudnative postgres chart and it fails, so I am thiinking to simplify as you adviced.
Would you mind to share a docker-compose for pg/any persisted workload so I can see how the persistance is handled?
Is in truenas possible stop/delete a container and still keep the persisted data as an accesible volume? How? (I have seen DOCKER_HOST=tcp://10.0.10.50:2376 is not working)
Docker compose is very much on our road-map. We’re currently working hard on it internally. Expecting to make some noise about when that will land in the product soon. In the meantime the Sandboxes/Jails can be used if you want to run a native Docker / Compose environment.
Absolutely. KISS should be always the way, but in order to keep portability is a principle that sometimes is hard to follow.
Just ran the first container for fun and just realized you have daemon.json bridge=none, and “none” network with null driver.
Guess it is on purpose, but then how it is expected for the containers to reach external world, be it for outgoing, or be it for incoming traffic?
I don’t want to mess manually with the config without knowing if there is a good reason or and specific way to do it.
Not sure where you ran into that, by default all containers have full outbound internet access. They have inbound via port forwarding, or you can click buttons in the UI to enable host-based networking. Maybe you are looking at an old docker config? It uses containerd in the background by default, but you should be using the UI to drive it.
Again, we don’t normally support running those things from shell. If you want to administrate it like you would on a generic Linux box, you’ll want to spin up the nspawn container, just deploy a minimal debian instance to mess about.
I didn’t know about nswpan, it is a nice new trick to have in the toolbox, but I think I will go towards having a light VM and setup it as a k8s node of my external cluster (right the other way around I wanted to do, but will be ok too).
Thank you Kris for all the information, it has been a fun afternoon messing with this side of TrueNAS.