LXD Container Web Management

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] so [Music] hello this is scott and welcome back to the channel today we want to talk about lexd container web management brian's awesome open source youtube channel focuses on installation and configuration of open source applications which he configures in docker frequently brian's featured portainer many times which is a web-based management interface for docker docker containers feature application virtualization on my channel i have a two-part series on lex d container vlans in a review of docker versus lexd lexd containers feature operating system virtualization so in review in my lexd tutorials we showed how the lexi command line can be used on a qnap nas in lieu of container station to manage lex d containers the lexi cli manages lexi containers which are much more lightweight and efficient than virtual machines virtual machines virtualize the hardware in the operating system and the os must be installed and boot up is slow lex d containers do not have an installation and are pretty much instant on access to the operating system so portainer is a web interface that manages docker containers only proxmox is a bare metal operating system to manage lexd and lexi containers and also virtual machines but it needs to be installed on a dedicated system lexd mosaic is a web-based interface that can manage lexi containers offered from multiple hosts so we're going to create a lexdi mosaic instance in a lexi container on a qnap nas and show how it is more functional than container station for managing lexi containers however this information is applicable to managing lexd containers on any host running a lxd server and does not require a qnap nas so how do i start well you're going to either need a qnap nas running container station or just an ubuntu instance with lexd configured lexi can be installed in ubuntu with the simple command sudo apt install lexd you're going to add a user to the lexd group for easy management so you don't have to have privilege and that would be sudo user mod and add my user if that's the name of your user to the lexi group and then you're going to set up and configure lexd with the pseudo lexi init command so initializing your ubuntu bare metal or vm with lexis out of scope and that init command is covered in some of my other videos and there's also lots of great information online so we're going to learn how to create a lxd container connected to your untagged vlan to host lexi mosaic in my previous videos we talked about how to connect to a tagged vlan so both docker and lexd create containers on a private nat by default in previous lexi tutorials we showed how to create a lxd container on those tagged vlans as i mentioned so we're going to create a lxd container on your untagged vlan and the assumption is that you're on a qnap nas with container station installed which means lex d is configured or that you're on a machine with lexd installed already so our lexi mosaic management interface is actually going to be a lxd container and it's really a web interface is what it is so the steps to do that are you find the interface for your untagged vlan you add a lxd profile to point to the untagged vlan you launch an ubuntu 2004 focal fossa container to host lexd mosaic you connect to a boss shell prompt on the new container you download the lexd mosaic script we're going to make the script executable and then we're going to run the script to install lexd mosaic and finally we're going to configure the product through the web interface and we'll briefly go through some of the commands okay so here we are at a terminal and i'm going to ssh into one of my nasas and i'm going to quit to the shell environment and i now have a shell prompt i'm going to do an ip route show and you can see here they these are all of my interfaces i have a lot of interfaces on my qnap nas because first of all it has four nic interfaces on the back of it and then secondarily i also have some vlans defined but this interface right here that's denoted as qvs1 is actually my untagged vlan and one of the ways that i can tell that is because it has an address on the untagged vlan which is the 17216 i could also use this qbs0 interface above but this one works fine for what i want to do okay so the first step that now that i've done the ip route show and i see that my device is called qvs1 that i'm going to connect to i'm going to go ahead and create a lexi profile called untagged so i do alexi profile create untagged and then i can say configure that profile with the lexi profile device add untagged ethernet 0 which is the name of the interface within a lxd container and then i have a nick nick type equals mac vlan parent equals qvs1 so what that does is that is the command to connect to an untagged vlan if i do the command lexi profile show untagged we can see that untagged profile and that's what it looks like so now that i've got that set up i'm going to go ahead and create a container with a command that doesn't fit on the screen very well but i will go ahead and show it on an overlay it's creating the container downloading the container unpacking the container and executing the container okay so now i have an ubuntu container next thing i'm going to do is i'm going to open a box shell on that container and now i'm in the container itself so now that i'm in the container i am going to download the lxd mosaic script with this crawl command by the way i'll put all the commands in the show notes now we have the script for the installation of mosaic downloaded and now i'm going to set that script to be executable because that's a requirement so i use a chamod to set it to executable and now i'm going to run the script and there we are dot slash install lexi mosaic so this is going to run for a little while okay and now with the magic of video we are at the end of the installation you'll notice here that it highlights um the address that your web server for lexi mosaic is running at and in this case this is an address on my untagged vlan so now what we want to do is we want to exit the shell and then it's going to be important to do a lexi config set core dot http s under bar address to left bracket colon right bracket and that is in order to be able to provide access to the lexd server that is running on the qnap or running on your ubuntu machine and then what we want to do is we want to do a lexi config set core dot trust password and we're going to enter some type of a password and i've already done that prior to this so i'm all set at this point in time if we go back to the container station you can see that there is a lexi node that's running right here and my advice is the address for this thing which we saw was 172.16.1 dot in my particular case is a dhcp address i recommend you set that to a dhcp address reservation so that way you will be able to get to it every time between reboots and it won't change addresses on you so anyway i hit advanced on my web browser and i say proceed to this address and then it wants me to put in the address of my of my nas that i want to manage and you can actually add more than one host here but in this particular case it's just the address of whatever's running lexi it could be your desktop machine whatever it is and we've entered those let's see the last two let's see config commands you saw so this right here is the password for that host that we entered in and so i'm typing that and then you can put an alias in here in this case i'm going to put an alias in for vms fog and the reason i'm going to use that is that's the name of that particular nas and then over here for users you go ahead and uh for the admin you can add other user accounts but for the admin then you want to enter a password and i'm entering a password for that and then you should be able to say launch lex d mosaic then you get a username prompt at that point since i left it at admin i'm typing in my admin i'm typing in my password and i'm clicking sign in and this is the interface that you get so you can see in the left margin that vms fog the alias we put in here is listed if i click on vms fog you can see that bms fog has the container lex d mosaic and also netboot xyz so let's go back to the qnap here and you can see netboot xyz is a lxd container and lex d mosaic is a lxd container we're not seeing any of the lexi containers but those are going to be obsoleted before the end of the year or maybe slightly past the end of the year by qnap and so we want all of our new containers to be lex d containers and that's what lex d mosaic manages so at this point in time we can look at a lot of different things we can certainly we can certainly click over here and close up that or open that entry there and you can see lex d mosaic over here and you can see netboot xyz and i can actually click on the little ubuntu logo and it will give me instance details so i can see that it's running ubuntu 2004 because that's what we built the container with and i can see the network information in my case it was assigned a ipv4 and an ipv6 address matter of fact if we go back to the terminal prompt and we do a lexi list you will see that netboot xyz is out here and it's running on an internal uh it's running on an internal network uh 10.0 network but when we put the lexi mosaic on the untagged vlan there it is and since the untagged vlan also supports ipv6 there's the ipv6 address so that's really fantastic so now you can see memory usage and you can see other sorts of things you can see that there's two profiles here that are used to build this container default and untagged and then you can take snapshots of the container and you can set limits so here we are at the main dashboard for lexi mosaic and here you can see that lexi mosaic and boot netboot dash xyz is running here on this particular lxd node which is vms fog now let's see what it takes to create a new container well i go up here to create a container and i'm going to go ahead and give my container a name of test dash lex d dash tutorial and then the profiles i'm going to want are first of all default i start by typing def and i'm going to want the untagged profile also so i can have this on the untagged vlan and then my only host right now is vms fog so i'm going to start typing bms and there i create this thing on vms fog and then i want this thing to be an ubuntu container and i'm going to go ahead and create a vocal container so i'll click the first one and then i'm going to have some optional settings that i'm going to need to configure first of all i'm going to say boot dash auto start or boot.autostart is going to be set to true we want the container to automatically start when lex d starts the next one that i'm going to put in here is oh let's see we have to do security.privileged and we have to set it equal to true because on a qnap nas container station if you start a lxd container and you haven't set the privilege for to be a privileged container it will not start for whatever reason and then i'm going to go down here and i am going to say set limits dot memory to 2048 now let's say let's make it 4096 megabytes and then i'm going to look for limits.cpu allowance and i'm going to say you can have up to 15 of the host cpu so there you go i'm going to say create and start it's going to think for a while and with some luck we're going to end up with a container running here and hopefully it'll update here in a second and you'll be able to see that the new container is running now here it is over here so that's interesting all right so there you go we have a test dash lexi dash tutorial now let's look at that from the container station side here's the container station side and there you can see that i have test dash lex d dash tutorial if we go into it and we say settings you can see it set to auto start you can see that it has 4096 megabytes of memory like i configured and up to 15 of the cpu if we go into advanced and you go into device you can see that it has run containers in privilege mode and that's what the switch is that says security dot privileged equals true and then the network shows up blank the reason is is because the lex d in container station is somewhat limited as we talked about in my previous videos so going back to the lexi interface there you go you have your machine so you can actually look at that particular machine see its resources and what it's doing you can see that it has the default and untagged profile you can see that has 15 percent of the cpu and up to 4096 megabytes of memory that it can use and you can see what its address of this particular machine is again it got it via dhcp if you wanted to get the same address every time go to your network and create a dhcp address reservation but for now it's 172.16.1.211 because that's my untag vlan and then you can see that it has a link local address for uh for ipv6 and it has an ipv ipv6 global address also and then it has a uh anycast address which is what you expect for ipv6 and then you can also click on the console and by default it will enter the boss shell i can say go and i can do things like i don't know apt install net dash tools just like any other console so instead of ssh in 2d i can do this here i can clear off this console i can do an if config from that command and there you can see the the uh network settings could also do something like an apt install neofetch okay now that neo fetch is installed we're gonna do a neo fetch command and there you go so it's reporting um that the uptime is three days and 50 minutes that's the uptime of the host itself not the uptime of the container it's calling out the kernel as linux kernel 5.10.60 and it has a suffix of qnap just to let you know i'm running on a qnap and the os for this particular container is 20.04.3 lts and it says it it actually reports the total amount of memory on the nas but we have memory limits on the container that says that it can only use 4096 megabytes and then the host machine actually is an amd ryzen 7 and it will report through to that remember that a lxd kernel or a a lex d container actually uses the kernel of the host operating system okay so now we can go back to details and by clicking details here again we can see all the details we also have backups we can schedule backups for this container and we can also look at files and it will show you files in any particular part of the container itself and you can go navigate to those and then you can also turn on metrics for these things so for example if we came back here to the top level we can enable metrics on any of these containers and it will gather metrics if you want and then i'll be able to display those so that's pretty neat the other thing we have is the ability to add other other container hosts besides vms fog and i'm not going to do that in this video but it's pretty intuitive you can add other container hosts and so you can have lex d containers on one host and another host and so on down the line now to delete a container you can simply bring up that particular container and so we're in lexd we're in test lex d tutorial if we go back to container station you can see in the overview that we have test lexi tutorial if we go back to lex d mosaic and we click on the trash can it will not do anything initially because it's going to require you to stop it so we stopped the instance now over here it tells us the instance is stopping now that the instance is stopped i can delete the instance and it says are you sure you want to delete this instance well we won't delete it yet we'll go back to bms fog and we can say see that the gray block here indicates that instance is stopped if we go back to lex d mosaic and say delete this instance it'll go ahead and delete the instance should go away here in a minute with any luck go back on the bms fog side it is gone there so on the mosaic side probably need to click on bms fog and [Music] then click away and click back and it goes away it looks like the web interface for right now doesn't update but this thing lex d mosaic is in constant development matter of fact i noticed that the last seven days that it received a new version um anyway this is a really nice addition to managing lexi containers and it has a lot of other features it's way more functional than what you have through container station and it's it's nice to sometimes have a gooey way to look at things overall via a web instance as opposed to having to do everything from alex c command line so in summary we learned how to install lexd mosaic to provide a web interface to manage containers lexi mosaic is to lexi containers what portainer is to docker containers meaning a web interface and lex d mosaic can manage containers on multiple lexi servers just like portainer can manage multiple docker servers and lexd has powerful features not found in qnap container station and it's easier to use than the lexi command line so lex d containers are my first choice for self hosting because they're lightweight operating system instances that can be easily modified and they can be upgraded unlike docker containers which basically have to be replaced anyway thanks for stopping by today and please subscribe and like to the channel and we'll see you next time [Music] [Applause] [Music] you
Info
Channel: Scotti-BYTE Enterprise Consulting Services
Views: 99
Rating: undefined out of 5
Keywords:
Id: 6bJbkF8e60s
Channel Id: undefined
Length: 28min 5sec (1685 seconds)
Published: Thu Nov 18 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.