- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
Pod 数量减少到 0,但旋转的 Pod 数量不会超过 1 个。即使订阅中的数量超过 5 毫克根据建议更新了代码。
添加了TriggerAuthentication并使用connectionString作为身份验证。尝试发送大约 25 条消息,但 pod 仍然无法扩展。
只有一个 pod 正在处理所有消息。我需要更新什么吗
apiVersion: keda.k8s.io/v1alpha1
kind: TriggerAuthentication
metadata:
name: azure-servicebus-auth
spec:
secretTargetRef:
- parameter: connection
name: mdsp-secret-infra
key: service_bus_conn_str
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: xyz-test
labels:
app: xyz-test
spec:
selector:
matchLabels:
app: xyz-test
template:
metadata:
labels:
app: xyz-test
spec:
initContainers:
- name: mdsp-java-init
image: aksacrname.azurecr.io/ops/mdsp-init-java:1.0
imagePullPolicy: Always
resources: {}
volumeMounts:
- name: azure
mountPath: /mnt/azure
- name: cert-storage
mountPath: /certs
volumes:
- name: azure
azureFile:
shareName: certs
secretName: mdsp-secret-iots-sa
readOnly: true
- name: cert-storage
emptyDir: {}
- name: "logging-volume-azure-file"
persistentVolumeClaim:
claimName: "pvc-azure-file-logging"
containers:
- name: xyz-test
image: mdspaksdevacr.azurecr.io/iots/xyz-test:aksacrversion
resources:
limits:
cpu: 3
memory: 2Gi
requests:
cpu: 1
memory: 1Gi
imagePullPolicy: Always
env:
- name: mdsp_product_line
value: "iiotservices"
- name: mdsp_application_name
value: "xyz-test"
- name: eh_connection_string
valueFrom:
secretKeyRef:
name: mdsp-secret-iots-kv
key: LOGGING_EH_CON_STRING
- name: log_base_path
value: "/mnt/logging"
- name: app.logging.console.enabled
value: "true"
- name: ai_instrumentation_key
valueFrom:
secretKeyRef:
name: mdsp-secret-iots-kv
key: APPINSIGHT_KEY
- name: MDSP_HOST_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: MDSP_HOST_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: APPLICATION_NAME
value: "xyz-test"
- name: logging.level.com.siemens.mindsphere
value: "INFO"
- name: PRODUCTLINE_NAME
value: "iiotServices"
- name: environment
value: "azEnvironment"
- name: CONNECTION_TIMEOUT_MS
value: "10000"
- name: GATEWAY_URI
value: "https://gateway.core.mindsphere.local"
- name: UPDATES_SERVICE_BUS_TOPIC_NAME
value: "internal-iiot-meta-data-updates-topic"
- name: ASSET_CLIENTID
value: asset
- name: AM_BASE_URL
value: "https://gateway.core.mindsphere.local/api/assetmanagement/v3"
- name: CORE_AUTH_TOKEN_URL
valueFrom:
configMapKeyRef:
name: mdsp-iots-configmap
key: OAUTH_TOKEN_URI
- name: amServiceBusConnectionString
valueFrom:
secretKeyRef:
name: mdsp-iots-secret-infra
key: advs_servicebus_conn_str
- name: feedbackServiceBusConnectionString
value: "Endpoint=sb://iot-test-rc.servicebus.windows.net/;SharedAccessKeyName=Testkey;SharedAccessKey=test"
- name: UPDATES_SERVICE_BUS_CONN_STR
valueFrom:
secretKeyRef:
name: mdsp-iots-secret-infra
key: iots_service_bus_conn_str
- name: AZURE_CLIENT_ID
valueFrom:
secretKeyRef:
name: mdsp-secret-iots-kv
key: KEYVAULT_CLIENT_ID
- name: AZURE_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: mdsp-secret-iots-kv
key: KEYVAULT_CLIENT_KEY
- name: AZURE_SUBSCRIPTION_ID
valueFrom:
secretKeyRef:
name: mdsp-secret-iots-kv
key: SUBSCRIPTION_ID
- name: AZURE_TENANT_ID
valueFrom:
secretKeyRef:
name: mdsp-secret-iots-kv
key: TENANT_ID
- name: KV_CLIENT_ID
valueFrom:
secretKeyRef:
name: mdsp-secret-iots-kv
key: KEYVAULT_CLIENT_ID
- name: KV_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: mdsp-secret-iots-kv
key: KEYVAULT_CLIENT_KEY
- name: JAVA_OPTS
value: >-
-Djavax.net.ssl.trustStore=/certs/cacerts
-Xmx2500m
- name: KEYVAULT_URI
valueFrom:
configMapKeyRef:
name: mdsp-iots-configmap
key: IOTS_KEYVAULT_URI
- name: COSMOS_URL
valueFrom:
configMapKeyRef:
name: mdsp-iots-configmap
key: IOT_COSMOS_URI
- name: default_key
valueFrom:
secretKeyRef:
name: mdsp-iots-secret-infra
key: iots_cosmos_db_conn_key
- name: COSMOS_DB_NAME
valueFrom:
configMapKeyRef:
name: mdsp-iots-configmap
key: IOT_COSMOS_DB_AM
- name: COSMOS_CONTAINER_NAME
valueFrom:
configMapKeyRef:
name: mdsp-iots-configmap
key: IOT_COSMOS_CON_AM
- name: default_secret_name
valueFrom:
secretKeyRef:
name: mdsp-secret-iots-tu
key: iots_bulk_data_stream
- name: MINDSPHERE_SECURITY_OAUTH2_CLIENT_ASSET_ACCESSTOKENURI
valueFrom:
configMapKeyRef:
name: mdsp-iots-configmap
key: OAUTH_TOKEN_URI
- name: MINDSPHERE_SECURITY_OAUTH2_CLIENT_ASSET_ID
value: "iottest"
volumeMounts:
- name: cert-storage
mountPath: /certs
- name: "logging-volume-azure-file"
mountPath: "/mnt/logging"
imagePullSecrets:
- name: mdsp-secret-iots
dnsPolicy: ClusterFirst
terminationGracePeriodSeconds: 30
---
apiVersion: keda.k8s.io/v1alpha1
kind: ScaledObject
metadata:
name: xyz-test-scaler-dev
labels:
app: xyz-test
deploymentName: xyz-test
spec:
scaleTargetRef:
deploymentName: xyz-test
minReplicaCount: 0
maxReplicaCount: 3
pollingInterval: 1
triggers:
- type: azure-servicebus
metadata:
# Required
topicName: am-removal-test
subscriptionName: am-subs
namespace: iot-sbus-rc
# Optional, can use TriggerAuthentication as well
connection: feedbackServiceBusConnectionString
# This must be a connection string for a queue itself, and not a namespace level (e.g. RootAccessPolicy) connection string [#215](https://github.com/kedacore/keda/issues/215)
# Optional
queueLength: "2"
authenticationRef:
name: azure-servicebus-auth
---
出现错误:
Conditions:
Type Status Reason Message
---- ------ ------ -------
AbleToScale True SucceededGetScale the HPA controller was able to get the target's current scale
ScalingActive False FailedGetExternalMetric the HPA was unable to compute the replica count: unable to get external metric iots-dev/queueLength/&LabelSelector{MatchLabels:map[string]string{deploymentName: xyz,},MatchExpressions:[]LabelSelectorRequirement{},}: unable to fetch metrics from external metrics API: the server is currently unable to handle the request (get queueLength.external.metrics.k8s.io)
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedGetExternalMetric 2m17s (x2591 over 5h53m) horizontal-pod-autoscaler unable to get external metric iots-dev/queueLength/&LabelSelector{MatchLabels:map[string]string{deploymentName: xyz,},MatchExpressions:[]LabelSelectorRequirement{},}: unable to fetch metrics from external metrics API: the server is currently unable to handle the request (get queueLength.external.metrics.k8s.io)
运行命令后:
```
api版本:apiregistration.k8s.io/v1
166kind:API服务
167元数据:
168 个注释:
169 kubectl.kubernetes.io/last-applied-configuration:|
170 {"apiVersion":"apiregistration.k8s.io/v1beta1","kind":"APIService","metadata":{"annotations":{},"name":"v1beta1.external.metrics. k8s.io"},"spec":{"group":"external.metrics.k8s.io","groupPriorityMinimum":100,"insecureSkipTLSVerify":true,"service":{"name":"自定义指标-azure-apiserver","命名空间":"自定义指标"},"版本":"v1beta1","versionPriority":100}}
171 创建时间戳:“2020-09-15T15:48:18Z”
172名称:v1beta1.external.metrics.k8s.io
173 资源版本:“13008780”
174 自链接:/apis/apiregistration.k8s.io/v1/apiservices/v1beta1.external.metrics.k8s.io
175 uid:a6a72678-001f-4378-ba10-cbff7d8c0ad2
176规范:
177 组:external.metrics.k8s.io
178组优先级最小值:100
179 不安全SkipTLSVerify:true
180服务:
181 名称:自定义-metrics-azure-apiserver
182 命名空间:自定义指标
183端口:443
184版本:v1beta1
185版本优先级:100
186状态:
187个条件:
188 - 最后转换时间:“2020-10-27T12:19:19Z”
189 消息:“custom-metrics”中的 service/custom-metrics-azure-apiserver 不存在
190 原因:ServiceNotFound
191状态:“假”
192类型:可用
最佳答案
所以,我使用rabbitmq的KEDA自动缩放器的工作示例:
apiVersion: keda.k8s.io/v1alpha1
kind: ScaledObject
metadata:
name: job-export-autoscaler
namespace: thor
spec:
scaleTargetRef:
deploymentName: job-export
pollingInterval: 5 # Time after each check
minReplicaCount: 0 # Optional. Default: 0
maxReplicaCount: 10 # Optional. Default: 100
cooldownPeriod: 60 # Cooldown since last trigger to outoscale down
triggers:
- type: rabbitmq
metadata:
queueName: report-export
queueLength: "1"
authenticationRef:
name: trigger-auth-rabbitmq
现在评论中提到的triggerAuth:
apiVersion: keda.k8s.io/v1alpha1
kind: TriggerAuthentication
metadata:
name: trigger-auth-rabbitmq
namespace: thor
spec:
secretTargetRef:
- parameter: host
name: rabbitmq-host-secret
key: rabbitmq-connectionstring
---
apiVersion: v1
kind: Secret
metadata:
name: rabbitmq-host-secret
namespace: thor
labels:
app: rabbitmq
data:
rabbitmq-connectionstring: (base64 encoded rabbitmq connection string)
因此,对于使用 Azure 服务总线:
文档:https://keda.sh/docs/1.4/scalers/azure-service-bus/#authentication-parameters
示例:
apiVersion: keda.k8s.io/v1alpha1
kind: TriggerAuthentication
metadata:
name: azure-servicebus-auth
spec:
podIdentity:
provider: azure
---
apiVersion: keda.k8s.io/v1alpha1
kind: ScaledObject
metadata:
name: azure-servicebus-queue-scaledobject
namespace: default
spec:
scaleTargetRef:
deploymentName: azure-servicebus-queue-function
triggers:
- type: azure-servicebus
metadata:
# Required: queueName OR topicName and subscriptionName
queueName: functions-sbqueue
# or
topicName: functions-sbtopic
subscriptionName: sbtopic-sub1
# Required: Define what Azure Service Bus to authenticate to with Managed Identity
namespace: service-bus-namespace
# Optional
queueLength: "5" # default 5
authenticationRef:
name: azure-servicebus-auth # authenticationRef would need either podIdentity or define a connection parameter
因此,您缺少带有连接字符串的 TriggerAuthentication 对象
关于带有 KEDA 的 Azure Function 不会横向扩展超过 1 个 Pod,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66015057/
是否有一个“主开关”来启用/禁用 Keda 和 HPA?我可以通过将副本计数编辑为 0 来启用/禁用扩展规则,但是是否有主要的启用/禁用字段? cooldownPeriod: 1800 max
因此,我有一个服务总线队列,它正在处理两种类型的消息,对于一种类型的消息,我想触发 KEDA,但希望限制 KEDA 不为其他类型的消息实例化容器。如果可能的话,我可以将属性附加到服务总线消息。 我提到
我尝试配置 Azure Monitor Scaler 以进行 keda 自动缩放。在我的缩放对象中,我指定了应用程序的 Clientid 和密码。在 Azure 门户中,我也可以看到 clientid
KEDA 缩放器无法使用使用 Pod 身份对服务总线队列进行身份验证的触发器定义的缩放对象进行缩放。我正在关注this科达服务总线触发扩容项目。 缩放可以与连接字符串配合使用,但是当我尝试使用 KED
我正在尝试将 Pod 身份与 KEDA 结合使用访问一些 Azure 资源,准确地说是 Azure 服务总线和 Keyvault。 我注意到在根据these instructions部署运算符(ope
我正在尝试将 Pod 身份与 KEDA 结合使用访问一些 Azure 资源,准确地说是 Azure 服务总线和 Keyvault。 我注意到在根据these instructions部署运算符(ope
我正在使用 Azure Kubernetes Service(AKS) 平台,并使用 KEDA“ScaledJob”来执行长时间运行的作业。在此,Azure服务总线队列触发器用于自动触发作业。现在,当
我正在使用 KEDA 自动扩展我的 ML Workload Pod。当队列缩小时,即使 Pod 仍在处理队列工作负载,Pod 也会根据队列项目的数量自动缩放。我已设置终止GracePeriodSeco
Pod 数量减少到 0,但旋转的 Pod 数量不会超过 1 个。即使订阅中的数量超过 5 毫克根据建议更新了代码。 添加了TriggerAuthentication并使用connectionStrin
我已在 AKS 上部署了用 Java 编写的事件中心触发的 Azure 函数。该功能应使用 KEDA 进行扩展。该功能已正确触发并工作,但当负载增加时它不会扩展。我在函数实现中添加了 sleep 调用
我已在 AKS 上部署了用 Java 编写的事件中心触发的 Azure 函数。该功能应使用 KEDA 进行扩展。该功能已正确触发并工作,但当负载增加时它不会扩展。我在函数实现中添加了 sleep 调用
在我的 k8s 集群中安装 keda 并创建一些缩放对象后,我收到以下错误... 无论我运行 EG:“kubectl get pods”什么命令,我都会收到以下错误消息的响应.. 如何消除以下错误消息
我是一名优秀的程序员,十分优秀!