【发布时间】:2021-11-29 16:55:12
【问题描述】:
KEDA 缩放器无法与使用 pod 身份对服务总线队列进行身份验证的触发器定义的缩放对象进行缩放。
我正在关注thisKEDA 服务总线触发扩展项目。
缩放与连接字符串一起工作正常,但是当我尝试使用 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"}
于 2021 年 9 月 11 日编辑 我在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 身份部署到我的 keda 部署所在的 namespace keda。
并使用以下命令安装 KEDA 以使用 helm 设置 pod identity binding:
helm install keda kedacore/keda --set podIdentity.activeDirectory.identity=app-autoscaler --namespace keda
预期行为 KEDA 缩放器应该可以很好地使用分配的 pod 身份和访问令牌来执行缩放
实际行为 KEDA 算子找不到分配的天蓝色标识,缩放失败
使用的定标器 Azure 服务总线
重现问题的步骤
- 为 KEDA 创建 azure 标识和绑定
- 使用 aadpodidentitybinding 安装 KEDA
- 使用 KEDA pod 身份创建缩放对象并触发身份验证
- 缩放器无法进行身份验证和缩放
【问题讨论】:
标签: azure kubernetes azure-aks autoscaling keda