 All right Hello everyone this talk will be primarily about space and rockets and incidentally about how you can use both cloud Foundry and Kubernetes to deploy your microservices So who are we? I'm Giorgi and I'm working at SAP and this is juice or you might know him as her juice and He's an IBM and was the common thing between us is that we're both working on the any project Which makes us proud in years or any notes if that's your thing This talk will be in three parts first. We'll talk about why is it important? Why should you care about all this and Then we'll talk about what new possibilities this we have in front of us And at the end we'll get our hands dirty doing some interesting things for real but first let's talk about rockets and Probably the first thing that comes into your mind when we talk about rockets in a software context is of course Startups right that's pretty hot topic nowadays And but actually what are some of the most important things for a startup to succeed? That's obviously a loaded question because there are many things to consider like having a clear future Having a clear vision of the future of your company having a competent team Funding marketing and many many many more, but they would like to Just talk about one thing and this is speed in other words Striving to minimize the time to market it for your product and this is the limit the length of time It takes from a product being conceived until it's being available for sale. And here's the thing. It doesn't matter how Great or innovative your product is if you cannot get it to market before your competition does Innovation in speed go hand-in-hand if you and if you cannot master the latter Then your rivals will be racing ahead with new digital marketing products so then the question is how do we get to market before our competition does and Of course here. There are many answers. There are many possible answers but one of the key ones is by choosing the right technology and It's important to separate which technology will help you in the growth of your business from these that will just eventually end up being another toy in the toolbox and You should always try to choose a technology that lets you focus on your core business Not on the technology itself and when it comes to choosing There are two main considerations in this case you have simplicity which is provides great stuff like fast development and have Flexibility which is all about giving you the chances the options the free the freedom to do whatever you want to do and Usually the choice goes like this you choose simplicity or flexibility or you choose flexibility But then you have a lot of complexity to do it And you probably know where we're going with this because there's a pretty obvious example that can be given here and As we all know Cloud Foundry stands for this simplicity for this great user experience in this fast development And Kubernetes has a lot more flexibility, but then there's a lot of complexity to deal with all the times So the next possible the next logical question I guess just which one should you choose which technology is better and This is not a talk that aims to provide an answer to the versus question But how about an idea why don't we instead dictate the two rocks together and that way We can just use the combined power of both and we can race ahead of everyone else And that is of course you can maintain both of them efficiently at the same time And if you're able to make them stay on the same course But can't we do better than that Jules? Yes, we can do better definitely I think we can do better with this amazing spaceship that has ducked like both other rockets like Kubernetes and Cloud Foundry and has some additional power and the spaceship was built by two projects in the Cloud Foundry foundation it's Two incubating projects one is CF containerization, which is basically containerizing all the Cloud Foundry Control plane to containers and you can now use sound charts deployed on top of your Kubernetes and the other project is Irini which makes now your Contain orchestrator swappable with Kubernetes and now you can deploy all your Cloud Foundry applications as native Kubernetes of objects and that brings really good benefits Like the first thing is you have one technology stack So it's one technology stack you have to care of you need to operate you have one set of tooling You don't need to operate Bosch anymore in Diego everything is Kubernetes and You can run on every cloud you can start from digital ocean IBM cloud provides Kubernetes even Amazon provides Kubernetes so you can deploy Cloud Foundry everywhere and it's really an important thing as a startup so but the most important thing here is that The that you have a Kubernetes native implementation of Cloud Foundry and you have this native Kubernetes objects, so all your Cloud Foundry apps are native Kubernetes objects and now this brings like really new opportunities like you can see a push your application To the Kubernetes cluster and you can still use coop CTL to directly interact with your Kubernetes cluster And push also apps that way and they all end up in the same network and they can say hello to each other They can reach each other Which is really cool So we prepared an application Which is called feed Delphia. It's a photo feed kind of thing like Instagram where I can upload photos and Yeah, we'll like quickly demonstrate that let's go to the Browser, which is here. So this is how it's looking like Let me just make this a little bit bigger Alright, so we already uploaded some photos from the conference from Philly and from our team dinner yesterday and What you can do is like you basically press here on upload photo. You can choose some photo that you want to upload You give it a title like Sonnet an author who uploaded the picture. So that's myself And I don't have like so we need to refresh the page basically And there we go. The picture is there. So this is what we are going to deploy today and But how does the microservice like just something that Georgie will tell you So as you said, we deployed this up as a set of microservices In fact, we have three components. We have a web user interface back-end API and the database that stores our images and the first two components the user interface the API a pretty standard So we can just see if pushed in with cloud foundry, but for the database we chose to deploy directly by Kubernetes and Evaluate use case for that would be for example, if you want to use a if have a requirement to use a custom Implementation of your data store that would be probably better provided as an independent container deployable Kubernetes And also our app spans multiple namespaces and since we're using a Rini Rini currently deploys to just once name space that's why the first two apps end up on the same place and As far as the database concerned we can deploy to whatever we want in this case we just create some new namespace just for separation reasons and for communication the web user interface and the API communicate through HTTP and the API connects to the database through a TCP port and this default is reported the my SQL database, which is what we use and This is something that it's not usually done with just vanilla cloud foundry applications So let's actually start doing stuff for real All right, let's get our hands actually dirty So Just quickly Go to the terminal and first like explain the setup So on the left side, you see we'll see everything that we do with cloud foundry And on the right side of the terminal you will see everything that we do with Coup CTL in the upper left pane you will see the I watch on CF apps and On the other side you will see the reflection on Kubernetes like you see what's going on at the back end and you will see the apps appearing in the In the club cluster. So this basically I watch on Coup CTL pots in the ring name space and we already pre-installed the web interface and you can actually see that the application is Here's the like the CF representation and on the right side. There is the Kubernetes representation of that app. So let's open this Feet oh, it's ready to open perfect. So but it should be the same. Yeah, so it's basically empty and this is exactly what we Expect because we don't have any backend yet, right? And if we inspect this Frontend and Let's go to the console We'll see. Yeah status 404 not found Because we try to connect to the feed API which is not deployed yet. And of course, it cannot get anything great So what we want to do is we want to deploy the API. So let's we are here in actually the Philadelphia repository It's available on github. Everything is like well documented and we'll also I'll tell you link at the end and You can try it yourself to deploy it actually afterwards so Yeah, in the Philadelphia, we have the API directory and This is just an go application And we have a manifest there and we can just see I push And it will deploy it and while this is deploying, you know all the CF push procedure, I guess we can take a quick look at Coup Ctl get pods in The SCF namespace this is Yo, yeah, thanks In the SCF namespace, this is where all cloud foundry is deployed including Irini and the bit service It takes a little bit longer today probably because Our cluster is in London and we are far away from there. Who knows? So There it is great as said This is what you would see when you call Bosch VMs But you see also a bit service here and Irini the bit service is actually the master of the blobs and it has on Docker registry API that provides you a like just the pull part of a Docker registry and It actually so Irini tells Kubernetes actually where it can pull steam the image from and this is Then provided by the bit service. So It gives you basically the OCI representation of your droplets Great. So the staging is done and the app failed. Oh my god So I'm pretty sure you know why it's failing. I don't so I want to debug and see what's going on So let's take a look at the logs of this app feed ABI recent logs cool So I should get some logs Ha, so red lines. This is always like a Good sign that something failed Index out of range and the main main go 52. So let's take a look what's going on there May go 52 boom Alright, so yeah, we use here an array and we want to access the zero index and it seems like this array is empty and It's on the object we cap and we kept his we kept services And we kept services users user provided. So, yeah, of course, we want to bind our API to the database that is not existing yet, right? So, of course It should be like an empty Object in the application. So because nothing is provided by the we kept services So let's take a look at The application that is failing which is feed API you can perfectly see Here using the name and of course that just two apps and one is crashing. So we know which one it is Let's quickly use coupe CTL to describe it Describe pot this one in the namespace Irini Let's see what's going on there Let's make that bigger And let's actually see what's going on there. So cool namespace Irini. This is my app here's some labels some information like the GUID and I'm interested in the environment variables because of the we kept services Is it there So we kept application and Ah here, huh? So it's empty as expected. So I think we need to fix that Georgie You're the database master. So could you deploy the database part, please? say so We need to install a database in Kubernetes and in this case, we'll just install a standard mysql and Probably the easiest way to do that in Kubernetes is by using Helm and Helm is just a packet manager for Kubernetes. It manages packages of pre-configured Kubernetes resources that are called charts and we can also also search for charts and in this case We're just interesting in mysql and we see that we have a lot of options But the one we want to use is the first one, which is a classic mysql So how to install it? We have a script here and all this script is doing is just calling one command This is Helm install and that command Has the name of the chart that we want to install and has some information like for example What will be the name of the deployment in our cluster in which namespace we want to install it? And what would be the name of the database that will be created for us automatically? so if you run that what this will do is it will go to a Chart repository that contains the mysql chart and it will automatically pull that in and it will apply it in the cluster and since we said we want to Deploy it in the feedDB namespace we can get the ports there and see if it actually did anything And yeah, as we can see we have a port which is already running and it was deployed 20 seconds ago So that seems legit so now we have a running database, but the next thing is how can we Authenticate to it and by default this Helm chart Creates a root user with a randomly generated password and this password is stored in a Kubernetes secret Which we can easily get and then find the right password and then decode it and then use it or we can just do We can just be real programmers and just copy this thing that they provided for us and that will do everything for us So if we decode that Variable we see that we have a password or at least we have some kind of string We don't know it so if it's a password yet, but we can verify that We can actually SSH to the bot that's running the database and we can manually authenticate there just to see if it's the right one so if we do that And we since Irini That's Oh the right one probably so if Irini currently doesn't support CFS stage, but we can still use kubectl exec, which is basically the same thing and If it ever loads we should see that what oh of course I'm Stupid I should be Getting the pots in the feed be namespace and I should Yeah, take the pot, which is actually running database node API. So now it should work and we're in the pot now we can just Use my SQL dash B and we can copy the password that we got from the environment variable And we're in so that worked and just to verify that this is the database that we need If we show our databases we see that we have the feed of your database that we specified when we install the home chat So now we can we have a running database We can authenticate to it But we need to expose it if you want to use it as a user provided service on the cloud founder side and there are many ways We expose it in Kubernetes Probably the easiest and most straightforward one is to use kubectl expose With the notepad type and what this will do is it will create a service in the feed be namespace and it will open a port in the Kubernetes node and our request to that port will be forwarded to the to our database and In order to see which port was opened for us because we cannot choose it We can list all services and the first record under the ports column You can see that we have we map the mysql port to the 30128 to the node so now we have everything we need in order to connect database and We can create a CF user provided service and we just provide a JSON here and that JSON Has everything we need in order to connect the database first password and the password we have in the myscaled Password so you can just copy that Database address is this isn't the IP of the node and we can just paste the right port which we got from the services and The DB name is video here, which is what we specified when we install the chart So this created a service on the cloud foundry side and in order to bind it to our app We need to use the bind Not the unbind the bind service command Right and that's that way we bind the footways Service to our feet API up But in order to get the updates in our app We have to restage it and that will basically delete everything in the covariance cluster that has the feet API name and after that it will create it again and it will create with the new environment variables with everything you need in order to connect the database and And it might be wondering why don't we just use service brokers and yeah, you can I mean We're not saying that you should use that way all the time It's just a different approach that you can use Maybe you don't know how to write service brokers or maybe you just don't have the time to research it Or maybe just you just want to quickly just try out something and that way You can easily do it it's much faster than handling all the service broker things and this Should be staged soon Yeah, so It's almost done and after it's done. We'll see that the environment variable will be the correct one and we have the app Which is creating and soon should be running Yep, nice. All right. So now we can use the same URL in the browser And we still still see that we don't have anything, but let's actually try uploading something And let's see if it works So it's a pretty serene image And as we can see it's there. It's uploaded since in the database, right? So let's quickly talk about Monitoring and usually what called foundry would have Grafana or something like that Which you can use to monitor you all your apps But in this case we don't actually deploy all the apps through Cloud Foundry So Cloud Foundry doesn't know about our database for example. So what can you do in that case? And since we're using a Rini all of the apps end up in the Kubernetes cluster anyway So we can just use a monitoring solution that just uses the Kubernetes resources or tracks the Kubernetes spots and One such thing is Prometheus code Prometheus. There's a Helm chart for it And we already pre-installed it because it takes a lot of time to Install it and we can show it here in the Prometheus namespace It has a lot of components So it takes a bit of time to get installed and we have it set up in advance and we used local port forwarding in order to be able to access it from our Local machine and it should be on port 99 right and here you can write queries for example cube Pots created and This will show you some graph information about the creation of the pots and you have some visual things here maybe you can understand and We can also specify a concrete pot if you want to That we want to monitor and let's just get the one that we just deployed just a feed API and Yeah, it appears and that's doesn't look that great. It's kind of static and it's not visually that helpful so you can deploy Grafana on top of that and Grafana has built-in support for Prometheus and you that way you can monitor your apps that are running on Kubernetes that are both cloud foundry and native Kubernetes events apps so summarized All right, so In summary, so what did we do we deployed a microservice architecture of that feed Delphia app two of those microservice where deployed by CF and we deployed the database using Coup CTL and we used cloud foundry user services to actually bind the API part with the database in order that we can like store all the Photos into the database and also get them from the database and And Yeah, and we also show like you can use cloud foundry native monitoring approaches like Prometheus Which is actually part of the cloud native computing foundation. So It's and you can actually if you like deploy on top Grafana to have like updated Monitoring charts, yeah, so Why to choose between flexibility and simplicity if you can have both you can have flexibility you can have simplicity With Irini and CF containerization. You have a unified operator user experience and you have overall reduced cost because you don't have to operate both a Bosch deployed CF and Kubernetes and with that be fast be first on the market choose Irini and CF containerization And with that that's all we have for today There is a QR code to our fidelfia application and there's also the URL. It's just Irini.cf with that Your will land directly in the feet and you can upload some photos from the Summit and we will make the pictures available Some when after summit and you just reach out at us in the Irini dev channel on cloud foundry slack and Yeah, I think we have a little bit time for questions left. They are two minutes. So If there are any questions feel free to ask