apiVersion: v1
kind: Secret
metadata:
name: mysql-secrets
namespace: my-project
type: Opaque
data:
mysql_conn_str: cm9vdDpyb290QHRjcCgxOTIuMTY4LjgxLjEzNTozMDAwMSkvdGVzdA==
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
name: keda-trigger-auth-mysql-secret
namespace: my-project
spec:
secretTargetRef:
parameter: connectionString
name: mysql-secrets
key: mysql_conn_st
namespace: my-project
type: Opaque
data:
mysql_conn_str: cm9vdDpyb290QHRjcCgxOTIuMTY4LjgxLjEzNTozMDAwMSkvdGVzdA==
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
name: keda-trigger-auth-mysql-secret
namespace: my-project
spec:
secretTargetRef:
parameter: connectionString
name: mysql-secrets
key: mysql_conn_st
apiVersion: v1
kind: Secret
metadata:
name: mysql-secrets
namespace: my-project
type: Opaque
data:
mysql_conn_str: cm9vdDpyb290QHRjcCgxOTIuMTY4LjgxLjEzNTozMDAwMSkvdGVzdA==
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
name: keda-trigger-auth-mysql-secret
namespace: my-project
spec:
secretTargetRef:
parameter: connectionString
name: mysql-secrets
key: mysql_conn_st
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: mysql-scaledobject
namespace: my-project
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: tomcat-deployment
envSourceContainerName: .spec.template.spec.containers[0]
pollingInterval: 10
cooldownPeriod: 60
idleReplicaCount: 1
minReplicaCount: 2
maxReplicaCount: 100
fallback:
failureThreshold: 3
replicas: 6
advanced:
restoreToOriginalReplicaCount: false
horizontalPodAutoscalerConfig:
behavior:
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Percent
value: 100
periodSeconds: 15
triggers:
type: mysql
metadata:
queryValue: "1"
query: "SELECT num FROM test.usere WHERE id=1;"
authenticationRef:
name: keda-trigger-auth-mysql-secret
已经创建了数据库,192.168.81.135:30001/test
但是触发pod条件死活触发不了pod扩展
数据库显示没有连接用户,是我字符串有问题 还是哪里,如果是,咋写啊