KEDA 缩放器不与使用 pod 身份对服务总线队列进行身份验证的触发器定义的缩放对象进行缩放。我正在关注这个KEDA 服务总线触发的扩展项目。
缩放适用于连接字符串,但是当我尝试使用 KEDA 缩放器的 pod 身份进行缩放时,keda 操作员无法使用以下 keda 操作员错误消息日志获取绑定到它的 azure 身份:
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).isScaledObjectActive
/workspace/pkg/scaling/scale_handler.go:228
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).checkScalers
/workspace/pkg/scaling/scale_handler.go:211
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).startScaleLoop
/workspace/pkg/scaling/scale_handler.go:145
2021-10-10T17:35:53.916Z ERROR azure_servicebus_scaler error {"error": "failed to refresh token, error: adal: Refresh request failed. Status Code = '400'. Response body: {\"error\":\"invalid_request\",\"error_description\":\"Identity not found\"}\n"}
编辑于 11/09/2021 我在 keda 打开了一个 github issue,我们做了一些故障排除。但正如@Tom 所建议的那样,这似乎是 AAD Pod Identity 的一个问题。AD Pod Identity MIC pod 提供如下日志:
E1109 03:15:34.391759 1 mic.go:1111] failed to update user-assigned identities on node aks-agentpool-14229154-vmss (add [2], del [0], update[0]), error: failed to update identities for aks-agentpool-14229154-vmss in MC_Arun_democluster_westeurope, error: compute.VirtualMachineScaleSetsClient#Update: Failure sending request: StatusCode=0 -- Original Error: Code="LinkedAuthorizationFailed" Message="The client 'fe0d7679-8477-48e3-ae7d-43e2a6fdb957' with object id 'fe0d7679-8477-48e3-ae7d-43e2a6fdb957' has permission to perform action 'Microsoft.Compute/virtualMachineScaleSets/write' on scope '/subscriptions/f3786c6b-8dca-417d-af3f-23929e8b4129/resourceGroups/MC_Arun_democluster_westeurope/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool-14229154-vmss'; however, it does not have permission to perform action 'Microsoft.ManagedIdentity/userAssignedIdentities/assign/action' on the linked scope(s) '/subscriptions/f3786c6b-8dca-417d-af3f-23929e8b4129/resourcegroups/arun/providers/microsoft.managedidentity/userassignedidentities/autoscaler-id' or the linked scope(s) are invalid."
任何线索如何解决它?
我的缩放器对象的定义如下:
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
name: trigger-auth-service-bus-orders
spec:
podIdentity:
provider: azure
---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: order-scaler
spec:
scaleTargetRef:
name: order-processor
# minReplicaCount: 0 Change to define how many minimum replicas you want
maxReplicaCount: 10
triggers:
- type: azure-servicebus
metadata:
namespace: demodemobus
queueName: orders
messageCount: '5'
authenticationRef:
name: trigger-auth-service-bus-orders
我将 azure 身份部署到namespace keda
我的 keda 部署所在的位置。并使用以下命令安装 KEDA 以设置pod identity binding
using helm:
helm install keda kedacore/keda --set podIdentity.activeDirectory.identity=app-autoscaler --namespace keda
预期行为 KEDA 缩放器应该与分配的 pod 身份和访问令牌一起正常工作以执行缩放
实际行为 KEDA 操作员无法找到分配的 azure 标识并且缩放失败
Scaler 使用 Azure 服务总线
重现问题的步骤
- 为 KEDA 创建 azure 标识和绑定
- 使用 aadpodidentitybinding 安装 KEDA
- 使用 KEDA pod 身份创建缩放对象并触发身份验证
- 缩放器无法进行身份验证和缩放