Files
biz_service_ebtp_extend/pro.yaml

117 lines
4.2 KiB
YAML
Raw Permalink Normal View History

apiVersion: apps/v1
kind: Deployment
metadata:
name: biz-service-ebtp-extend #[1] Deployment名称可填写微服务名称
namespace: default
labels:
app: biz-service-ebtp-extend
2021-03-23 16:07:45 +08:00
spec:
replicas: 3
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
selector:
matchLabels:
app: biz-service-ebtp-extend #[2] 选择器匹配时标签名称,可填写微服务名称
template:
metadata:
labels:
app: biz-service-ebtp-extend #[3] 模板名称,可填写微服务名称
annotations:
2021-03-23 16:07:45 +08:00
prometheus.io/port: '18018'
prometheus.io/jl-pod: 'true'
spec:
volumes:
- name: log
persistentVolumeClaim:
claimName: log-pvc
readOnly: false
2021-03-23 16:07:45 +08:00
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- biz-service-ebtp-extend
topologyKey: "kubernetes.io/hostname"
containers:
- name: biz-service-ebtp-extend #[6] 必选,容器名称,可填写微服务名称
image: harbor.dcos.xixian.unicom.local/eshop/biz-service-ebtp-extend:latest #[7] 镜像名称请把biz-service-ebtp-extend替换为服务名称
2021-05-25 15:52:20 +08:00
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 #[8] 容器需要监听的端口号与配置文件中的server.port参数相同与参数[4]相同
2021-03-26 17:06:53 +08:00
#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
2021-03-23 16:07:45 +08:00
resources:
requests:
cpu: 1000m
memory: 2Gi
2021-03-23 16:07:45 +08:00
limits:
cpu: 3000m
memory: 6Gi
env:
- name: APP_NAME
value: biz_ebtp_extend
2021-03-23 16:07:45 +08:00
- name: AGENT_LICENCE
value: 527BFA7B28577578
2021-03-23 16:07:45 +08:00
- name: APOLLO_CONFIGSERVICE
2021-03-23 16:32:24 +08:00
value: http://apollo-configservice:8080
2021-03-23 16:07:45 +08:00
- name: MY_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
2021-04-22 14:18:33 +08:00
- name: JAVA_TOOL_OPTIONS
value:
-XX:+UnlockExperimentalVMOptions
-XX:+UseContainerSupport
-XX:+UseCGroupMemoryLimitForHeap
-XX:InitialRAMPercentage=40.0
-XX:MinRAMPercentage=20.0
-XX:MaxRAMPercentage=80.0
---
kind: Service
apiVersion: v1
metadata:
name: biz-service-ebtp-extend-svc # [11] service的名字格式为“服务名-svc”
namespace: default
labels:
2021-03-23 16:07:45 +08:00
service: biz-service-ebtp-extend-svc # [12] service的标签可与参数[11]相同
annotations:
prometheus.io/port: '18018' #[13] prometheus自动发现service的端口也是该微服务所使用的端口与参数[4]相同
2021-03-23 16:07:45 +08:00
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]相同
---