【K8S运维知识汇总】第6天7:dubbo服务消费者连接Apollo
原创
©著作权归作者所有:来自51CTO博客作者一片白纸的原创作品,请联系作者获取转载授权,否则将追究法律责任
文章目录
创建项目
新增配置[zk1]
发布
Jenkins 持续构建
修改资源配置清单
[root@k8s7-200.host.com /data/k8s-yaml/dubbo-demo-consume]# cat deployment.yaml
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: dubbo-demo-consumer
namespace: app
labels:
name: dubbo-demo-consumer
spec:
replicas: 1
selector:
matchLabels:
name: dubbo-demo-consumer
template:
metadata:
labels:
app: dubbo-demo-consumer
name: dubbo-demo-consumer
spec:
containers:
- name: dubbo-demo-consumer
image: harbor.od.com/app/dubbo-demo-consumer:apollo_200819_1310
ports:
- containerPort: 8080
protocol: TCP
- containerPort: 20880
protocol: TCP
env:
- name: JAR_BALL
value: dubbo-client.jar
- name: C_OPTS
value: -Denv=dev -Dapollo.meta=http://config.od.com
imagePullPolicy: IfNotPresent
imagePullSecrets:
- name: harbor
terminationGracePeriodSeconds: 30
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
maxSurge: 1
revisionHistoryLimit: 7
progressDeadlineSeconds: 600
应用资源配置清单
[root@k8s7-22.host.com ~]# kubectl apply -f http://k8s-yaml.od.com/dubbo-demo-consume/deployment.yaml
查看pod日志
验证demo
1.修改代码
2.Jenkins构建
3.修改dp.yaml(镜像名称)
4.kubelet apply -f …
5.查看pod日志
6.验证demo是否更新