 Hello. Welcome everyone to our next session. The next presenter is coming from the USA where he works at the project Atomic and we'll have a live demo on how to build your cluster and deploy applications in 10 minutes. So thanks, Josh Berkus, and we can get started. Hi. I don't like slides, so there will be no slides. This is an old demo talk. It's in fact a live demo talk. Here I've got a little set of AWS instances, a master and three nodes, and we're going to be turning those into Kubernetes cluster. So let's get started. So we're running Atomic host on these four nodes. Now particularly what we're actually running is CentOS Atomic host continuous, which is right here. And so this is the development version that a lot of the developers use upstream in order to actually test out new things. The reason why we're actually using continuous for this is that we need a version that doesn't have any Kubernetes bits already installed because I'm going to be showing you an alternate way to install Kubernetes as opposed to the release versions of CentOS and Fedora Atomic host which do have bits of Kubernetes installed which would conflict. So we're using continuous here. There's a bit on the atomic blog about how to switch to continuous if you actually want to try it out. In the future, Kubernetes will be fully containerized and there won't be any bits installed on the release versions. So then the other thing that we're going to be doing here is we're going to be adding what we call layering to the atomic host. This is our way of installing stuff on the individual host in a way that doesn't break atomic update. So the first part of doing that layering is that we actually need to have a configuration file that tells it where to find the packages for layering which is going to be your regular configuration file. So here I've got a configuration file for the COPR that Jason Brooks put together for our slightly altered versions of the CUBE ADM tools for installing Kubernetes. We had to alter them slightly in order to get them to work smoothly on atomic. We're looking at pushing those changes upstream. But for now this is the repository you would install. And then having added that repository it's time to actually do some layering. So we need a few pieces for this. So we need Kubelet which runs Kubernetes locally. We need CUBE ADM which is this quick installation tool from the Kubernetes project. We need a network thing for Kubernetes in this case CNI. And then we also want the administrative interface here. So we're going to go ahead and install those. And so what this will do is it will take those RPM packages and then build an OS tree layer based on those packages which will be installed locally. Like I said people are like oh well aren't you just installing RPMs on atomic? That wasn't the point of atomic. Well the answer is no we're installing a layer so it means that for example if I install these and I decide that they're broken I can just atomically roll back to the base image. And for that matter I can also continue to update the base image from the upstream OS tree without necessarily breaking the layer that I've added for the local install stuff. So again these are all the advantages of the atomic and the RPM OS tree based on things. It's just a much more reliable maintainable way to install things. So that will take just a minute to install it's got to actually download some of the stuff. The question was if I was to run that again and add some more packages does it make another layer or does it add to that layer? And the answer is it adds to that layer. So the additional packages would be added to the same layer. There may be some way to create a second layer but I don't actually know it. The person who would know that is sitting back there in the fifth row right there. But if you just do what you would regularly do it adds to the same layer. So there we go. Now like other install update operations atomic we're going to have to restart this which means it will kick me out and I'll have to actually log back in in just a second. And then we can start to set up Kubernetes to take a few minutes. Yes? Yes the question was we used RPM OS tree to download the packages from a regular RPM repository and the answer is yes. Now not all RPMs that are out there will install this way because some of them install to say the opt file system which is forbidden under under atomic. But packages that don't violate they do not install to these locations will install this way. Now the other limitation on this is we can't install any packages that conflict with packages that already exist in the base of history. So like I said this is the reason I did this on continuous because if I did this and say fedora atomic it already has coop CTL installed and so installing a different version of coop CTL would conflict. So now if we look at the RPM OS tree status we now see that we've got a second version of continuous and the second version of continuous has a set of packages in it. So it's telling us what's this layer that we've created locally in order to install these extra packages. So now what I want to do is actually want to build Kubernetes using this kubadm. So the first thing is I need to start up the local kubelet demon so there's something to receive instructions. So and then I'm now going to use so now we're going to do this. So this is kubadm. So kubadm is the kubernetes project the answer to people want an install that just works for the common case of installing kubernetes. You know when you're installing a simple cluster that's not federated that doesn't have special requirements that you know that sort of thing and then if you have special requirements you can add those in by changing configuration later. Right now it's an alpha it's going to go to beta when kubernetes 1.6 gets released with the target of being sort of fully functional by 1.7. So right now it's something to play with in development and not necessarily something to use for production deploys. Now it's going to actually do a whole bunch of things here. You notice it's generating much certificates is generating a whole pki setup in order to do encrypted communication with the other nodes. It's creating a bunch of local configurations. Now I did there this is the normal is kubadm in it. There's a set of checks that check for problems in your system that would prevent it from installing. One of the things that cropped up this last week I said this is all alpha stuff is that I'm getting a false positive violation on a kernel module that I filed as an issue but hasn't been resolved yet. So in the meantime I need to skip the checks or will refuse to launch. So it'll wait here for just a minute because it's waiting to bring up all of the portions of Kubernetes except for the kubelet in containers which will take just a second. A long enough for me to take one question about kubadm. Does anyone have a question? Yes. Okay can you speak up just a little bit? Okay so the question is would it be possible to do the same thing with the pre-installed Kubernetes? Not the one that's available in atomic right now and our plan is to actually move towards a fully containerized install of all of this so we're unlikely to ever enable it in the pre-installed version because it'll all come in through system containers instead. Okay so now you went ahead and installed the clients and the API server and that sort of thing and now we are done we are installed on the master. No we're not actually quite done on the master. Hold on the syntax is a little annoying so okay we're not quite done in the master. I need to do a couple of tweaks by default it doesn't run any containers on the master just on the nodes and so I actually need to fix that and the other thing I need to do is I need to actually give it an internal Kubernetes network. Let's not type of this. So that's going to go ahead and install a network and network can be used for DNS and that sort of thing. So if I actually look at this we can see the stuff coming up all of our other things so these are all running containers we've got the API server and the controller and discovery and proxies and the scheduler and right now it's creating the network and once it creates the network then we can have DNS. Now while we're waiting for it to do that let's go ahead and log into one of the nodes because we need to set up the node in order to have a cluster right? So we're going to have to do the same thing we're going to have to install a layer on the node and it's going to go ahead and install that so let's see how we're doing on creating a network. Oh okay so the network's created and now it's working on creating DNS. Okay so let's take one more question while we're waiting for that to download. Anyone have a question? Got what I'm doing here yeah? Yeah so the question was to compare a QBDM to Ansible Deployments and the answer is that right now if you want to sort of production Kubernetes cluster I would use the Kubernetes Ansible because like I said QBDM is alpha and there's a bunch of stuff it doesn't do yet. The the the truth is in the future like I'm actually showing you the manual version of this but obviously I wouldn't do this manually. What would happen is that I would just use QBDM to replace some of the parts of the Ansible install and to make things less less to make the Ansible script less complicated. Okay so that is going and in the meantime we have DNS so the master is completely ready to be a master at this point. Okay I got kicked off there so let's log into another node. Now in this node in this node I actually went ahead and added in the layer already. I just realized I need to grab something here. So we need this. Okay first we need to start it. Okay so you can see here we already have that second node joining and I'll add the other node as soon as it reboots and I can log into it. Okay it's being a little slow which is why I have another node. Okay and now we have two nodes so we can go ahead and deploy an application and you know the guest book application because we love the guest book application in atomic land. So there we go we're going ahead it's that spinning up so it'll take a second to download the containers. Hopefully they will download before I run out of time. Let me take one more question while we're downloading containers. Anybody have a question? Okay so question is where am I downloading the containers from? It depends on which containers you're talking about. So the containers that run kubidmin and kubernetes and that sort of thing they're based on the kubernetes project containers which Jason Brooks modified and created a COPR of so we're actually downloading them from Fedora. The and the other containers the guest book containers those actually I think are on GCR because it's a standard kubernetes example but I mean you can obviously install the application from anywhere and now that we have we don't have a lot of containers available in the Fedora repository right now but we will in the future and of course we could really use community people to create new containerized applications for that. I may not get to show you the screen because we're still downloading containers for some reason. Okay so a couple other things just to finish up. So information about kubaADM is on the kubernetes guide on the project atomic blog we have information about layering an RPMO is tree. The if you you know there's the issues on on that if you actually wanted to see the best way to follow this in your own is to actually look at my Ansible script for doing this which I'll also continue updating as we make fixes and that sort of thing to this deployment option and that's in my Misk Ansible repository. Let's see is this come up yet? It has not come up yet. Are we out of time? We got one minute so we've got one minute we will see if the containers download before. Oh wait try k-node 2 here. Yay! Okay thank you I'm happy to take other questions after the session but we need to let the next speaker set up and I have stickers. Thanks.