123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976 |
- # Copyright (c) 2022 Yunshan Networks
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- # http://www.apache.org/licenses/LICENSE-2.0
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ##################################################################################################
- # This file defines the services, deployments, configmap, statefulsets
- #
- # To deploy full demo, you can :
- # kubectl apply -f springboot-otel-demo.yaml -n ${YOUR-NAMESPACE}
- ##################################################################################################
- ##################################################################################################
- # Namespace
- ##################################################################################################
- apiVersion: v1
- kind: Namespace
- metadata:
- name: deepflow-otel-spring-demo
- ---
- ##################################################################################################
- # Deployments
- ##################################################################################################
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- name: svc-item
- namespace: deepflow-otel-spring-demo
- spec:
- replicas: 1
- selector:
- matchLabels:
- app: svc-item
- template:
- metadata:
- labels:
- app: svc-item
- version: latest
- spec:
- affinity:
- podAntiAffinity:
- preferredDuringSchedulingIgnoredDuringExecution:
- - weight: 100
- podAffinityTerm:
- labelSelector:
- matchExpressions:
- - key: app
- operator: In
- values:
- - svc-item
- - svc-order
- - svc-stock
- - svc-user
- - web-shop
- - loadgenerator
- - db-demo
- - nacos
- topologyKey: "kubernetes.io/hostname"
- containers:
- - name: svc-item
- image: registry.cn-beijing.aliyuncs.com/deepflow-demo/skywalking-demo_mydemo-item:1.0
- command:
- - sh
- args:
- - /home/docker-entrypoint.sh
- - '-javaagent:/sidecar/agent/opentelemetry-javaagent.jar'
- - '-Dotel.resource.attributes=service.name=item-svc'
- - '-Dotel.traces.exporter=otlp'
- - '-DAPP_NAME=SPRING'
- - '-Dotel.resource.attributes=app.name=SPRING'
- - '-jar'
- - /home/item-service-0.0.1-SNAPSHOT.jar
- imagePullPolicy: IfNotPresent
- env:
- - name: SERVICE_HOST
- valueFrom:
- fieldRef:
- fieldPath: status.podIP
- - name: SERVICE_PORT
- value: "20880"
- - name: SW_AGENT_NAME
- value: spring-svc-item
- - name: OTEL_EXPORTER_OTLP_ENDPOINT
- value: http://otel-collector-opentelemetry-collector.observe.svc.cluster.local:4317
- ports:
- - containerPort: 20880
- volumeMounts:
- - name: sidecar
- mountPath: /sidecar
- - name: config
- mountPath: /home/application.yml
- subPath: application.yml
- initContainers:
- - name: sidecar
- image: registry.cn-beijing.aliyuncs.com/deepflow-demo/opentelemetry-javaagent:1.15.0
- command:
- - /bin/sh
- args:
- - '-c'
- - cp -R /opentelemetry/agent /sidecar/
- volumeMounts:
- - name: sidecar
- mountPath: /sidecar
- volumes:
- - name: sidecar
- emptyDir: {}
- - configMap:
- name: item-service
- name: config
- ---
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- name: svc-order
- namespace: deepflow-otel-spring-demo
- spec:
- replicas: 1
- selector:
- matchLabels:
- app: svc-order
- template:
- metadata:
- labels:
- app: svc-order
- version: latest
- spec:
- affinity:
- podAntiAffinity:
- preferredDuringSchedulingIgnoredDuringExecution:
- - weight: 100
- podAffinityTerm:
- labelSelector:
- matchExpressions:
- - key: app
- operator: In
- values:
- - svc-item
- - svc-order
- - svc-stock
- - svc-user
- - web-shop
- - loadgenerator
- - db-demo
- - nacos
- topologyKey: "kubernetes.io/hostname"
- containers:
- - name: svc-order
- image: registry.cn-beijing.aliyuncs.com/deepflow-demo/skywalking-demo_mydemo-order:1.0
- command:
- - sh
- args:
- - /home/docker-entrypoint.sh
- - '-javaagent:/sidecar/agent/opentelemetry-javaagent.jar'
- - '-Dotel.resource.attributes=service.name=order-svc'
- - '-Dotel.traces.exporter=otlp'
- - '-DAPP_NAME=SPRING'
- - '-Dotel.resource.attributes=app.name=SPRING'
- - '-jar'
- - /home/order-service-0.0.1-SNAPSHOT.jar
- imagePullPolicy: IfNotPresent
- env:
- - name: MYSQL_HOST
- value: "db-demo"
- - name: SERVICE_HOST
- valueFrom:
- fieldRef:
- fieldPath: status.podIP
- - name: SERVICE_PORT
- value: "20880"
- - name: SW_AGENT_NAME
- value: spring-svc-order
- - name: OTEL_EXPORTER_OTLP_ENDPOINT
- value: http://otel-collector-opentelemetry-collector.observe.svc.cluster.local:4317
- ports:
- - containerPort: 20880
- volumeMounts:
- - name: sidecar
- mountPath: /sidecar
- initContainers:
- - name: sidecar
- image: registry.cn-beijing.aliyuncs.com/deepflow-demo/opentelemetry-javaagent:1.15.0
- command:
- - /bin/sh
- args:
- - '-c'
- - cp -R /opentelemetry/agent /sidecar/
- volumeMounts:
- - name: sidecar
- mountPath: /sidecar
- volumes:
- - name: sidecar
- emptyDir: {}
- - configMap:
- name: order-service
- name: config
- ---
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- name: svc-stock
- namespace: deepflow-otel-spring-demo
- spec:
- replicas: 1
- selector:
- matchLabels:
- app: svc-stock
- template:
- metadata:
- labels:
- app: svc-stock
- version: latest
- spec:
- affinity:
- podAntiAffinity:
- preferredDuringSchedulingIgnoredDuringExecution:
- - weight: 100
- podAffinityTerm:
- labelSelector:
- matchExpressions:
- - key: app
- operator: In
- values:
- - svc-item
- - svc-order
- - svc-stock
- - svc-user
- - web-shop
- - loadgenerator
- - db-demo
- - nacos
- topologyKey: "kubernetes.io/hostname"
- containers:
- - name: svc-stock
- image: registry.cn-beijing.aliyuncs.com/deepflow-demo/skywalking-demo_mydemo-stock:1.0
- command:
- - sh
- args:
- - /home/docker-entrypoint.sh
- - '-javaagent:/sidecar/agent/opentelemetry-javaagent.jar'
- - '-Dotel.resource.attributes=service.name=stock-svc'
- - '-Dotel.traces.exporter=otlp'
- - '-DAPP_NAME=SPRING'
- - '-Dotel.resource.attributes=app.name=SPRING'
- - '-jar'
- - /home/stock-service-0.0.1-SNAPSHOT.jar
- imagePullPolicy: IfNotPresent
- env:
- - name: SERVICE_HOST
- valueFrom:
- fieldRef:
- fieldPath: status.podIP
- - name: SERVICE_PORT
- value: "20880"
- - name: SW_AGENT_NAME
- value: spring-svc-stock
- - name: OTEL_EXPORTER_OTLP_ENDPOINT
- value: http://otel-collector-opentelemetry-collector.observe.svc.cluster.local:4317
- ports:
- - containerPort: 20880
- volumeMounts:
- - name: sidecar
- mountPath: /sidecar
- - name: config
- mountPath: /home/application.yml
- subPath: application.yml
- initContainers:
- - name: sidecar
- image: registry.cn-beijing.aliyuncs.com/deepflow-demo/opentelemetry-javaagent:1.15.0
- command:
- - /bin/sh
- args:
- - '-c'
- - cp -R /opentelemetry/agent /sidecar/
- volumeMounts:
- - name: sidecar
- mountPath: /sidecar
- volumes:
- - name: sidecar
- emptyDir: {}
- - configMap:
- name: stock-service
- name: config
- ---
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- name: svc-user
- namespace: deepflow-otel-spring-demo
- spec:
- replicas: 1
- selector:
- matchLabels:
- app: svc-user
- template:
- metadata:
- labels:
- app: svc-user
- version: latest
- spec:
- affinity:
- podAntiAffinity:
- preferredDuringSchedulingIgnoredDuringExecution:
- - weight: 100
- podAffinityTerm:
- labelSelector:
- matchExpressions:
- - key: app
- operator: In
- values:
- - svc-item
- - svc-order
- - svc-stock
- - svc-user
- - web-shop
- - loadgenerator
- - db-demo
- - nacos
- topologyKey: "kubernetes.io/hostname"
- containers:
- - name: svc-user
- image: registry.cn-beijing.aliyuncs.com/deepflow-demo/skywalking-demo_mydemo-user:1.0
- command:
- - sh
- args:
- - /home/docker-entrypoint.sh
- - '-javaagent:/sidecar/agent/opentelemetry-javaagent.jar'
- - '-Dotel.resource.attributes=service.name=user-svc'
- - '-Dotel.traces.exporter=otlp'
- - '-DAPP_NAME=SPRING'
- - '-Dotel.resource.attributes=app.name=SPRING'
- - '-jar'
- - /home/user-service-0.0.1-SNAPSHOT.jar
- imagePullPolicy: IfNotPresent
- env:
- - name: MYSQL_HOST
- value: "db-demo"
- - name: SERVICE_HOST
- valueFrom:
- fieldRef:
- fieldPath: status.podIP
- - name: SERVICE_PORT
- value: "20880"
- - name: SW_AGENT_NAME
- value: spring-svc-user
- - name: OTEL_EXPORTER_OTLP_ENDPOINT
- value: http://otel-collector-opentelemetry-collector.observe.svc.cluster.local:4317
- ports:
- - containerPort: 20880
- volumeMounts:
- - name: sidecar
- mountPath: /sidecar
- - name: config
- mountPath: /home/application.yml
- subPath: application.yml
- initContainers:
- - name: sidecar
- image: registry.cn-beijing.aliyuncs.com/deepflow-demo/opentelemetry-javaagent:1.15.0
- command:
- - /bin/sh
- args:
- - '-c'
- - cp -R /opentelemetry/agent /sidecar/
- volumeMounts:
- - name: sidecar
- mountPath: /sidecar
- volumes:
- - name: sidecar
- emptyDir: {}
- - configMap:
- name: user-service
- name: config
- ---
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- name: web-shop
- namespace: deepflow-otel-spring-demo
- spec:
- replicas: 1
- selector:
- matchLabels:
- app: web-shop
- template:
- metadata:
- labels:
- app: web-shop
- version: latest
- spec:
- affinity:
- podAntiAffinity:
- preferredDuringSchedulingIgnoredDuringExecution:
- - weight: 100
- podAffinityTerm:
- labelSelector:
- matchExpressions:
- - key: app
- operator: In
- values:
- - svc-item
- - svc-order
- - svc-stock
- - svc-user
- - web-shop
- - loadgenerator
- - db-demo
- - nacos
- topologyKey: "kubernetes.io/hostname"
- containers:
- - name: web-shop
- image: registry.cn-beijing.aliyuncs.com/deepflow-demo/skywalking-demo_mydemo-shopweb:1.0
- command:
- - sh
- args:
- - /home/docker-entrypoint.sh
- - '-javaagent:/sidecar/agent/opentelemetry-javaagent.jar'
- - '-Dotel.resource.attributes=service.name=shop-web'
- - '-Dotel.traces.exporter=otlp'
- - '-DAPP_NAME=SPRING'
- - '-Dotel.resource.attributes=app.name=SPRING'
- - '-jar'
- - /home/shop-web-0.0.1-SNAPSHOT.jar
- imagePullPolicy: IfNotPresent
- ports:
- - containerPort: 8090
- env:
- - name: SW_AGENT_NAME
- value: spring-svc-webshop
- - name: OTEL_EXPORTER_OTLP_ENDPOINT
- value: http://otel-collector-opentelemetry-collector.observe.svc.cluster.local:4317
- volumeMounts:
- - name: sidecar
- mountPath: /sidecar
- initContainers:
- - name: sidecar
- image: registry.cn-beijing.aliyuncs.com/deepflow-demo/opentelemetry-javaagent:1.15.0
- command:
- - /bin/sh
- args:
- - '-c'
- - cp -R /opentelemetry/agent /sidecar/
- volumeMounts:
- - name: sidecar
- mountPath: /sidecar
- volumes:
- - name: sidecar
- emptyDir: {}
- ---
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- name: loadgenerator
- namespace: deepflow-otel-spring-demo
- spec:
- replicas: 1
- selector:
- matchLabels:
- app: loadgenerator
- template:
- metadata:
- labels:
- app: loadgenerator
- version: latest
- spec:
- affinity:
- podAntiAffinity:
- preferredDuringSchedulingIgnoredDuringExecution:
- - weight: 100
- podAffinityTerm:
- labelSelector:
- matchExpressions:
- - key: app
- operator: In
- values:
- - svc-item
- - svc-order
- - svc-stock
- - svc-user
- - web-shop
- - loadgenerator
- - db-demo
- - nacos
- topologyKey: "kubernetes.io/hostname"
- containers:
- - name: loadgenerator
- image: registry.cn-beijing.aliyuncs.com/deepflow-demo/skywalking-demo_loadgenerator:latest
- env:
- - name: FRONTEND_ADDR
- value: web-shop:8090
- - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
- value: http://otel-collector-opentelemetry-collector.observe.svc.cluster.local:4317
- - name: OTEL_RESOURCE_ATTRIBUTES
- value: service.name=loadgenerator
- - name: USERS
- value: '1'
- ##################################################################################################
- # StatefulSets
- ##################################################################################################
- ---
- apiVersion: apps/v1
- kind: StatefulSet
- metadata:
- name: db-demo
- namespace: deepflow-otel-spring-demo
- spec:
- replicas: 1
- serviceName: db-demo
- selector:
- matchLabels:
- app: db-demo
- template:
- metadata:
- labels:
- app: db-demo
- version: 5.7.18
- spec:
- affinity:
- podAntiAffinity:
- preferredDuringSchedulingIgnoredDuringExecution:
- - weight: 100
- podAffinityTerm:
- labelSelector:
- matchExpressions:
- - key: app
- operator: In
- values:
- - svc-item
- - svc-order
- - svc-stock
- - svc-user
- - web-shop
- - loadgenerator
- - db-demo
- - nacos
- topologyKey: "kubernetes.io/hostname"
- containers:
- - name: db-demo
- image: registry.cn-beijing.aliyuncs.com/deepflow-demo/skywalking-demo_mydemo-mysql:1.0
- imagePullPolicy: IfNotPresent
- env:
- - name: MYSQL_ROOT_PASSWORD
- value: "123"
- ports:
- - containerPort: 3306
- readinessProbe:
- exec:
- command: ["mysql", "-hlocalhost", "-uroot", "-p123", "-P3306", "--database", "skywalking", "-e", "SELECT 1"]
- initialDelaySeconds: 15
- periodSeconds: 5
- timeoutSeconds: 2
- ---
- apiVersion: apps/v1
- kind: StatefulSet
- metadata:
- name: nacos
- namespace: deepflow-otel-spring-demo
- spec:
- replicas: 1
- serviceName: nacos
- selector:
- matchLabels:
- app: nacos
- template:
- metadata:
- labels:
- app: nacos
- version: 1.1.4
- spec:
- affinity:
- podAntiAffinity:
- preferredDuringSchedulingIgnoredDuringExecution:
- - weight: 100
- podAffinityTerm:
- labelSelector:
- matchExpressions:
- - key: app
- operator: In
- values:
- - svc-item
- - svc-order
- - svc-stock
- - svc-user
- - web-shop
- - loadgenerator
- - db-demo
- - nacos
- topologyKey: "kubernetes.io/hostname"
- containers:
- - name: nacos
- image: registry.cn-beijing.aliyuncs.com/deepflow-demo/skywalking-demo_mydemo-nacos-server:1.1.4
- imagePullPolicy: IfNotPresent
- env:
- - name: MYSQL_HOST
- value: "db-demo"
- - name: MODE
- value: standalone
- ports:
- - containerPort: 8848
- readinessProbe:
- httpGet:
- path: /nacos
- port: 8848
- initialDelaySeconds: 3
- periodSeconds: 5
- timeoutSeconds: 2
- ---
- ##################################################################################################
- # ConfigMaps
- ##################################################################################################
- apiVersion: v1
- data:
- application.yml: |
- spring:
- main:
- allow-bean-definition-overriding: true
- output:
- ansi:
- enabled: always
- application:
- name: item
- nacos:
- address: ${NACOS_HOST:localhost}:8848
- dubbo:
- filter:
- application: # see com.alibaba.dubbo.config.ApplicationConfig
- id: ${application.name}-srv
- name: ${application.name}-srv
- qosEnable: false
- protocol: # see com.alibaba.dubbo.config.ProtocolConfig
- id: rest
- name: rest
- host: ${SERVICE_HOST:localhost} # Use POD IP to register Dubbo service
- port: ${SERVICE_PORT:20880}
- threads: 3
- iothreads: 1
- server: netty
- client: netty
- status: server
- serialization: fst
- queues: 0
- keepAlive: true
- registry: # see com.alibaba.dubbo.config.RegistryConfig
- address: nacos://${nacos.address}
- check: false
- provider:
- cluster: failfast
- retries: 0
- loadbalance: roundrobin
- timeout: 10000
- filter: ${dubbo.filter}
- zipkin:
- server: ${zipkin.base-url}/api/v2/spans
- connectTimeout: 5000
- readTimeout: 5000
- kind: ConfigMap
- metadata:
- name: item-service
- namespace: deepflow-otel-spring-demo
- ---
- apiVersion: v1
- data:
- application.yml: |
- spring:
- main:
- allow-bean-definition-overriding: true
- output:
- ansi:
- enabled: always
- datasource:
- driver-class-name: ${mysql.driver-class}
- url: jdbc:mysql://${mysql.host}:${mysql.port}/${db.order}?connectTimeout=3000&socketTimeout=10000&characterEncoding=utf8&useTimezone=true&serverTimezone=Asia/Shanghai&useSSL=false${jdbc.interceptors}
- username: ${mysql.user}
- password: ${mysql.password}
- application:
- name: order
- nacos:
- address: ${NACOS_HOST:localhost}:8848
- dubbo:
- filter:
- application: # see com.alibaba.dubbo.config.ApplicationConfig
- id: ${application.name}-srv
- name: ${application.name}-srv
- qosEnable: false
- protocol: # see com.alibaba.dubbo.config.ProtocolConfig
- id: rest
- name: rest
- host: ${SERVICE_HOST:localhost} # Use POD IP to register Dubbo service
- port: ${SERVICE_PORT:20883}
- threads: 3
- iothreads: 1
- server: netty
- client: netty
- status: server
- serialization: fst
- queues: 0
- keepAlive: true
- registry: # see com.alibaba.dubbo.config.RegistryConfig
- address: nacos://${nacos.address}
- check: false
- provider:
- cluster: failfast
- retries: 0
- loadbalance: roundrobin
- timeout: 10000
- filter: ${dubbo.filter}
- consumer:
- filter: ${dubbo.filter}
- # Fault tolerance. Options: failover/failfast/failsafe/failback/forking
- cluster: failfast
- # Load balancing strategy. Options: random, roundrobin(polling), leastactive(invoking least active service)
- loadbalance: roundrobin
- druid:
- defaultAutoCommit: true
- defaultTransactionIsolation: 2
- initialSize: 1
- maxActive: 3
- maxWait: 10000
- minIdle: 1
- validationQuery: /* ping */ select 1
- testOnBorrow: false
- testOnReturn: false
- testWhileIdle: true
- timeBetweenEvictionRunsMillis: 60000
- minEvictableIdleTimeMillis: 1800000
- removeAbandoned: true
- removeAbandonedTimeout: 1800
- logAbandoned: true
- mybatis: # see MybatisProperties.class in mybatis-spring-boot-autoconfigure
- mapperLocations: classpath:mappers/*.xml
- seata:
- enabled: true
- application-id: ${application.name}
- tx-service-group: my_demo_gtx
- config:
- type: nacos
- nacos:
- namespace:
- serverAddr: ${nacos.address}
- registry:
- type: nacos
- nacos:
- cluster: default
- server-addr: ${nacos.address}
- namespace:
- zipkin:
- server: ${zipkin.base-url}/api/v2/spans
- connectTimeout: 5000
- readTimeout: 5000
- kind: ConfigMap
- metadata:
- name: order-service
- namespace: deepflow-otel-spring-demo
- ---
- apiVersion: v1
- data:
- application.yml: |
- spring:
- main:
- allow-bean-definition-overriding: true
- output:
- ansi:
- enabled: always
- application:
- name: stock
- nacos:
- address: ${NACOS_HOST:localhost}:8848
- dubbo:
- filter:
- application: # see com.alibaba.dubbo.config.ApplicationConfig
- id: ${application.name}-srv
- name: ${application.name}-srv
- qosEnable: false
- protocol: # see com.alibaba.dubbo.config.ProtocolConfig
- id: rest
- name: rest
- host: ${SERVICE_HOST:localhost} # Use POD IP to register Dubbo service
- port: ${SERVICE_PORT:20881}
- threads: 3
- iothreads: 1
- server: netty
- client: netty
- status: server
- serialization: fst
- queues: 0
- keepAlive: true
- registry: # see com.alibaba.dubbo.config.RegistryConfig
- address: nacos://${nacos.address}
- check: false
- provider:
- cluster: failfast
- retries: 0
- loadbalance: roundrobin
- timeout: 10000
- filter: ${dubbo.filter}
- zipkin:
- server: ${zipkin.base-url}/api/v2/spans
- connectTimeout: 5000
- readTimeout: 5000
- kind: ConfigMap
- metadata:
- name: stock-service
- namespace: deepflow-otel-spring-demo
- ---
- apiVersion: v1
- data:
- application.yml: |
- mysql:
- driver-class: com.mysql.jdbc.Driver
- host: ${MYSQL_HOST:localhost}
- port: ${MYSQL_PORT:3306}
- user: mydemo
- password: mydemo
- db:
- order: mydemo-dn1
- user: mydemo-dn1
- jdbc:
- interceptors:
- nacos:
- address: ${NACOS_HOST:localhost}:8848
- spring:
- main:
- allow-bean-definition-overriding: true
- output:
- ansi:
- enabled: always
- datasource:
- driver-class-name: ${mysql.driver-class}
- url: jdbc:mysql://${mysql.host}:${mysql.port}/${db.user}?connectTimeout=3000&socketTimeout=10000&characterEncoding=utf8&useTimezone=true&serverTimezone=Asia/Shanghai&useSSL=false${jdbc.interceptors}
- username: ${mysql.user}
- password: ${mysql.password}
- application:
- name: user
- dubbo:
- filter:
- application: # see com.alibaba.dubbo.config.ApplicationConfig
- id: ${application.name}-srv
- name: ${application.name}-srv
- qosEnable: false
- protocol: # see com.alibaba.dubbo.config.ProtocolConfig
- id: rest
- name: rest
- host: ${SERVICE_HOST:localhost} # Use POD IP to register Dubbo service
- port: ${SERVICE_PORT:20882}
- threads: 3
- iothreads: 1
- server: netty
- client: netty
- status: server
- serialization: fst
- queues: 0
- keepAlive: true
- registry: # see com.alibaba.dubbo.config.RegistryConfig
- address: nacos://${nacos.address}
- check: false
- provider:
- cluster: failfast
- retries: 0
- loadbalance: roundrobin
- timeout: 10000
- filter: ${dubbo.filter}
- druid:
- defaultAutoCommit: true
- defaultTransactionIsolation: 2
- initialSize: 1
- maxActive: 3
- maxWait: 5000
- minIdle: 1
- validationQuery: /* ping */ select 1
- testOnBorrow: false
- testOnReturn: false
- testWhileIdle: true
- timeBetweenEvictionRunsMillis: 60000
- minEvictableIdleTimeMillis: 1800000
- removeAbandoned: true
- removeAbandonedTimeout: 1800
- logAbandoned: true
- mybatis: # see MybatisProperties.class in mybatis-spring-boot-autoconfigure
- mapperLocations: classpath:mappers/*.xml
- seata:
- enabled: true
- application-id: ${application.name}
- tx-service-group: my_demo_gtx
- config:
- type: nacos
- nacos:
- namespace:
- serverAddr: ${nacos.address}
- registry:
- type: nacos
- nacos:
- cluster: default
- server-addr: ${nacos.address}
- namespace:
- zipkin:
- server: ${zipkin.base-url}/api/v2/spans
- connectTimeout: 5000
- readTimeout: 5000
- mydemo:
- hostname: ${HOSTNAME:localhost}
- kind: ConfigMap
- metadata:
- name: user-service
- namespace: deepflow-otel-spring-demo
- ---
- ##################################################################################################
- # Services
- ##################################################################################################
- kind: Service
- apiVersion: v1
- metadata:
- name: nacos
- namespace: deepflow-otel-spring-demo
- spec:
- type: ClusterIP
- ports:
- - name: http-nacos
- port: 8848
- targetPort: 8848
- selector:
- app: nacos
- ---
- kind: Service
- apiVersion: v1
- metadata:
- name: web-shop
- namespace: deepflow-otel-spring-demo
- spec:
- type: ClusterIP
- ports:
- - name: http-shop
- port: 8090
- targetPort: 8090
- selector:
- app: web-shop
- ---
- kind: Service
- apiVersion: v1
- metadata:
- name: db-demo
- namespace: deepflow-otel-spring-demo
- spec:
- type: ClusterIP
- ports:
- - name: mysql
- port: 3306
- targetPort: 3306
- selector:
- app: db-demo
|