首页 新闻 会员 周边 捐助

keda的mysql数据库pod只有一个,撒问题啊

0
悬赏园豆:200 [已关闭问题] 关闭于 2022-12-14 13:19

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扩展
数据库显示没有连接用户,是我字符串有问题 还是哪里,如果是,咋写啊

菜菜绝绝子的主页 菜菜绝绝子 | 菜鸟二级 | 园豆:202
提问于:2022-03-15 15:03
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册