当前位置:网站首页>开发者openshift4使用入门教程 - 16 - 使用init container挂载pinpoint APM监控
开发者openshift4使用入门教程 - 16 - 使用init container挂载pinpoint APM监控
2022-04-21 14:43:00 【东风微鸣】
tomcat容器安装pinpoint-agent
- [ 准备initcontainers镜像]
Dockerfile文件(参照镜像标准编写)
FROM alpine:latest
LABEL io.openshift.tags="pinpoint-agent"
RUN mkdir /pinpoint-agent \
&& chmod -R u+x /pinpoint-agent \
&& chmod -R g=u /pinpoint-agent /etc/passwd
ADD pinpoint-agent-1.8.4.tar.gz /pinpoint-agent/
CMD ["tail", "-f", "/dev/null"]
- [ 更新yaml文件]
volumes:
- name: pinpoint-agent-1
emptyDir: {}
initContainers:
- name: pinpoint-agent
image: >-
image-registry.openshift-image-registry.svc:5000/pinpoint-agent-test/pinpoint-agent@sha256:4d703d7471e98eb4d66c6e76dc1079d536d7fc746d1a1b6f11e23514c7afde6d
command: ["sh", "-c", "cp -r /pinpoint-agent/* /deployments-pinpoint-agent"]
resources: {}
volumeMounts:
- name: pinpoint-agent-1
mountPath: /deployments-pinpoint-agent
首先定义一个emptyDir类型的卷pinpoint-agent-1,initcontainers容器启动的时候,将这个pinpoint-agent-1卷挂载到/sharedFiles/AppServerAgent目录,并把容器镜像层中的/pinpoint-agent目录下的文件拷贝到pinpoint-agent-1卷下面,然后initContainers的使命完成,正常退出。
containers:
- resources: {}
readinessProbe:
exec:
command:
- /bin/bash
- '-c'
- >-
curl --noproxy '*' -s -u J8KQ7u87:BxgGot20
'http://localhost:8080/manager/jmxproxy/?get=Catalina%3Atype%3DServer&att=stateName'
|grep -iq 'stateName *= *STARTED'
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
terminationMessagePath: /dev/termination-log
name: jws-app
env:
- name: JWS_ADMIN_USERNAME
value: J8KQ7u87
- name: JWS_ADMIN_PASSWORD
value: BxgGot20
- name: PINPOINT_VERSION
value: 1.8.4
- name: AGENT_ID
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: PROJECT_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: JAVA_OPTS
value: >-
-javaagent:/deployments-pinpoint-agent/pinpoint-bootstrap-${PINPOINT_VERSION}-SNAPSHOT.jar
-Dpinpoint.agentId=${AGENT_ID}
-Dpinpoint.applicationName=${PROJECT_NAME}
ports:
- name: jolokia
containerPort: 8778
protocol: TCP
- name: http
containerPort: 8080
protocol: TCP
imagePullPolicy: Always
volumeMounts:
- name: pinpoint-agent-1
mountPath: /deployments-pinpoint-agent
terminationMessagePolicy: File
image: >-
image-registry.openshift-image-registry.svc:5000/pinpoint-agent-test/jws-app@sha256:3b6d7ad4c35d90ff44251ee1ff8f1fe5b3e6ebb55bf3db965d4462ea2490d83e
restartPolicy: Always
terminationGracePeriodSeconds: 60
dnsPolicy: ClusterFirst
securityContext: {}
schedulerName: default-scheduler
tomcat容器上将pod的namespace作为APP_NAME名称,将pod的name作为AGENT_ID,通过JAVA_OPTS变量配置客户端相关参数。
注:和initcontainers容器挂载相同的pinpoint-agent-1卷
版权声明
本文为[东风微鸣]所创,转载请带上原文链接,感谢
https://cloud.tencent.com/developer/article/1985381
边栏推荐
- IK word splitter
- MySQL数据库实际运用(一)
- Analysis on development mode of bounty hunter automatic Trading Robot
- Lightgbm topic 2: detailed explanation of lightgbm training based on pyspark platform
- .Net C# Newtonsoft. JSON serializersettings configuration
- Insect stack
- 专题测试04·多元函数微分学【李艳芳全程班】
- pytorch图像分类篇: 花分类数据集下载和AlexNet网络搭建训练
- 赏金猎人自动交易机器人开发模式分析
- 我们还能依赖Play to Earn经济获利多久?
猜你喜欢

软件测试(三)p51-p104 软件测试用例方法、缺陷

Reproduction of paper -- Libra r-cnn: rewards balanced learning for object detection

The use of toString and wrapper class

Mysql数据库(2)

我们还能依赖Play to Earn经济获利多久?

阿里月薪15k的测试岗,面试原来这么简单

论文复现——Libra R-CNN: Towards Balanced Learning for Object Detection

德鲁伊 数据库链接问题

Dabdetr paper interpretation + core source code interpretation

It's been 2 years since the career change test. Give some advice to girls who are still hesitating
随机推荐
Alibaba cloud R & D collaboration service related agreement terms | cloud efficiency
Ali's monthly salary is 15K. The interview is so simple
虫子 12864
Mysql 执行流程
C语言预处理问题
IK分词器
Translation of mastering ABP framework
软件测试(三)p51-p104 软件测试用例方法、缺陷
The worm inserted hill
制造字母异位词的最小步骤数-c语言解决
UE4锁定Camera画面
WTL self drawing control library (cqstabctrl)
Six best practices for overseas ECS backup and recovery
PCL测试程序出现LNK2001-无法解析的外部符号
LNK2001 - unresolved external symbol in PCL test program
word输入公式快捷键
Experience and guidance of seniors preparing for the postgraduate entrance examination of resources and environment of Dalian University of technology in 2023
Insect double linked list
Insect idol Zhi Huijun, keep up with God
Experience and guidance of seniors preparing for the postgraduate entrance examination of Chinese International Education in Beijing Foreign Studies University in 2023