Azure / Azure/azure-functions-core-tools

func kubernetes deploy doesn't support binding expressions

Open
#2,264 3 comments 0 reactions 0 assignees View on GitHub
Needs: Attention :wave:
Dominant language
C#
Stars
1.5k
Forks
498
Avg merge
4d 20h
Merged PRs (30d)
14

Description

The binding expressions (i.e. `"queueName": "%input-queue-name%"`) is set as-is in the deployment file that sets up the scaled object. It doesn't seem like keda supports this, leading to hard-to-diagnose issues when it tries to scale out the pods.

Some suggestions:
1. Call this out in the documentation.
1. Update the documentation to point out how one can use the --dry-run option to output a deploymentfile, which can be ~~hacked~~ updated and deployed manually using kubectl apply to get around this kind of issue.
1. Detect this scenario in the cli and display a warning when trying to deploy.
1. Try to resolve the binding expression at deploy time.
1. Update keda to support binding expressions.

It also seems that the scaled object section in the generated deploymentfile doesn't match the spec on the keda documentation. This is what is generated:

```yaml
apiVersion: keda.k8s.io/v1alpha1
kind: ScaledObject
metadata:
name: streamanalytics
namespace: default
labels:
deploymentName: streamanalytics
spec:
scaleTargetRef:
deploymentName: streamanalytics
minReplicaCount: 3
triggers:
- type: azure-eventhub
metadata:
type: eventHubTrigger
connection: CleanseQueueEventHubConnectionString
consumerGroup: '%CleanseQueueConsumerGroup%'
eventHubName: '%CleanseQueueEventHub%'
name: events
```

This is the sample spec (for v1.5 keda):

```yaml
triggers:
- type: azure-eventhub
metadata:
connection: EVENTHUB_CONNECTIONSTRING_ENV_NAME # Connection string for Event Hub namespace appended with "EntityPath="
storageConnection: STORAGE_CONNECTIONSTRING_ENV_NAME # Connection string for account used to store checkpoint. As of now the Event Hub scaler only reads from Azure Blob Storage.
consumerGroup: $Default # Optional. Consumer group of event hub consumer. Default: $Default
unprocessedEventThreshold: '64' # Optional. Target number of unprocessed events across all partitions in Event Hub for HPA. Default: 64 events.
blobContainer: 'name_of_container' # Optional. Container name to store checkpoint. This is needed when a using an Event Hub application written in dotnet or java, and not an Azure function.
```

Contributor guide

Open the contributing guide

Research direction

Start with the `func kubernetes deploy` path and the generated deployment file, then compare its ScaledObject with the referenced KEDA v1.5 specification. The issue lists documentation, warning, resolution, and KEDA-update alternatives, so the intended scope must be decided before work begins; done should include a confirmed treatment of binding expressions and the ScaledObject mismatch.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, kubernetes
Domain
cli, cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.