Skip to content

Commit c03120f

Browse files
authored
Acrolinx
1 parent b9b84e8 commit c03120f

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

articles/azure-functions/functions-kubernetes-keda.md

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ The Azure Functions runtime provides flexibility in hosting where and how you wa
1717
1818
## How Kubernetes-based functions work
1919

20-
The Azure Functions service is made up of two key components: a runtime and a scale controller. The Functions runtime runs and executes your code. The runtime includes logic on how to trigger, log, and manage function executions. The Azure Functions runtime can run *anywhere*. The other component is a scale controller. The scale controller monitors the rate of events that are targeting your function, and proactively scales the number of instances running your app. To learn more, see [Azure Functions scale and hosting](functions-scale.md).
20+
The Azure Functions service is made up of two key components: a runtime and a scale controller. The Functions runtime runs and executes your code. The runtime includes logic on how to trigger, log, and manage function executions. The Azure Functions runtime can run *anywhere*. The other component is a scale controller. The scale controller monitors the rate of events that are targeting your function, and proactively scales the number of instances running your app. To learn more, see [Azure Functions scale and hosting](functions-scale.md).
2121

22-
Kubernetes-based Functions provides the Functions runtime in a [Docker container](functions-create-container-registry.md) with event-driven scaling through KEDA. KEDA can scale in to 0 instances (when no events are occurring) and out to *n* instances. It does this by exposing custom metrics for the Kubernetes autoscaler (Horizontal Pod Autoscaler). Using Functions containers with KEDA makes it possible to replicate serverless function capabilities in any Kubernetes cluster. These functions can also be deployed using [Azure Kubernetes Services (AKS) virtual nodes](/azure/aks/virtual-nodes-cli) feature for serverless infrastructure.
22+
Kubernetes-based Functions provides the Functions runtime in a [Docker container](functions-create-container-registry.md) with event-driven scaling through KEDA. KEDA can scale in to zero instances (when no events are occurring) and out to *n* instances. It does this by exposing custom metrics for the Kubernetes autoscaler (Horizontal Pod Autoscaler). Using Functions containers with KEDA makes it possible to replicate serverless function capabilities in any Kubernetes cluster. These functions can also be deployed using [Azure Kubernetes Services (AKS) virtual nodes](/azure/aks/virtual-nodes-cli) feature for serverless infrastructure.
2323

2424
## Managing KEDA and functions in Kubernetes
2525

@@ -31,33 +31,31 @@ To run Functions on your Kubernetes cluster, you must install the KEDA component
3131

3232
## Deploying a function app to Kubernetes
3333

34-
You can deploy any function app to a Kubernetes cluster running KEDA. Since your functions run in a Docker container, your project needs a Dockerfile. You can create a Dockerfile by using the [`--docker` option][func init] when calling `func init` to create the project. If you forgot to do this, you can always call `func init` again from the root of your Functions project, this time using the [`--docker-only` option][func init], as shown in the following example.
34+
You can deploy any function app to a Kubernetes cluster running KEDA. Since your functions run in a Docker container, your project needs a Dockerfile. You can create a Dockerfile by using the [`--docker` option][func init] when calling `func init` to create the project. If you forgot to create your Dockerfile, you can always call `func init` again from the root of your code project.
3535

36-
```command
37-
func init --docker-only
38-
```
39-
40-
To learn more about Dockerfile generation, see the [`func init`][func init] reference.
36+
1. (Optional) If you need to create your Dockerfile, use the [`func init`][func init] command with the `--docker-only` option:
4137

42-
To build an image and deploy your functions to Kubernetes, run the following command:
38+
```command
39+
func init --docker-only
40+
```
4341

44-
```command
45-
func kubernetes deploy --name <name-of-function-deployment> --registry <container-registry-username>
46-
```
42+
To learn more about Dockerfile generation, see the [`func init`][func init] reference.
4743

48-
In this example, replace `<name-of-function-deployment>` with the name of your function app.
44+
1. Use the [`func kubernetes deploy`](functions-core-tools-reference.md#func-kubernetes-deploy) command to build your image and deploy your containerized function app to Kubernetes:
4945

50-
The deploy command does the following:
46+
```command
47+
func kubernetes deploy --name <name-of-function-deployment> --registry <container-registry-username>
48+
```
5149

52-
1. The Dockerfile created earlier is used to build a local image for the function app.
53-
1. The local image is tagged and pushed to the container registry where the user is logged in.
54-
1. A manifest is created and applied to the cluster that defines a Kubernetes `Deployment` resource, a `ScaledObject` resource, and `Secrets`, which includes environment variables imported from your `local.settings.json` file.
50+
In this example, replace `<name-of-function-deployment>` with the name of your function app. The deploy command performs these tasks:
5551

56-
To learn more, see the [`func kubernetes deploy` command](functions-core-tools-reference.md#func-kubernetes-deploy).
52+
+ The Dockerfile created earlier is used to build a local image for your containerized function app.
53+
+ The local image is tagged and pushed to the container registry where the user is logged in.
54+
+ A manifest is created and applied to the cluster that defines a Kubernetes `Deployment` resource, a `ScaledObject` resource, and `Secrets`, which includes environment variables imported from your `local.settings.json` file.
5755

5856
### Deploying a function app from a private registry
5957

60-
The above flow works for private registries as well. If you are pulling your container image from a private registry, include the `--pull-secret` flag that references the Kubernetes secret holding the private registry credentials when running `func kubernetes deploy`.
58+
The previous deployment steps work for private registries as well. If you're pulling your container image from a private registry, include the `--pull-secret` flag that references the Kubernetes secret holding the private registry credentials when running `func kubernetes deploy`.
6159
6260
## Removing a function app from Kubernetes
6361
@@ -89,7 +87,7 @@ KEDA has support for the following Azure Function triggers:
8987
9088
### HTTP Trigger support
9189
92-
You can use Azure Functions that expose HTTP triggers, but KEDA doesn't directly manage them. You can leverage the KEDA prometheus trigger to [scale HTTP Azure Functions from 1 to *n* instances](https://dev.to/anirudhgarg_99/scale-up-and-down-a-http-triggered-function-app-in-kubernetes-using-keda-4m42).
90+
You can use Azure Functions that expose HTTP triggers, but KEDA doesn't directly manage them. You can use the KEDA prometheus trigger to [scale HTTP Azure Functions from one to `n` instances](https://dev.to/anirudhgarg_99/scale-up-and-down-a-http-triggered-function-app-in-kubernetes-using-keda-4m42).
9391

9492
## Next Steps
9593
For more information, see the following resources:

0 commit comments

Comments
 (0)