 Hi everybody, welcome back another technical demo around the serverless function. My name is Daniel Oh, I'm working for Red Hat as a technical marketing major. In this video, we're going to showcase how to create a simple function project using GoLang program language based on the serverless function capability. If you have an open to the 4.6 cluster, which allows you to install open to the serverless 1.11 operator based on that, you can have a powerful CLI command line in a space and experience to create a function capability. As you can see, we can provide multiple runtime like a parker, no JS, GoLang, and then you can deploy this application as a function using Knav serverless command line. And also you can trigger this function using cloud event and HTTP protocol. We're going to more focus on GoLang in this video. Let's get into the demo. Okay, here is my sample project on the container platform. Name is GoDashFung. And there's a lot of resources found, which means I don't deploy any application part in this project. Okay, let's try to create a new function project using Knav Fun command line. Knav Fun create any GoDashFung, which is a function name. And we're going to specify runtime is GoLang. So the GoLang project is automatically created. And let's try to open ID2 to take a look at the more detail how this project is created. So the function name GoDashFung and namespace and image digest are related to our opportunity to container platform. We're going to specify it just a bit later. Don't worry about that. And we're going to use trigger HTTP protocol. And when you take a look at that, the sample application, the Go handle.go, this application handles your HTTP request based on HTTP protocol. Okay, so next step, we're going to change it directly to the right path of the current project and then try to deploy our function to open the container platform using Knav Fun deploy command line. We need to specify external container registry. Once we build this application, then we need to push the container image into external container registry. So we're going to use quay.io, but you can also use Docker Hub as an external container registry. So once we pull down the build up image for building our GoLang application, and then next step, we're going to have the fast stack runtime image also. And we're going to use the build path to compile this GoLang application. And then after that, we will push this containerized image to external container registry just like I specify quay.io. Okay, it's almost done. And now we are waiting for deploying this application using Knav Serving to continue our platform. All right, let's go back to the FUNC YAML file. And then the namespace, image, image digest already updated based on the deployment output. So when you go back to our container platform in Dev Console and the function already deployed based on HTTP function and then try to access the endpoint of the URL and we got to OK as a return code just like a whistle in application code. All right, pretty simple and pretty awesome. So we just need to just two command line, create and build and deploy this function application based on Go and operational container platform. So now we're going to add a label in this part to make sure and distinguish this part because we're going to deploy another Go function for handling cloud events. Okay, so changes directly and let's try to create another project for triggering a cloud event. So function name Go-Fung-Events and the runtime Go and the trigger is event. As you can see, another project is automatically generated and then open the FUNC YAML file and then the new function name and the trigger event at its moment and then the sample application definitely handle your cloud event rather than HTTP overcast. All right, pretty simple. And then go back to terminal window and then change it directly and then we try to deploy this application with the same command line, KM-Fung-Deploy and external registry, same my query.io registry and then we're going to use the same namespace to deploy this functional application. So it's exactly the same procedure to build and packaging and the pushy and deploy function to the container platform as a server list. Okay, it's almost ready. Let's go to the FUNC YAML. So namespace on image is already updated and then the application is already almost up. So click on the view logs and then you can find that initializing cloud event function and the recent code 8080 and then go back to top route view and then it's already, it will be scaled down to zero in after maybe 20 and 30 seconds because that is a default serverless behavior in an opportunity to container platform with a K-nav service. So in the meantime, let's take a look at what kind of command line are available for creating our function and so you can actually specify trigger and the runtime, code, node.js and workers and then we can actually build this function separately from your deploy and you can actually specify builder, image and registry and also project path and we already did the function deployment command line but you can find more information with the help option. Okay, so let's try to find how many functions we have. We have two functions here. One is HTTP trigger. The other one is cloud event. So it's already terminating. Okay, it's just terminated. Okay, so let's try to involve this application through cloud event. Here is some call command to use cloud event and the return message of which the serverless function would go. So after we hit the URL and the dysfunction part is automatic speedup and when you take a look at the view logs we can find the same message properly. So this is a really pretty cool and awesome way. Okay, so last thing, maybe sometimes you don't need to maintain a function so we can actually delete it with the same command line and delete it with the function name so go function event and so it will delete your function with the all including resources like revision or the other images etc. So as you can see these all resources are deleted and then just delete it and when you go back to OpenShift to contain a platform developer console you cannot see any longer that thing. Thank you for watching this video. If you have any question around cloud-native runtime as well as OpenShift serverless function capability please let us know we are more than happy to address your question. Have a good rest of the day.