Can containers be started in any specific order, does it matter?

sfatula

Guru
Joined
Jul 5, 2022
Messages
608
So, I have a redis container and I have another app via docker that needs to use the redis container. So, will Truenas just handle this automagically, or, is there some order needing to be specified in some screen somewhere that the docker app should start only after the redis container starts?

Currently, seems to work fine but curious how startup works after a reboot, how does it know what to start when?
 

truecharts

Guru
Joined
Aug 19, 2021
Messages
788
It's very well possible to wait for dependencies in kubernetes, but that goes far byond the "Apps" GUI, as custom initcontainer have to be writhen.

This is one of the reasons why it's always prefered to use purpose-build Apps, instead of multiple apps stiched together.
 

sfatula

Guru
Joined
Jul 5, 2022
Messages
608
Purpose built apps are not always able to be used sadly though I agree is general. So, it sounds like the answer is no then as far as Scale GUI. Many docker apps are set up to be run as individual containers, not all in ones. Problem with purpose built is it's highly dependent on who's purpose. More complex apps have thousands of potential combinations and pieces.
 

truecharts

Guru
Joined
Aug 19, 2021
Messages
788
Purpose built apps are not always able to be used sadly though I agree is general. So, it sounds like the answer is no then as far as Scale GUI. Many docker apps are set up to be run as individual containers, not all in ones. Problem with purpose built is it's highly dependent on who's purpose. More complex apps have thousands of potential combinations and pieces.

Helm dependencies are used everywhere in the industry and we've not yet found a combination that could not be made into an App. In our opinion purpose build Apps are the solution, either made by us or the end-user.

If your application really needs this, you will need to build an application with initcontainer and make a scale-app from it.

Considering how initcontainers are quite complicated with multiple different kinds of dependencies, it's not likely that this would ever directly make it into the SCALE GUI, unless they allow for direct values.yaml additions/edits/
 

stavros-k

Patron
Joined
Dec 26, 2020
Messages
231
By purpose-buillt apps, @truecharts does not mean a single "image". But a helm chart, that deploys all those pieces. Which is in the end multiple images.

Similar to docker-compose files. But for k8s/k3s
 

gauthig

Cadet
Joined
Sep 10, 2022
Messages
5
I know this is an old thread but reviving it. Dependency, delay or sequence is really needed even with your supplied chart apps.
Example:
Influxdb must be started before grafana
But PiHole must be started before both of them unless you are hardcoding IP addresses (so 1991).
 

truecharts

Guru
Joined
Aug 19, 2021
Messages
788
I know this is an old thread but reviving it. Dependency, delay or sequence is really needed even with your supplied chart apps.
Example:
Influxdb must be started before grafana
But PiHole must be started before both of them unless you are hardcoding IP addresses (so 1991).

When building an app, delays for dependencies can be setup.
We do so for all dependencies.

It's not something that is iXsystems/TrueNAS specific.

---
However, in your example of pihole, you would be using internal kubernetes service DNS names for what you're trying to do, so wouldn't need to have a ways.
 

gauthig

Cadet
Joined
Sep 10, 2022
Messages
5
I'll take a look at setting up delays, is there a way to add an option to build out an init container which is the proper Kubernetes way to do this?
And yes, if all PODs/VM's where on 1 TrueNAS Scale server you are right, the internal kubernettes dns would resolve, but sadly, I have workloads not on the same host.
 

sfatula

Guru
Joined
Jul 5, 2022
Messages
608
I stop all apps and VMs on shutdown, and, start all apps and vms on startup via init/shutdown scripts and turenas middleware calls.
 
Top