Creating Application with the OpenShift Web Console
Containers - why all the hype? If you're looking for answers then this course is for you!
"Deploying Containerized Applications Technical Overview" provides an in-depth review of containers and why they've become so popular. Complementing the technical discussions, several hands-on demonstrations are provided, enabling you to learn about the concepts of containerization by seeing them in action.
You'll also learn about containerizing applications and services, testing them using Docker, and deploying them into a Kubernetes cluster using Red Hat OpenShift.
In this video, we're going to take a look at the OpenShift Web Console, so I'll demonstrate some of the features of the web console. We'll take a look at deploying an application, how we update an application all using the web console. So the first thing I want to talk about is well how do you access the web console. So this right here is the default URL that we can use to access the web console.
So it's default URL is going to be console-openshift- console and then the default your the cluster name that you have for your OpenShift cluster. The web console works by interacting with the REST API to communicate with the OpenShift cluster and it's just a very user developer friendly way for you to build your projects, manage your projects, monitor your projects.
Another nice feature about it is that administrators can configure different users for the web console, so the developers are going to have a slightly different experience of the admin users and it'll just be more catered to the typical developer or admin tasks. Some other things that are really useful to do in the web console is that you can create and manage your persistent volume claims, you'll be able to monitor your builds, your deployments, your pods, you can track your system events that'll help you troubleshoot any issues you might have.
You can create and integrate a continuous integration and deployment pipeline with Jenkins. You can also manage a lot of your secrets and config maps and things like that pretty much anything that you can do in the CLI, you're going to be able to do in the web console. So it's a very powerful tool. Now let's go ahead and jump into the demonstration.
So what I've already logged into my web console here and the first thing you're going to see is a list of all of your projects, so it's a good page where you can manage you know or delete projects, edit projects, things like that. First thing I'm going to do is create a new project to store this application. I'm going to name it console and I'll give it the Web Console App, a test app. Okay, so create the project, okay, great so once we've created the project you can see that the next thing we see is a link to this browse catalog, so the catalog or the developer catalog is where we can go to see the different types of applications that we can build with the built-in functionality of OpenShift.
We also have other options to just directly deploy an image or import a yml file of an application or of an OpenShift resource. So I'm going to go to browse catalog for now and you can see that we get a list of different types of languages, there's a whole bunch in here but I'm just going to stick with PHP for right now, so I'm just going to filter down I'll click PHP and when I click this window, it's going to give me some information about the type of application I'm trying to make, it's going to tell me which resources are being created. So I'm basically I'm going to need to pass in the source code from my PHP application, it's going to create a build config, an image stream, a deployment config, a service and then optionally we can choose whether or not we want to expose it as a route.
Okay, so I want to click create application okay so I give my option to put decide which namespace, I want to put it in I'm going to keep it in the namespace or project console I'm going to set the version to 7.0 because that's the version of PHP that my app is running on. I'm going to set the name to be phptest and let me get the get URL is going to be http://services.lab. example.com/ php-helloworld Okay, so once I've entered the Git repository I can optionally select to create a route, I'm going to go ahead and have it automatically create that route for me so that when the build finishes it's going to expose the service all for me.
Okay so after I click build I can keep track of where my pods are in their build process. So back on this project console home page for my application I can watch the pods come up just like I would with the oc get pods command on the CLI, so I'm looking here at my deployment config in the dc, so I've got an idea about what type of update strategies being used and I can see the replication controller just telling me that I I want one pod to be spun up and. I can change that if I want. If I wanted to scale my application up I could easily do that just by changing the deployment config.
In this case I'm just going to wait and let these this applications spin up. Okay so you can see now that our project status has updated. So the deployment config says we have 1 out of 1 pods available, so our application is already available. While we're here we'll just explore a little bit about what else we can do in the web console, we've already seen the Catalog so we know that we can select the different types of templates and things we can use to help kick-start our application deployment under Workloads is where we're going to have the definitions for our Pods, our Deployments, Deployment Configs. So all sorts of different Kubernetes and OpenShift resources are config maps and the replication controllers as well, if we go into Networking, networking is going to have our routes and our services manager, there we'll come back to that in a few minutes.
Storage is going to have where all of our persistent volumes and are persistent volume claims so we can go in there navigate edit manage those resources. So let's go into the Builds section, so I click on Build Configs I can see that our most recent build completed or is created six minutes ago, so that was based on our php application and similar to our deployment config I can go in here and I can see the Git repository that this image is based on and I'm also able to start new builds if I wanted to make an application source code change and wanted to kick off a new build and a new deployment. Okay so before we kick off a new build let's head back to the Networking section and let's access our route and it's much easier here we can just simply click on this on our app because we already had the route automatically created we can see our application here so Hello World.
So we were able to access the app immediately from the web console. So let's go ahead and make another code change and push that up to the repository and then I'll use the web console to kick off another build and we can see that change come through.
Okay so I've already cloned the Git repository so I'm going to edit the index.php. I'm going to add a new line here and I'm going to say a change has come back space and ok now I'll do a git commit and let's do a push. Ok so now when we kick off a new build it's going to get that new Verte the buildconfig is going to pull down that new version of our application and we should be able to access it again. So let's scroll down to Build Configs let's go into our build config under Actions we can click Start Build.
So the nice thing about this view is that we can get an overview about our CPU and RAM consumption, we can click on Logs or Events to just get some information. This is a little help us debug if there are any issues with our build configs or if we just want to see where in the build our application is. So I'll just going to leave this up here on the events for a few seconds and and the Log section and we'll just wait for our pods to come back up. Alright so it looks like our image has successfully been pushed up so let's go see if the deployment config has finished as well.
When I go back to the home Status page and it looks like our pod is up and running, let's reload the app and see if our change is there, ok great. So it worked just as expected so just like the command line we were able to make our change, we were able to kick off a new Build Config and we were able to see the change in our application.
So that concludes this exercise and that concludes the tech overview thank you so much for watching and I hope you found it really useful. If you're interested in learning more about Containers, Kubernetes and OpenShift I highly recommend you take a look at Red Hat trainings DO180 course that is our 3 day long introduction course to all these technologies you'll get hands-on experience with exercises just like this it's a great way to learn about how to use containers and how to use OpenShift, so thanks so much again.
Jeremy is a Content Lead Architect and DevOps SME here at Cloud Academy where he specializes in developing DevOps technical training documentation.
He has a strong background in software engineering, and has been coding with various languages, frameworks, and systems for the past 25+ years. In recent times, Jeremy has been focused on DevOps, Cloud (AWS, GCP, Azure), Security, Kubernetes, and Machine Learning.
Jeremy holds professional certifications for AWS, GCP, and Kubernetes.