添加apollo
This commit is contained in:
118
deployment-master.yaml
Normal file
118
deployment-master.yaml
Normal file
@ -0,0 +1,118 @@
|
||||
# 接口版本
|
||||
apiVersion: apps/v1
|
||||
# 接口类型
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: biz-service-ebtp-extend
|
||||
namespace: default
|
||||
labels:
|
||||
app: biz-service-ebtp-extend
|
||||
|
||||
# 必选,详细定义
|
||||
spec:
|
||||
# pod 副本数量
|
||||
replicas: 3
|
||||
|
||||
# 滚动升级配置信息
|
||||
strategy:
|
||||
rollingUpdate:
|
||||
maxSurge: 1
|
||||
maxUnavailable: 1
|
||||
|
||||
# 选择器,匹配pod模板
|
||||
selector:
|
||||
matchLabels:
|
||||
app: biz-service-ebtp-extend
|
||||
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
# 模板名称
|
||||
app: biz-service-ebtp-extend
|
||||
annotations:
|
||||
prometheus.io/port: '18018'
|
||||
prometheus.io/jl-pod: 'true'
|
||||
|
||||
# 定义容器模板,该模板可以包含多个容器
|
||||
spec:
|
||||
volumes:
|
||||
- name: log
|
||||
persistentVolumeClaim:
|
||||
claimName: log-pvc
|
||||
readOnly: false
|
||||
affinity:
|
||||
podAntiAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
- labelSelector:
|
||||
matchExpressions:
|
||||
- key: app
|
||||
operator: In
|
||||
values:
|
||||
- biz-service-ebtp-extend
|
||||
topologyKey: "kubernetes.io/hostname"
|
||||
# 必选,Pod中容器列表
|
||||
containers:
|
||||
- name: biz-service-ebtp-extend
|
||||
image: harbor.dcos.xixian.unicom.local/eshop/biz-service-ebtp-extend:latest
|
||||
args: ["java", "-Djava.security.egd=file:/dev/./urandom", "-javaagent:/pinpoint/tianyan-springboot-agent/pinpoint-bootstrap-1.8.0.jar", "-Dpinpoint.agentId=$(MY_POD_IP)","-Dpinpoint.applicationName=$(APP_NAME)", "-Dpinpoint.licence=$(AGENT_LICENCE_DEV)", "-jar", "/app.jar"]
|
||||
volumeMounts:
|
||||
- name: log
|
||||
mountPath: /log
|
||||
ports:
|
||||
- containerPort: 18018
|
||||
#livenessProbe:
|
||||
# failureThreshold: 3
|
||||
# httpGet:
|
||||
# port: 18018 #[11] pod存活检测端口,修改为该微服务配置文件中server.port的端口号,与参数[5]相同
|
||||
# path: /actuator/prometheus
|
||||
# scheme: HTTP
|
||||
# initialDelaySeconds: 300
|
||||
# periodSeconds: 60
|
||||
# successThreshold: 1
|
||||
# timeoutSeconds: 2
|
||||
#readinessProbe:
|
||||
# failureThreshold: 1
|
||||
# httpGet:
|
||||
# port: 18018 #[12] pod就绪检测端口,修改为该微服务配置文件中server.port的端口号,与参数[5]相同
|
||||
# path: /actuator/prometheus
|
||||
# scheme: HTTP
|
||||
# periodSeconds: 5
|
||||
# successThreshold: 2
|
||||
# timeoutSeconds: 2
|
||||
resources:
|
||||
requests:
|
||||
cpu: 1000m
|
||||
memory: 2Gi
|
||||
limits:
|
||||
cpu: 3000m
|
||||
memory: 6Gi
|
||||
env:
|
||||
- name: AGENT_LICENCE
|
||||
value: 527BFA7B28577578
|
||||
- name: APP_NAME
|
||||
value: biz_service_ebtp_extend
|
||||
- name: APOLLO_CONFIGSERVICE
|
||||
value: http://apollo-configservice:8080
|
||||
- name: MY_POD_IP
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.podIP
|
||||
---
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: biz-service-ebtp-extend-svc # [11] service的名字,格式为“服务名-svc”
|
||||
namespace: default
|
||||
labels:
|
||||
service: biz-service-ebtp-extend-svc # [12] service的标签,可与参数[11]相同
|
||||
annotations:
|
||||
prometheus.io/port: '18018' #[13] prometheus自动发现service的端口,也是该微服务所使用的端口,与参数[4]相同
|
||||
prometheus.io/jl-svc: 'true'
|
||||
|
||||
spec:
|
||||
ports:
|
||||
- port: 18018 #[15] 与参数4相同
|
||||
targetPort: 18018 #[16] 与参数4相同
|
||||
selector:
|
||||
app: biz-service-ebtp-extend #[17] 该service对应Deployment的名字,与参数[1]相同
|
||||
---
|
Reference in New Issue
Block a user