Docker-within-Scale Questions

indivision

Guru
Joined
Jan 4, 2013
Messages
806
I'm trying to get as far as I can troubleshooting and learning about docker use from those platforms documentation. But, I'm a bit stuck due to not knowing how it is implemented within Scale.

For example, many available documents refer to using "kubectl" commands. But, within Scale, the command doesn't seem available in the main shell or within app shells. Is it possible to access that command? Or, is there an equivalent available and I'm using the wrong command?

I have an app installed as "ClusterIP" for networking. However, I'm not really sure how to access it. When creating the app (qbittorrent) it lists the port to be exposed for the UI. But, that port doesn't seem to work. I haven't tried it yet. But, I can likely get NodeIP to work. But, since ClusterIP is the default with docker, I'm wanting to figure out how to work with that config.

Any help would be appreciated.
 

impovich

Explorer
Joined
May 12, 2021
Messages
72
If you want to use kubectl within TrueNas shell use k3s kubectl + command. Also, you can add alias kubectl="k3s kubectl" in order not to use k3s every time.
Within the app shell, there is no k3s or docker as it is inside of a container itself.
 
Last edited:

indivision

Guru
Joined
Jan 4, 2013
Messages
806
If you want to use kubectl within TrueNas shell use k3s kubectl + command. Also, you can add alias kubectl="k3s kubectl" in order not to use k3s every time.
Within the app shell, there is no k3s or docker as it is inside of a container itself.

Great. Thank you!
 

impovich

Explorer
Joined
May 12, 2021
Messages
72
here is the exact command for alias


alias kubectl="k3s kubectl"
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
 

indivision

Guru
Joined
Jan 4, 2013
Messages
806
Got it. That is helpful.

I was able to determine that I just need to select "Enable Host Network". Then it indicates the used port in the GUI.

If I don't select that, is there some other way to reach the app via the local network?
 

impovich

Explorer
Joined
May 12, 2021
Messages
72
Don't do the same mistake i did, don't use hostnetwork as it brings some complexity. Use nodeport and map an app port to whatever port higher than 9000, then access your app via nas_ip:mapped_port
 

indivision

Guru
Joined
Jan 4, 2013
Messages
806
Don't do the same mistake i did, don't use hostnetwork as it brings some complexity. Use nodeport and map an app port to whatever port higher than 9000, then access your app via nas_ip:mapped_port

Ok. So I should not select "Enable Host Network"?

If do enable it I am able to reach the app with, for example: nas_ip:8080 for qbittorrent.

When you say "map an app port to" are you saying to set up forwarding in the router? If so, what address do I route the new port to?
 

impovich

Explorer
Joined
May 12, 2021
Messages
72
Yes, you should not. No, there is nothing to do with the router. HostNetwork is unchecked, service type - nodePort, port type HTTP or TCP, Target port is the real port of an application let's say 80, Node Port let's say is 36093 for the main port of qBitTorrent. Your app should be here nas_ip:36093

I would not deploy anything until the BETA is released, there might be some breaking changes. Personally decided to wait and rolled back from a nightly build to ALPHA.
 
Last edited:

indivision

Guru
Joined
Jan 4, 2013
Messages
806
Yes, you should not. No, there is nothing to do with the router. HostNetwork is unchecked, service type - nodePort, port type HTTP or TCP, Target port is the real port of an application let's say 80, Node Port let's say 36093 for the main port of qBitTorrent. Your app should be here nas_ip:36093

Ah. Ok. Thank you. So, basically, you are saying to not use "ClusterIP" even though that is the default.

I would not deploy anything until the BETA is released, there might be some breaking changes. Personally decided to wait and rolled back from nightly build to ALPHA.

I am also using Alpha. Just testing at this point so I can learn and be ready to deploy with Beta.
 

impovich

Explorer
Joined
May 12, 2021
Messages
72
ClusterIP - can't say anything about it yet:)
Not sure that apps are working on ALPHA with the latest TrueCharts release, at least they don't support nighties anymore. I deployed a few custom docker containers - those are fine for now. But anyway the best strategy is to wait in order not to be confused by some bugs or anything else:)
 

indivision

Guru
Joined
Jan 4, 2013
Messages
806
I assume there is no Rancher URL/GUI?

There is a GUI. Not Rancher though. I imagine the general flow of the install GUI has to be similar.
 

stavros-k

Patron
Joined
Dec 26, 2020
Messages
231
Ah. Ok. Thank you. So, basically, you are saying to not use "ClusterIP" even though that is the default.



I am also using Alpha. Just testing at this point so I can learn and be ready to deploy with Beta.
Hello, you are probably using an old catalog which at the time ClusterIP was the default.
ClusterIP needs ingress (like reverse proxy) to be able to access it, but because most beginners want to start slowly and go up from there or only use app internally without messing with ingress we changed to NodePort as default


Also in case you need support for TrueCharts again in the future you can try using our discord -> https://truecharts.org/discord
The new catalog is here -> https://github.com/truecharts/catalog
Add this catalog as mentioned here -> https://truecharts.org/manual/adding-truecharts/

Please note that from 21.06 Release and forward we will stop supporting nightlies.
Also if you are on 21.04 right now, our new catalog is not compatible, so it will be best to wait a week where the 21.06 will be release.
 

indivision

Guru
Joined
Jan 4, 2013
Messages
806
Hello, you are probably using an old catalog which at the time ClusterIP was the default.
ClusterIP needs ingress (like reverse proxy) to be able to access it, but because most beginners want to start slowly and go up from there or only use app internally without messing with ingress we changed to NodePort as default


Also in case you need support for TrueCharts again in the future you can try using our discord -> https://truecharts.org/discord
The new catalog is here -> https://github.com/truecharts/catalog
Add this catalog as mentioned here -> https://truecharts.org/manual/adding-truecharts/

Please note that from 21.06 Release and forward we will stop supporting nightlies.
Also if you are on 21.04 right now, our new catalog is not compatible, so it will be best to wait a week where the 21.06 will be release.

Thank you. This is really helpful. You guys ought to have a sticky thread in this forum with this info.
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
Thank you. This is really helpful. You guys ought to have a sticky thread in this forum with this info.
We actually do have a thread and a community resource here, that forwards to our website for said information.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Quick note: k3s is a stripped-down version of Kubernetes (k8s). TrueNAS SCALE currently uses the docker backend for k3s, and, this is not guaranteed. Relying on k3s within TrueNAS SCALE is future-proof; relying on docker/docker-compose is not. I see you really asked about k3s and kubectl, I just wanted to put this here for people who have existing docker-compose "stacks" and want to run them on SCALE. You can, right now, but for longevity, it's best to go for Helm charts and be independent of whatever the backend is. If SCALE ever moves to CRI-O, or "whatever", docker/docker-compose would break, but k3s will continue to work regardless.
 

indivision

Guru
Joined
Jan 4, 2013
Messages
806
We actually do have a thread and a community resource here, that forwards to our website for said information.

I think it should be a sticky.

I've been searching related topics for about a week and haven't seen it.
 

indivision

Guru
Joined
Jan 4, 2013
Messages
806
It's on right on the home screen of the forum, under resources...
It's actually the top resource for a while now ;-)

Thank you. I typically just look/search in the forum until/unless someone links to a page in resources.
 
Top