文章目录


创建项目

【K8S运维知识汇总】第6天7:dubbo服务消费者连接Apollo_jar

新增配置[zk1]

【K8S运维知识汇总】第6天7:dubbo服务消费者连接Apollo_jar_02

发布

【K8S运维知识汇总】第6天7:dubbo服务消费者连接Apollo_创建项目_03


【K8S运维知识汇总】第6天7:dubbo服务消费者连接Apollo_jar_04

Jenkins 持续构建

【K8S运维知识汇总】第6天7:dubbo服务消费者连接Apollo_创建项目_05


【K8S运维知识汇总】第6天7:dubbo服务消费者连接Apollo_创建项目_06

修改资源配置清单

[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日志

【K8S运维知识汇总】第6天7:dubbo服务消费者连接Apollo_jar_07


【K8S运维知识汇总】第6天7:dubbo服务消费者连接Apollo_创建项目_08

验证demo

【K8S运维知识汇总】第6天7:dubbo服务消费者连接Apollo_jar_09

1.修改代码
2.Jenkins构建
3.修改dp.yaml(镜像名称)
4.kubelet apply -f
5.查看pod日志
6.验证demo是否更新