apache / shenyu

Apache ShenYu is a Java native API Gateway for service proxy, protocol conversion and API governance.
https://shenyu.apache.org/
Apache License 2.0
8.41k stars 2.92k forks source link

When Kubernetes is used to deploy the shenyu gateway and metrics are enabled, an error occurs: Attributes under shenyu.metrics.port cannot be bound to java.lang.Integer. #5307

Closed kyleCheng56 closed 9 months ago

kyleCheng56 commented 10 months ago

Is there an existing issue for this?

Current Behavior

Use Kubernetes to deploy the Shenyu gateway, enable metrics, and connect Prometheus to collect Shenyu metric data, including basic metrics and traffic limiting metrics.

Expected Behavior

No response

Steps To Reproduce

Use HUAWEI CLOUD CCE v1.27 container engine (k8s) to deploy the shenyu gateway using shenyu-ns.yaml and shenyu-bootstrap.yaml.

Environment

ShenYu version(s):2.6.0

Debug logs

No response

Anything else?

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2023-11-19 09:43:05 [main] ERROR org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter -


APPLICATION FAILED TO START


Description:

Failed to bind properties under 'shenyu.metrics.port' to java.lang.Integer:

Property: shenyu.metrics.port
Value: "tcp://10.247.205.230:8090"
Origin: System Environment Property "SHENYU_METRICS_PORT"
Reason: failed to convert java.lang.String to java.lang.Integer (caused by java.lang.NumberFormatException: For input string: "tcp://10.247.205.230:8090")

Action:

Update your application's configuration

kyleCheng56 commented 10 months ago

apiVersion: v1 kind: Namespace metadata: name: shenyu labels: name: shenyu

apiVersion: v1 kind: ConfigMap metadata: name: shenyu-cm namespace: shenyu data: shenyu-admin-application.yml: | server: port: 9095 address: 0.0.0.0 spring: profiles: active: mysql thymeleaf: cache: true encoding: utf-8 enabled: true prefix: classpath:/static/ suffix: .html mvc: pathmatch: matching-strategy: ant_path_matcher mybatis: config-location: classpath:/mybatis/mybatis-config.xml mapper-locations: classpath:/mappers/*.xml shenyu: register: registerType: http #http #zookeeper #etcd #nacos #consul serverLists: #localhost:2181 #http://localhost:2379 #localhost:8848 props: sessionTimeout: 5000 connectionTimeout: 2000 checked: true zombieCheckTimes: 5 scheduledTime: 10 nacosNameSpace: ShenyuRegisterCenter sync: websocket: enabled: true messageMaxSize: 10240 allowOrigins: ws://192.168.1.252:9095;ws://192.168.1.252:9195;ws://192.168.2.110:9195; ldap: enabled: false url: ldap://xxxx:xxx bind-dn: cn=xxx,dc=xxx,dc=xxx password: xxxx base-dn: ou=xxx,dc=xxx,dc=xxx object-class: person login-field: cn jwt: expired-seconds: 86400000 shiro: white-list: