基于Kubernetes的微服务部署与测试实践
1. 第一个示例:在Kubernetes中运行微服务
1.1 配置文件示例
以下是Product Web Pod的YAML文件示例:
apiVersion: apps/v1
kind: Deployment
metadata:
name: product-web
...
spec:
replicas: 3
...
template:
...
spec:
containers:
...
env:
- name: spring.kafka.bootstrap-servers
value: kafka-1-ip-service:9092
这里为Product Web微服务和Product Server微服务都配置了三个副本。
1.2 运行微服务步骤
1.2.1 启动Minikube单节点Kubernetes集群
(base) binildass-MacBook-Pro:~ binil$ minikube start
minikube v1.25.2 on Darwin 12.4
...
Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
(base) bini
超级会员免费看
订阅专栏 解锁全文
776

被折叠的 条评论
为什么被折叠?



