首页 > 其他分享 >如何远程调试k8s里的jettypod

如何远程调试k8s里的jettypod

时间:2022-12-12 14:01:14浏览次数:50  
标签:xml jettypod jar jetty etc XX k8s true 调试


 

课程内容:各种k8s部署方式。包括minikube部署,kubeadm部署,kubeasz部署,rancher部署,k3s部署。包括开发测试环境部署k8s,和生产环境部署k8s。

介绍主要的k8s资源的使用配置和命令。包括configmap,pod,service,replicaset,namespace,deployment,daemonset,ingress,pv,pvc,sc,role,rolebinding,clusterrole,clusterrolebinding,secret,serviceaccount,statefulset,job,cronjob,podDisruptionbudget,podSecurityPolicy,networkPolicy,resourceQuota,limitrange,endpoint,event,conponentstatus,node,apiservice,controllerRevision等。

详细介绍helm命令,学习helm chart语法,编写helm chart。深入分析各项目源码,学习编写helm插件
————————————————

#===========================================================
# Jetty start.jar arguments
# Each line of this file is prepended to the command line
# arguments # of a call to:
# java -jar start.jar [arg...]
#===========================================================



#===========================================================
# If the arguements in this file include JVM arguments
# (eg -Xmx512m) or JVM System properties (eg com.sun.???),
# then these will not take affect unless the --exec
# parameter is included or if the output from --dry-run
# is executed like:
# eval $(java -jar start.jar --dry-run)
#
# Below are some recommended options for Sun's JRE
#-----------------------------------------------------------
--exec
# -Dorg.apache.jasper.compiler.disablejsr199=true
# -Dcom.sun.management.jmxremote
# -Dorg.eclipse.jetty.util.log.IGNORED=true
# -Dorg.eclipse.jetty.LEVEL=DEBUG
# -Dorg.eclipse.jetty.util.log.stderr.SOURCE=true
-server
-verbose:gc
-Xms1024m
-Xmx1024m
-Xmn512m
-XX:PermSize=128m
-XX:MaxPermSize=128m
-XX:ParallelGCThreads=1
-Djava.security.egd=file:/dev/./urandom
-XX:+PrintGCDetails
-XX:+PrintGCDateStamps
-Djava.awt.headless=true
-Djava.net.preferIPv4Stack=true
-Dsun.net.client.defaultConnectTimeout=10000
-Dsun.net.client.defaultReadTimeout=30000
-Djava.net.preferIPv4Stack=true
#-Xloggc:../logs/gc.log
# -XX:+PrintGCTimeStamps
# -XX:+PrintTenuringDistribution
# -XX:+PrintCommandLineFlags
# -XX:+DisableExplicitGC
# -XX:+UseConcMarkSweepGC
# -XX:ParallelCMSThreads=2
# -XX:+CMSClassUnloadingEnabled
# -XX:+UseCMSCompactAtFullCollection
# -XX:CMSInitiatingOccupancyFraction=80
#-----------------------------------------------------------

-Xdebug
-Xrunjdwp:transport=dt_socket,address=26666,server=y,suspend=n
#===========================================================
# Start classpath OPTIONS.
# These control what classes are on the classpath
# for a full listing do
# java -jar start.jar --list-options
#-----------------------------------------------------------
#OPTIONS=Server,jsp,jmx,resources,websocket,ext,plus,annotations
OPTIONS=Server,jsp
#-----------------------------------------------------------


#===========================================================
# Configuration files.
# For a full list of available configuration files do
# java -jar start.jar --help
#-----------------------------------------------------------
#etc/jetty-jmx.xml
#etc/jetty.xml
## etc/jetty-annotations.xml
# etc/jetty-ssl.xml
# etc/jetty-requestlog.xml
#etc/jetty-deploy.xml
#etc/jetty-overlay.xml
#etc/jetty-webapps.xml
#etc/jetty-contexts.xml
## etc/jetty-testrealm.xml
#===========================================================

修改jetty.ini配置文件加上:

 

-Xdebug
-Xrunjdwp:transport=dt_socket,address=26666,server=y,suspend=n

26666是调试端口.

创建一个nodePort类型的service

apiVersion: v1
kind: Service
metadata:
creationTimestamp: 2018-05-07T12:13:23Z
labels:
app: liward
name: liward-web
namespace: dev-app
resourceVersion: "1980618"
selfLink: /api/v1/namespaces/dev-app/services/liward-web
uid: 09b7cd71-51f0-11e8-8c57-002197403677
spec:
clusterIP: 10.103.193.113
externalTrafficPolicy: Cluster
ports:
- name: http
nodePort: 32730
port: 8080
protocol: TCP
targetPort: 8080
- name: debug
nodePort: 30001
port: 26666
protocol: TCP
targetPort: 26666
selector:
app: liward
sessionAffinity: None
type: NodePort
status:
loadBalancer: {

看到targetPort和调试端口一致。

30001为客户端连接调试端口。

然后就可以用hostIp+30001调试pod里的容器了

标签:xml,jettypod,jar,jetty,etc,XX,k8s,true,调试
From: https://blog.51cto.com/u_11979904/5929559

相关文章

  • k8s中安装jenkins
    编写jenkins.yaml说明:容器跑起来后,jenkins的目录是/var/jenkins_home存储卷用的是hostPath,这里面我们指定pod调度到k8s-master01在k8s-master01上创建目录:mkdir/da......
  • vscode+gdbserver 开发板调试
    参考嵌入式gdb+gdbserver调试环境搭建与使用参考嵌入式VSCode+gdbserver图形化调试环境搭建与使用参考VSCode+gdbserver嵌入式arm远程调试参考stepbystep使用g......
  • 使用 VSCode 远程 图形化 GDB 调试 嵌入式linux
     目录标题引言环境步骤vscoderemotessh配置Linux编译机配置设备板端配置vscodelaunch设置调试引言之前说了,通过coredump找程序bug,但是有些时候......
  • k8s容器内部通过Prometheus Operator部署MySQL Exporter监控k8s集群外部的MySQL
    写在前面在按照下面步骤操作之前,请先确保服务器已经部署k8s,prometheus,prometheusoperator,关于这些环境的部署,可以自行查找相关资料安装部署,本文档便不在此赘述。关于pro......
  • C++爬虫如何进行多线程调试
    我们知道在爬虫钱进行多线程调试是非常重要的,之前我们也有讨论过程序调试,今天我们还将继续在这里深入的讲解下软件调试的一些内容。比如说常见的条件断点,数据断点,多线程断点......
  • k8s在pod内访问集群外部地址
    一.使用IPapiVersion:v1kind:Servicemetadata:name:nginx-ipspec:ports:-protocol:TCPport:88---apiVersion:v1kind:Endpointsmetadat......
  • VMware快速搭建k8s集群 (CentOS-7.9|Docker-19.03.11|K8S-1.19.6|Flannel)kubeadm安装
    0.规划k8s-master192.168.239.120CPU:2核 内存:2G 磁盘:10GCentOS7.9k8s-node1192.168.239.121CPU:2核 内存:2G 磁盘:10GCentOS7.9k8s-node2192......
  • k8s 架构
    k8s基本架构MasterNode:控制面的节点WorkerNode:干活的节点Master中的组件APIServer:APIServer是整个k8s集群的唯一入口。Etcd:持久化存储,存储集群中各种资源的......
  • k8s API
    Job-CronJobJob:临时离线任务CronJob:定时离线任务Yaml文件描述Job:apiVersion:batch/v1kind:Jobmetadata:name:...labels:k:vk:v......
  • k8s Pod
    Pod是k8s的核心对象Pod是在k8s中创造,管理的最小可部署计算单元。通常不需要直接创建Pod,k8s集群中Pod主要有两种用法:运行单个容器的Pod运行包含多个容......