deepflow-otel-spring-demo.yaml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976
  1. # Copyright (c) 2022 Yunshan Networks
  2. # Licensed under the Apache License, Version 2.0 (the "License");
  3. # you may not use this file except in compliance with the License.
  4. # You may obtain a copy of the License at
  5. # http://www.apache.org/licenses/LICENSE-2.0
  6. # Unless required by applicable law or agreed to in writing, software
  7. # distributed under the License is distributed on an "AS IS" BASIS,
  8. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. # See the License for the specific language governing permissions and
  10. # limitations under the License.
  11. ##################################################################################################
  12. # This file defines the services, deployments, configmap, statefulsets
  13. #
  14. # To deploy full demo, you can :
  15. # kubectl apply -f springboot-otel-demo.yaml -n ${YOUR-NAMESPACE}
  16. ##################################################################################################
  17. ##################################################################################################
  18. # Namespace
  19. ##################################################################################################
  20. apiVersion: v1
  21. kind: Namespace
  22. metadata:
  23. name: deepflow-otel-spring-demo
  24. ---
  25. ##################################################################################################
  26. # Deployments
  27. ##################################################################################################
  28. apiVersion: apps/v1
  29. kind: Deployment
  30. metadata:
  31. name: svc-item
  32. namespace: deepflow-otel-spring-demo
  33. spec:
  34. replicas: 1
  35. selector:
  36. matchLabels:
  37. app: svc-item
  38. template:
  39. metadata:
  40. labels:
  41. app: svc-item
  42. version: latest
  43. spec:
  44. affinity:
  45. podAntiAffinity:
  46. preferredDuringSchedulingIgnoredDuringExecution:
  47. - weight: 100
  48. podAffinityTerm:
  49. labelSelector:
  50. matchExpressions:
  51. - key: app
  52. operator: In
  53. values:
  54. - svc-item
  55. - svc-order
  56. - svc-stock
  57. - svc-user
  58. - web-shop
  59. - loadgenerator
  60. - db-demo
  61. - nacos
  62. topologyKey: "kubernetes.io/hostname"
  63. containers:
  64. - name: svc-item
  65. image: registry.cn-beijing.aliyuncs.com/deepflow-demo/skywalking-demo_mydemo-item:1.0
  66. command:
  67. - sh
  68. args:
  69. - /home/docker-entrypoint.sh
  70. - '-javaagent:/sidecar/agent/opentelemetry-javaagent.jar'
  71. - '-Dotel.resource.attributes=service.name=item-svc'
  72. - '-Dotel.traces.exporter=otlp'
  73. - '-DAPP_NAME=SPRING'
  74. - '-Dotel.resource.attributes=app.name=SPRING'
  75. - '-jar'
  76. - /home/item-service-0.0.1-SNAPSHOT.jar
  77. imagePullPolicy: IfNotPresent
  78. env:
  79. - name: SERVICE_HOST
  80. valueFrom:
  81. fieldRef:
  82. fieldPath: status.podIP
  83. - name: SERVICE_PORT
  84. value: "20880"
  85. - name: SW_AGENT_NAME
  86. value: spring-svc-item
  87. - name: OTEL_EXPORTER_OTLP_ENDPOINT
  88. value: http://otel-collector-opentelemetry-collector.observe.svc.cluster.local:4317
  89. ports:
  90. - containerPort: 20880
  91. volumeMounts:
  92. - name: sidecar
  93. mountPath: /sidecar
  94. - name: config
  95. mountPath: /home/application.yml
  96. subPath: application.yml
  97. initContainers:
  98. - name: sidecar
  99. image: registry.cn-beijing.aliyuncs.com/deepflow-demo/opentelemetry-javaagent:1.15.0
  100. command:
  101. - /bin/sh
  102. args:
  103. - '-c'
  104. - cp -R /opentelemetry/agent /sidecar/
  105. volumeMounts:
  106. - name: sidecar
  107. mountPath: /sidecar
  108. volumes:
  109. - name: sidecar
  110. emptyDir: {}
  111. - configMap:
  112. name: item-service
  113. name: config
  114. ---
  115. apiVersion: apps/v1
  116. kind: Deployment
  117. metadata:
  118. name: svc-order
  119. namespace: deepflow-otel-spring-demo
  120. spec:
  121. replicas: 1
  122. selector:
  123. matchLabels:
  124. app: svc-order
  125. template:
  126. metadata:
  127. labels:
  128. app: svc-order
  129. version: latest
  130. spec:
  131. affinity:
  132. podAntiAffinity:
  133. preferredDuringSchedulingIgnoredDuringExecution:
  134. - weight: 100
  135. podAffinityTerm:
  136. labelSelector:
  137. matchExpressions:
  138. - key: app
  139. operator: In
  140. values:
  141. - svc-item
  142. - svc-order
  143. - svc-stock
  144. - svc-user
  145. - web-shop
  146. - loadgenerator
  147. - db-demo
  148. - nacos
  149. topologyKey: "kubernetes.io/hostname"
  150. containers:
  151. - name: svc-order
  152. image: registry.cn-beijing.aliyuncs.com/deepflow-demo/skywalking-demo_mydemo-order:1.0
  153. command:
  154. - sh
  155. args:
  156. - /home/docker-entrypoint.sh
  157. - '-javaagent:/sidecar/agent/opentelemetry-javaagent.jar'
  158. - '-Dotel.resource.attributes=service.name=order-svc'
  159. - '-Dotel.traces.exporter=otlp'
  160. - '-DAPP_NAME=SPRING'
  161. - '-Dotel.resource.attributes=app.name=SPRING'
  162. - '-jar'
  163. - /home/order-service-0.0.1-SNAPSHOT.jar
  164. imagePullPolicy: IfNotPresent
  165. env:
  166. - name: MYSQL_HOST
  167. value: "db-demo"
  168. - name: SERVICE_HOST
  169. valueFrom:
  170. fieldRef:
  171. fieldPath: status.podIP
  172. - name: SERVICE_PORT
  173. value: "20880"
  174. - name: SW_AGENT_NAME
  175. value: spring-svc-order
  176. - name: OTEL_EXPORTER_OTLP_ENDPOINT
  177. value: http://otel-collector-opentelemetry-collector.observe.svc.cluster.local:4317
  178. ports:
  179. - containerPort: 20880
  180. volumeMounts:
  181. - name: sidecar
  182. mountPath: /sidecar
  183. initContainers:
  184. - name: sidecar
  185. image: registry.cn-beijing.aliyuncs.com/deepflow-demo/opentelemetry-javaagent:1.15.0
  186. command:
  187. - /bin/sh
  188. args:
  189. - '-c'
  190. - cp -R /opentelemetry/agent /sidecar/
  191. volumeMounts:
  192. - name: sidecar
  193. mountPath: /sidecar
  194. volumes:
  195. - name: sidecar
  196. emptyDir: {}
  197. - configMap:
  198. name: order-service
  199. name: config
  200. ---
  201. apiVersion: apps/v1
  202. kind: Deployment
  203. metadata:
  204. name: svc-stock
  205. namespace: deepflow-otel-spring-demo
  206. spec:
  207. replicas: 1
  208. selector:
  209. matchLabels:
  210. app: svc-stock
  211. template:
  212. metadata:
  213. labels:
  214. app: svc-stock
  215. version: latest
  216. spec:
  217. affinity:
  218. podAntiAffinity:
  219. preferredDuringSchedulingIgnoredDuringExecution:
  220. - weight: 100
  221. podAffinityTerm:
  222. labelSelector:
  223. matchExpressions:
  224. - key: app
  225. operator: In
  226. values:
  227. - svc-item
  228. - svc-order
  229. - svc-stock
  230. - svc-user
  231. - web-shop
  232. - loadgenerator
  233. - db-demo
  234. - nacos
  235. topologyKey: "kubernetes.io/hostname"
  236. containers:
  237. - name: svc-stock
  238. image: registry.cn-beijing.aliyuncs.com/deepflow-demo/skywalking-demo_mydemo-stock:1.0
  239. command:
  240. - sh
  241. args:
  242. - /home/docker-entrypoint.sh
  243. - '-javaagent:/sidecar/agent/opentelemetry-javaagent.jar'
  244. - '-Dotel.resource.attributes=service.name=stock-svc'
  245. - '-Dotel.traces.exporter=otlp'
  246. - '-DAPP_NAME=SPRING'
  247. - '-Dotel.resource.attributes=app.name=SPRING'
  248. - '-jar'
  249. - /home/stock-service-0.0.1-SNAPSHOT.jar
  250. imagePullPolicy: IfNotPresent
  251. env:
  252. - name: SERVICE_HOST
  253. valueFrom:
  254. fieldRef:
  255. fieldPath: status.podIP
  256. - name: SERVICE_PORT
  257. value: "20880"
  258. - name: SW_AGENT_NAME
  259. value: spring-svc-stock
  260. - name: OTEL_EXPORTER_OTLP_ENDPOINT
  261. value: http://otel-collector-opentelemetry-collector.observe.svc.cluster.local:4317
  262. ports:
  263. - containerPort: 20880
  264. volumeMounts:
  265. - name: sidecar
  266. mountPath: /sidecar
  267. - name: config
  268. mountPath: /home/application.yml
  269. subPath: application.yml
  270. initContainers:
  271. - name: sidecar
  272. image: registry.cn-beijing.aliyuncs.com/deepflow-demo/opentelemetry-javaagent:1.15.0
  273. command:
  274. - /bin/sh
  275. args:
  276. - '-c'
  277. - cp -R /opentelemetry/agent /sidecar/
  278. volumeMounts:
  279. - name: sidecar
  280. mountPath: /sidecar
  281. volumes:
  282. - name: sidecar
  283. emptyDir: {}
  284. - configMap:
  285. name: stock-service
  286. name: config
  287. ---
  288. apiVersion: apps/v1
  289. kind: Deployment
  290. metadata:
  291. name: svc-user
  292. namespace: deepflow-otel-spring-demo
  293. spec:
  294. replicas: 1
  295. selector:
  296. matchLabels:
  297. app: svc-user
  298. template:
  299. metadata:
  300. labels:
  301. app: svc-user
  302. version: latest
  303. spec:
  304. affinity:
  305. podAntiAffinity:
  306. preferredDuringSchedulingIgnoredDuringExecution:
  307. - weight: 100
  308. podAffinityTerm:
  309. labelSelector:
  310. matchExpressions:
  311. - key: app
  312. operator: In
  313. values:
  314. - svc-item
  315. - svc-order
  316. - svc-stock
  317. - svc-user
  318. - web-shop
  319. - loadgenerator
  320. - db-demo
  321. - nacos
  322. topologyKey: "kubernetes.io/hostname"
  323. containers:
  324. - name: svc-user
  325. image: registry.cn-beijing.aliyuncs.com/deepflow-demo/skywalking-demo_mydemo-user:1.0
  326. command:
  327. - sh
  328. args:
  329. - /home/docker-entrypoint.sh
  330. - '-javaagent:/sidecar/agent/opentelemetry-javaagent.jar'
  331. - '-Dotel.resource.attributes=service.name=user-svc'
  332. - '-Dotel.traces.exporter=otlp'
  333. - '-DAPP_NAME=SPRING'
  334. - '-Dotel.resource.attributes=app.name=SPRING'
  335. - '-jar'
  336. - /home/user-service-0.0.1-SNAPSHOT.jar
  337. imagePullPolicy: IfNotPresent
  338. env:
  339. - name: MYSQL_HOST
  340. value: "db-demo"
  341. - name: SERVICE_HOST
  342. valueFrom:
  343. fieldRef:
  344. fieldPath: status.podIP
  345. - name: SERVICE_PORT
  346. value: "20880"
  347. - name: SW_AGENT_NAME
  348. value: spring-svc-user
  349. - name: OTEL_EXPORTER_OTLP_ENDPOINT
  350. value: http://otel-collector-opentelemetry-collector.observe.svc.cluster.local:4317
  351. ports:
  352. - containerPort: 20880
  353. volumeMounts:
  354. - name: sidecar
  355. mountPath: /sidecar
  356. - name: config
  357. mountPath: /home/application.yml
  358. subPath: application.yml
  359. initContainers:
  360. - name: sidecar
  361. image: registry.cn-beijing.aliyuncs.com/deepflow-demo/opentelemetry-javaagent:1.15.0
  362. command:
  363. - /bin/sh
  364. args:
  365. - '-c'
  366. - cp -R /opentelemetry/agent /sidecar/
  367. volumeMounts:
  368. - name: sidecar
  369. mountPath: /sidecar
  370. volumes:
  371. - name: sidecar
  372. emptyDir: {}
  373. - configMap:
  374. name: user-service
  375. name: config
  376. ---
  377. apiVersion: apps/v1
  378. kind: Deployment
  379. metadata:
  380. name: web-shop
  381. namespace: deepflow-otel-spring-demo
  382. spec:
  383. replicas: 1
  384. selector:
  385. matchLabels:
  386. app: web-shop
  387. template:
  388. metadata:
  389. labels:
  390. app: web-shop
  391. version: latest
  392. spec:
  393. affinity:
  394. podAntiAffinity:
  395. preferredDuringSchedulingIgnoredDuringExecution:
  396. - weight: 100
  397. podAffinityTerm:
  398. labelSelector:
  399. matchExpressions:
  400. - key: app
  401. operator: In
  402. values:
  403. - svc-item
  404. - svc-order
  405. - svc-stock
  406. - svc-user
  407. - web-shop
  408. - loadgenerator
  409. - db-demo
  410. - nacos
  411. topologyKey: "kubernetes.io/hostname"
  412. containers:
  413. - name: web-shop
  414. image: registry.cn-beijing.aliyuncs.com/deepflow-demo/skywalking-demo_mydemo-shopweb:1.0
  415. command:
  416. - sh
  417. args:
  418. - /home/docker-entrypoint.sh
  419. - '-javaagent:/sidecar/agent/opentelemetry-javaagent.jar'
  420. - '-Dotel.resource.attributes=service.name=shop-web'
  421. - '-Dotel.traces.exporter=otlp'
  422. - '-DAPP_NAME=SPRING'
  423. - '-Dotel.resource.attributes=app.name=SPRING'
  424. - '-jar'
  425. - /home/shop-web-0.0.1-SNAPSHOT.jar
  426. imagePullPolicy: IfNotPresent
  427. ports:
  428. - containerPort: 8090
  429. env:
  430. - name: SW_AGENT_NAME
  431. value: spring-svc-webshop
  432. - name: OTEL_EXPORTER_OTLP_ENDPOINT
  433. value: http://otel-collector-opentelemetry-collector.observe.svc.cluster.local:4317
  434. volumeMounts:
  435. - name: sidecar
  436. mountPath: /sidecar
  437. initContainers:
  438. - name: sidecar
  439. image: registry.cn-beijing.aliyuncs.com/deepflow-demo/opentelemetry-javaagent:1.15.0
  440. command:
  441. - /bin/sh
  442. args:
  443. - '-c'
  444. - cp -R /opentelemetry/agent /sidecar/
  445. volumeMounts:
  446. - name: sidecar
  447. mountPath: /sidecar
  448. volumes:
  449. - name: sidecar
  450. emptyDir: {}
  451. ---
  452. apiVersion: apps/v1
  453. kind: Deployment
  454. metadata:
  455. name: loadgenerator
  456. namespace: deepflow-otel-spring-demo
  457. spec:
  458. replicas: 1
  459. selector:
  460. matchLabels:
  461. app: loadgenerator
  462. template:
  463. metadata:
  464. labels:
  465. app: loadgenerator
  466. version: latest
  467. spec:
  468. affinity:
  469. podAntiAffinity:
  470. preferredDuringSchedulingIgnoredDuringExecution:
  471. - weight: 100
  472. podAffinityTerm:
  473. labelSelector:
  474. matchExpressions:
  475. - key: app
  476. operator: In
  477. values:
  478. - svc-item
  479. - svc-order
  480. - svc-stock
  481. - svc-user
  482. - web-shop
  483. - loadgenerator
  484. - db-demo
  485. - nacos
  486. topologyKey: "kubernetes.io/hostname"
  487. containers:
  488. - name: loadgenerator
  489. image: registry.cn-beijing.aliyuncs.com/deepflow-demo/skywalking-demo_loadgenerator:latest
  490. env:
  491. - name: FRONTEND_ADDR
  492. value: web-shop:8090
  493. - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
  494. value: http://otel-collector-opentelemetry-collector.observe.svc.cluster.local:4317
  495. - name: OTEL_RESOURCE_ATTRIBUTES
  496. value: service.name=loadgenerator
  497. - name: USERS
  498. value: '1'
  499. ##################################################################################################
  500. # StatefulSets
  501. ##################################################################################################
  502. ---
  503. apiVersion: apps/v1
  504. kind: StatefulSet
  505. metadata:
  506. name: db-demo
  507. namespace: deepflow-otel-spring-demo
  508. spec:
  509. replicas: 1
  510. serviceName: db-demo
  511. selector:
  512. matchLabels:
  513. app: db-demo
  514. template:
  515. metadata:
  516. labels:
  517. app: db-demo
  518. version: 5.7.18
  519. spec:
  520. affinity:
  521. podAntiAffinity:
  522. preferredDuringSchedulingIgnoredDuringExecution:
  523. - weight: 100
  524. podAffinityTerm:
  525. labelSelector:
  526. matchExpressions:
  527. - key: app
  528. operator: In
  529. values:
  530. - svc-item
  531. - svc-order
  532. - svc-stock
  533. - svc-user
  534. - web-shop
  535. - loadgenerator
  536. - db-demo
  537. - nacos
  538. topologyKey: "kubernetes.io/hostname"
  539. containers:
  540. - name: db-demo
  541. image: registry.cn-beijing.aliyuncs.com/deepflow-demo/skywalking-demo_mydemo-mysql:1.0
  542. imagePullPolicy: IfNotPresent
  543. env:
  544. - name: MYSQL_ROOT_PASSWORD
  545. value: "123"
  546. ports:
  547. - containerPort: 3306
  548. readinessProbe:
  549. exec:
  550. command: ["mysql", "-hlocalhost", "-uroot", "-p123", "-P3306", "--database", "skywalking", "-e", "SELECT 1"]
  551. initialDelaySeconds: 15
  552. periodSeconds: 5
  553. timeoutSeconds: 2
  554. ---
  555. apiVersion: apps/v1
  556. kind: StatefulSet
  557. metadata:
  558. name: nacos
  559. namespace: deepflow-otel-spring-demo
  560. spec:
  561. replicas: 1
  562. serviceName: nacos
  563. selector:
  564. matchLabels:
  565. app: nacos
  566. template:
  567. metadata:
  568. labels:
  569. app: nacos
  570. version: 1.1.4
  571. spec:
  572. affinity:
  573. podAntiAffinity:
  574. preferredDuringSchedulingIgnoredDuringExecution:
  575. - weight: 100
  576. podAffinityTerm:
  577. labelSelector:
  578. matchExpressions:
  579. - key: app
  580. operator: In
  581. values:
  582. - svc-item
  583. - svc-order
  584. - svc-stock
  585. - svc-user
  586. - web-shop
  587. - loadgenerator
  588. - db-demo
  589. - nacos
  590. topologyKey: "kubernetes.io/hostname"
  591. containers:
  592. - name: nacos
  593. image: registry.cn-beijing.aliyuncs.com/deepflow-demo/skywalking-demo_mydemo-nacos-server:1.1.4
  594. imagePullPolicy: IfNotPresent
  595. env:
  596. - name: MYSQL_HOST
  597. value: "db-demo"
  598. - name: MODE
  599. value: standalone
  600. ports:
  601. - containerPort: 8848
  602. readinessProbe:
  603. httpGet:
  604. path: /nacos
  605. port: 8848
  606. initialDelaySeconds: 3
  607. periodSeconds: 5
  608. timeoutSeconds: 2
  609. ---
  610. ##################################################################################################
  611. # ConfigMaps
  612. ##################################################################################################
  613. apiVersion: v1
  614. data:
  615. application.yml: |
  616. spring:
  617. main:
  618. allow-bean-definition-overriding: true
  619. output:
  620. ansi:
  621. enabled: always
  622. application:
  623. name: item
  624. nacos:
  625. address: ${NACOS_HOST:localhost}:8848
  626. dubbo:
  627. filter:
  628. application: # see com.alibaba.dubbo.config.ApplicationConfig
  629. id: ${application.name}-srv
  630. name: ${application.name}-srv
  631. qosEnable: false
  632. protocol: # see com.alibaba.dubbo.config.ProtocolConfig
  633. id: rest
  634. name: rest
  635. host: ${SERVICE_HOST:localhost} # Use POD IP to register Dubbo service
  636. port: ${SERVICE_PORT:20880}
  637. threads: 3
  638. iothreads: 1
  639. server: netty
  640. client: netty
  641. status: server
  642. serialization: fst
  643. queues: 0
  644. keepAlive: true
  645. registry: # see com.alibaba.dubbo.config.RegistryConfig
  646. address: nacos://${nacos.address}
  647. check: false
  648. provider:
  649. cluster: failfast
  650. retries: 0
  651. loadbalance: roundrobin
  652. timeout: 10000
  653. filter: ${dubbo.filter}
  654. zipkin:
  655. server: ${zipkin.base-url}/api/v2/spans
  656. connectTimeout: 5000
  657. readTimeout: 5000
  658. kind: ConfigMap
  659. metadata:
  660. name: item-service
  661. namespace: deepflow-otel-spring-demo
  662. ---
  663. apiVersion: v1
  664. data:
  665. application.yml: |
  666. spring:
  667. main:
  668. allow-bean-definition-overriding: true
  669. output:
  670. ansi:
  671. enabled: always
  672. datasource:
  673. driver-class-name: ${mysql.driver-class}
  674. url: jdbc:mysql://${mysql.host}:${mysql.port}/${db.order}?connectTimeout=3000&socketTimeout=10000&characterEncoding=utf8&useTimezone=true&serverTimezone=Asia/Shanghai&useSSL=false${jdbc.interceptors}
  675. username: ${mysql.user}
  676. password: ${mysql.password}
  677. application:
  678. name: order
  679. nacos:
  680. address: ${NACOS_HOST:localhost}:8848
  681. dubbo:
  682. filter:
  683. application: # see com.alibaba.dubbo.config.ApplicationConfig
  684. id: ${application.name}-srv
  685. name: ${application.name}-srv
  686. qosEnable: false
  687. protocol: # see com.alibaba.dubbo.config.ProtocolConfig
  688. id: rest
  689. name: rest
  690. host: ${SERVICE_HOST:localhost} # Use POD IP to register Dubbo service
  691. port: ${SERVICE_PORT:20883}
  692. threads: 3
  693. iothreads: 1
  694. server: netty
  695. client: netty
  696. status: server
  697. serialization: fst
  698. queues: 0
  699. keepAlive: true
  700. registry: # see com.alibaba.dubbo.config.RegistryConfig
  701. address: nacos://${nacos.address}
  702. check: false
  703. provider:
  704. cluster: failfast
  705. retries: 0
  706. loadbalance: roundrobin
  707. timeout: 10000
  708. filter: ${dubbo.filter}
  709. consumer:
  710. filter: ${dubbo.filter}
  711. # Fault tolerance. Options: failover/failfast/failsafe/failback/forking
  712. cluster: failfast
  713. # Load balancing strategy. Options: random, roundrobin(polling), leastactive(invoking least active service)
  714. loadbalance: roundrobin
  715. druid:
  716. defaultAutoCommit: true
  717. defaultTransactionIsolation: 2
  718. initialSize: 1
  719. maxActive: 3
  720. maxWait: 10000
  721. minIdle: 1
  722. validationQuery: /* ping */ select 1
  723. testOnBorrow: false
  724. testOnReturn: false
  725. testWhileIdle: true
  726. timeBetweenEvictionRunsMillis: 60000
  727. minEvictableIdleTimeMillis: 1800000
  728. removeAbandoned: true
  729. removeAbandonedTimeout: 1800
  730. logAbandoned: true
  731. mybatis: # see MybatisProperties.class in mybatis-spring-boot-autoconfigure
  732. mapperLocations: classpath:mappers/*.xml
  733. seata:
  734. enabled: true
  735. application-id: ${application.name}
  736. tx-service-group: my_demo_gtx
  737. config:
  738. type: nacos
  739. nacos:
  740. namespace:
  741. serverAddr: ${nacos.address}
  742. registry:
  743. type: nacos
  744. nacos:
  745. cluster: default
  746. server-addr: ${nacos.address}
  747. namespace:
  748. zipkin:
  749. server: ${zipkin.base-url}/api/v2/spans
  750. connectTimeout: 5000
  751. readTimeout: 5000
  752. kind: ConfigMap
  753. metadata:
  754. name: order-service
  755. namespace: deepflow-otel-spring-demo
  756. ---
  757. apiVersion: v1
  758. data:
  759. application.yml: |
  760. spring:
  761. main:
  762. allow-bean-definition-overriding: true
  763. output:
  764. ansi:
  765. enabled: always
  766. application:
  767. name: stock
  768. nacos:
  769. address: ${NACOS_HOST:localhost}:8848
  770. dubbo:
  771. filter:
  772. application: # see com.alibaba.dubbo.config.ApplicationConfig
  773. id: ${application.name}-srv
  774. name: ${application.name}-srv
  775. qosEnable: false
  776. protocol: # see com.alibaba.dubbo.config.ProtocolConfig
  777. id: rest
  778. name: rest
  779. host: ${SERVICE_HOST:localhost} # Use POD IP to register Dubbo service
  780. port: ${SERVICE_PORT:20881}
  781. threads: 3
  782. iothreads: 1
  783. server: netty
  784. client: netty
  785. status: server
  786. serialization: fst
  787. queues: 0
  788. keepAlive: true
  789. registry: # see com.alibaba.dubbo.config.RegistryConfig
  790. address: nacos://${nacos.address}
  791. check: false
  792. provider:
  793. cluster: failfast
  794. retries: 0
  795. loadbalance: roundrobin
  796. timeout: 10000
  797. filter: ${dubbo.filter}
  798. zipkin:
  799. server: ${zipkin.base-url}/api/v2/spans
  800. connectTimeout: 5000
  801. readTimeout: 5000
  802. kind: ConfigMap
  803. metadata:
  804. name: stock-service
  805. namespace: deepflow-otel-spring-demo
  806. ---
  807. apiVersion: v1
  808. data:
  809. application.yml: |
  810. mysql:
  811. driver-class: com.mysql.jdbc.Driver
  812. host: ${MYSQL_HOST:localhost}
  813. port: ${MYSQL_PORT:3306}
  814. user: mydemo
  815. password: mydemo
  816. db:
  817. order: mydemo-dn1
  818. user: mydemo-dn1
  819. jdbc:
  820. interceptors:
  821. nacos:
  822. address: ${NACOS_HOST:localhost}:8848
  823. spring:
  824. main:
  825. allow-bean-definition-overriding: true
  826. output:
  827. ansi:
  828. enabled: always
  829. datasource:
  830. driver-class-name: ${mysql.driver-class}
  831. url: jdbc:mysql://${mysql.host}:${mysql.port}/${db.user}?connectTimeout=3000&socketTimeout=10000&characterEncoding=utf8&useTimezone=true&serverTimezone=Asia/Shanghai&useSSL=false${jdbc.interceptors}
  832. username: ${mysql.user}
  833. password: ${mysql.password}
  834. application:
  835. name: user
  836. dubbo:
  837. filter:
  838. application: # see com.alibaba.dubbo.config.ApplicationConfig
  839. id: ${application.name}-srv
  840. name: ${application.name}-srv
  841. qosEnable: false
  842. protocol: # see com.alibaba.dubbo.config.ProtocolConfig
  843. id: rest
  844. name: rest
  845. host: ${SERVICE_HOST:localhost} # Use POD IP to register Dubbo service
  846. port: ${SERVICE_PORT:20882}
  847. threads: 3
  848. iothreads: 1
  849. server: netty
  850. client: netty
  851. status: server
  852. serialization: fst
  853. queues: 0
  854. keepAlive: true
  855. registry: # see com.alibaba.dubbo.config.RegistryConfig
  856. address: nacos://${nacos.address}
  857. check: false
  858. provider:
  859. cluster: failfast
  860. retries: 0
  861. loadbalance: roundrobin
  862. timeout: 10000
  863. filter: ${dubbo.filter}
  864. druid:
  865. defaultAutoCommit: true
  866. defaultTransactionIsolation: 2
  867. initialSize: 1
  868. maxActive: 3
  869. maxWait: 5000
  870. minIdle: 1
  871. validationQuery: /* ping */ select 1
  872. testOnBorrow: false
  873. testOnReturn: false
  874. testWhileIdle: true
  875. timeBetweenEvictionRunsMillis: 60000
  876. minEvictableIdleTimeMillis: 1800000
  877. removeAbandoned: true
  878. removeAbandonedTimeout: 1800
  879. logAbandoned: true
  880. mybatis: # see MybatisProperties.class in mybatis-spring-boot-autoconfigure
  881. mapperLocations: classpath:mappers/*.xml
  882. seata:
  883. enabled: true
  884. application-id: ${application.name}
  885. tx-service-group: my_demo_gtx
  886. config:
  887. type: nacos
  888. nacos:
  889. namespace:
  890. serverAddr: ${nacos.address}
  891. registry:
  892. type: nacos
  893. nacos:
  894. cluster: default
  895. server-addr: ${nacos.address}
  896. namespace:
  897. zipkin:
  898. server: ${zipkin.base-url}/api/v2/spans
  899. connectTimeout: 5000
  900. readTimeout: 5000
  901. mydemo:
  902. hostname: ${HOSTNAME:localhost}
  903. kind: ConfigMap
  904. metadata:
  905. name: user-service
  906. namespace: deepflow-otel-spring-demo
  907. ---
  908. ##################################################################################################
  909. # Services
  910. ##################################################################################################
  911. kind: Service
  912. apiVersion: v1
  913. metadata:
  914. name: nacos
  915. namespace: deepflow-otel-spring-demo
  916. spec:
  917. type: ClusterIP
  918. ports:
  919. - name: http-nacos
  920. port: 8848
  921. targetPort: 8848
  922. selector:
  923. app: nacos
  924. ---
  925. kind: Service
  926. apiVersion: v1
  927. metadata:
  928. name: web-shop
  929. namespace: deepflow-otel-spring-demo
  930. spec:
  931. type: ClusterIP
  932. ports:
  933. - name: http-shop
  934. port: 8090
  935. targetPort: 8090
  936. selector:
  937. app: web-shop
  938. ---
  939. kind: Service
  940. apiVersion: v1
  941. metadata:
  942. name: db-demo
  943. namespace: deepflow-otel-spring-demo
  944. spec:
  945. type: ClusterIP
  946. ports:
  947. - name: mysql
  948. port: 3306
  949. targetPort: 3306
  950. selector:
  951. app: db-demo