Skip to content

Commit bd0174d

Browse files
authored
Merge pull request #284984 from ggailey777/patch-3
[Functions] Clarify Kubernetes support note
2 parents 1636a7d + 5487282 commit bd0174d

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

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

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Understand how to run Azure Functions in Kubernetes in the cloud or
44
author: eamonoreilly
55
ms.topic: conceptual
66
ms.custom: build-2023, build-2024
7-
ms.date: 05/11/2023
7+
ms.date: 08/19/2024
88
ms.author: eamono
99
---
1010

@@ -13,13 +13,15 @@ ms.author: eamono
1313
The Azure Functions runtime provides flexibility in hosting where and how you want. [KEDA](https://keda.sh) (Kubernetes-based Event Driven Autoscaling) pairs seamlessly with the Azure Functions runtime and tooling to provide event driven scale in Kubernetes.
1414

1515
> [!IMPORTANT]
16-
> Running your containerized function apps on Kubernetes, either by using KEDA or by direct deployment, is an open-source effort that you can use free of cost. Best-effort support is provided by contributors and from the community by using [GitHub issues in the Azure Functions repository](https://github.com/Azure/Azure-Functions/issues). Please use these issues to report bugs and raise feature requests. For managed Kubernetes deployments, instead consider [Azure Container Apps hosting of Azure Functions](functions-container-apps-hosting.md).
16+
> Running your containerized function apps on Kubernetes, either by using KEDA or by direct deployment, is an open-source effort that you can use free of cost. Best-effort support is provided by contributors and from the community by using [GitHub issues in the Azure Functions repository](https://github.com/Azure/Azure-Functions/issues). Please use these issues to report bugs and raise feature requests.
17+
>
18+
> For fully-supported Kubernetes deployments, instead consider [Azure Container Apps hosting of Azure Functions](functions-container-apps-hosting.md).
1719
1820
## How Kubernetes-based functions work
1921

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).
22+
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).
2123

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.
24+
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.
2325

2426
## Managing KEDA and functions in Kubernetes
2527

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

3234
## Deploying a function app to Kubernetes
3335

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.
36+
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.
3537

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

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

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

48-
In this example, replace `<name-of-function-deployment>` with the name of your function app.
46+
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:
4947

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

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.
52+
In this example, replace `<name-of-function-deployment>` with the name of your function app. The deploy command performs these tasks:
5553

56-
To learn more, see the [`func kubernetes deploy` command](functions-core-tools-reference.md#func-kubernetes-deploy).
54+
+ The Dockerfile created earlier is used to build a local image for your containerized function app.
55+
+ The local image is tagged and pushed to the container registry where the user is logged in.
56+
+ 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.
5757

5858
### Deploying a function app from a private registry
5959

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`.
60+
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`.
6161
6262
## Removing a function app from Kubernetes
6363
@@ -89,7 +89,7 @@ KEDA has support for the following Azure Function triggers:
8989
9090
### HTTP Trigger support
9191
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).
92+
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).
9393

9494
## Next Steps
9595
For more information, see the following resources:

0 commit comments

Comments
 (0)