How to get OpenFaaS running on ACS? Read more!
Pre-requisites
- An Azure Subscription (you can also create a free account)
- A Linux machine (or the great Linux Subsystem on Windows 10)
- A working installation of Kubectl (tutorial here)
Deploying ACS with Kubernetes
You can choose to deploy the ACS Kubernetes cluster using Azure CLI or acs-engine.
In this readme you can find a quick guide for the both.
Deploy the cluster with the Azure CLI
1) Install the official latest version of Azure CLI
2) Login to your subscription
Optional: If you have multiple subscriptions linked to your account, remember to select the one on which you want to work. (az account set -s subscription-id)
3) Create the resource group in which you want to deploy the cluster (in the example k8sRG is the name of the Resource Group and westeurope is the chosen location)
4) Finally, create your cluster. This will create a default cluster with one master and three agents (each VM is sized, by default, as a Standard_D2_v2 with 2vCPUs and 7GiB of RAM)
Optional: you can specify the agent-count, the agent-vm-size and a dns-prefix for your cluster
5) Get your cluster credentials ready for kubectl
Deploy the cluster with acs-engine
1) Download acs-engine
2) Download and eventually modify the cluster definition file (can find an example here)
3) Using the just downloaded cluster definition file (“kubernetes.json” in the example), execute acs-engine as below, in order to deploy your cluster on Azure Container Service:
4) After a successful deployment, acs-engine will output ssh keys and a list of kubeconfig files in the “_output” directory.
Please choose the JSON file corresponding to your region and use that to replace your kubeconfig file (you can usually find it in ${HOME}/.kube/config)
Deploy OpenFaaS to the newly created ACS Cluster
You may now use kubectl and go on with the deployment of OpenFaaS to your cluster.
1) Check if the kubectl configuration is ok and if your cluster is up-and-running
2) Clone the faas-netes repository
3) Deploy faas-netes to ACS
4) Optional: you may choose to expose the gateway to the internet. This could be useful to invoke functions from the internet.
When the editor pops up, change the spec/type to LoadBalancer then save and close the file (NodePort is the default spec/type for the gateway).
Congratulations! You now have OpenFaaS deployed to your Azure Container Service!
If you already know what to do now, go ahead and do it!
Otherwise, you can try to deploy a “Hello World” .NET Core 2.0 function to OpenFaaS!
In order to do that, you will need a fully functioning Docker installation on your machine and an account on Docker Hub.
1) Install the OpenFaaS CLI
2) Get the domain and port of your externally exposed gateway
3) Create a new C# Function
4) Eventually, modify the code of your “Hello World” function
5) Build, push and deploy your newly created function.
The –no-cache option is optional but very useful when updating the code of your function
6) Test your function with CURL or Postman by just invoking it with a POST request to http://domain:port/function/your-function-name
I think everything published was actually very logical.
But, what about this? suppose you composed a catchier post title?
I mean, I don’t wish to tell you how to run your website, but suppose you added
something to maybe grab folk’s attention? I mean Get OpenFaaS running on Azure Container Service with Kubernetes – in love with technology is a little vanilla.
You should glance at Yahoo’s home page and see how they write article headlines
to grab people interested. You might add a video or a pic or
two to grab readers excited about everything’ve written. In my opinion, it might bring your posts a little livelier.
Thank you for your suggestion, I hope you liked the blog post even though the title was not so catchy.
What’s Taking place i’m new to this, I stumbled upon this I’ve
discovered It absolutely useful and it has helped me out loads.
I hope to contribute & aid other users like its aided me.
Great job.