当前位置: 首页 > news >正文

越秀网站建设优化呼和浩特住房和城乡建设部网站

越秀网站建设优化,呼和浩特住房和城乡建设部网站,南昌p2p网站建设,ssc网站建设交流群通常情况下#xff0c;业务容器所使用的镜像是非常精简的#xff0c;而一旦业务容器出现问题#xff0c;通过kubectl exec进入到容器时#xff0c;我们会发现自己需要使用的工具都没有#xff0c;也无法通过apt, apt-get, yum等包管理工具下载需要的工具。 想要解决这个尴…  通常情况下业务容器所使用的镜像是非常精简的而一旦业务容器出现问题通过kubectl exec进入到容器时我们会发现自己需要使用的工具都没有也无法通过apt, apt-get, yum等包管理工具下载需要的工具。 想要解决这个尴尬的窘境有两种手段其一是提前把需要使用的工具打入到镜像当中除了问题我们可以随时进行debug。其二是利用kubectl debug工具。显然第一种方式有很多弊端譬如业务容器镜像过大占用磁盘空间更多另外每个人使用的工具可能会不同我们不可能把所有的工具都打入到镜像当中这是极不合理的。 而如果我们能够把需要的工具打入到一个debug镜像当中需要的时候如果能把这个debug镜像跑起来并且attach到我们需要排查问题的业务容器上同时这两个容器可以共享network, pid名称空间的话就能很好的解决这个问题。而恰好kubectl debug就有这样的功能 kubectl debug命令的帮助文档如下 rootk8s-master1:~# kubectl debug --help Debug cluster resources using interactive debugging containers.debug provides automation for common debugging tasks for cluster objects identified by resource and name. Pods will be used by default if no resource is specified.The action taken by debug varies depending on what resource is specified. Supported actions include:* Workload: Create a copy of an existing pod with certain attributes changed, for example changing the image tag to a new version.* Workload: Add an ephemeral container to an already running pod, for example to add debugging utilities without restarting the pod.* Node: Create a new pod that runs in the nodes host namespaces and can access the nodes filesystem.Examples:# Create an interactive debugging session in pod mypod and immediately attach to it.kubectl debug mypod -it --imagebusybox# Create an interactive debugging session for the pod in the file pod.yaml and immediately attach to it.# (requires the EphemeralContainers feature to be enabled in the cluster)kubectl debug -f pod.yaml -it --imagebusybox# Create a debug container named debugger using a custom automated debugging image.kubectl debug --imagemyproj/debug-tools -c debugger mypod# Create a copy of mypod adding a debug container and attach to itkubectl debug mypod -it --imagebusybox --copy-tomy-debugger# Create a copy of mypod changing the command of mycontainerkubectl debug mypod -it --copy-tomy-debugger --containermycontainer -- sh# Create a copy of mypod changing all container images to busyboxkubectl debug mypod --copy-tomy-debugger --set-image*busybox# Create a copy of mypod adding a debug container and changing container imageskubectl debug mypod -it --copy-tomy-debugger --imagedebian --set-imageappapp:debug,sidecarsidecar:debug# Create an interactive debugging session on a node and immediately attach to it.# The container will run in the host namespaces and the hosts filesystem will be mounted at /hostkubectl debug node/mynode -it --imagebusyboxOptions:--arguments-onlyfalse:If specified, everything after -- will be passed to the new container as Args instead of Command.--attachfalse:If true, wait for the container to start running, and then attach as if kubectl attach ... were called.Default false, unless -i/--stdin is set, in which case the default is true.-c, --container:Container name to use for debug container.--copy-to:Create a copy of the target Pod with this name.--env[]:Environment variables to set in the container.-f, --filename[]:identifying the resource to debug--image:Container image to use for debug container.--image-pull-policy:The image pull policy for the container. If left empty, this value will not be specified by the client anddefaulted by the server.--profilelegacy:Debugging profile. Options are legacy, general, baseline, netadmin, or restricted.-q, --quietfalse:If true, suppress informational messages.--replacefalse:When used with --copy-to, delete the original Pod.--same-nodefalse:When used with --copy-to, schedule the copy of target Pod on the same node.--set-image[]:When used with --copy-to, a list of nameimage pairs for changing container images, similar to how kubectlset image works.--share-processestrue:When used with --copy-to, enable process namespace sharing in the copy.-i, --stdinfalse:Keep stdin open on the container(s) in the pod, even if nothing is attached.--target:When using an ephemeral container, target processes in this container name.-t, --ttyfalse:Allocate a TTY for the debugging container.Usage:kubectl debug (POD | TYPE[[.VERSION].GROUP]/NAME) [ -- COMMAND [args...] ] [options]Use kubectl options for a list of global command-line options (applies to all commands).想要完成上述功能主要是利用--target参数这个参数主要用于指定debug Pod中的哪个容器;--image参数就是用于指定使用哪个镜像来debug这个镜像包含我们需要使用的工具即可。用法如下 rootk8s-master1:~# kubectl get pods NAME READY STATUS RESTARTS AGE mysql-5578b9475d-5fc8d 1/1 Running 1 (130m ago) 156m nginx-deployment-775b6549b5-bgdfp 1/1 Running 2 (130m ago) 3h39m nginx-deployment-775b6549b5-ghz9t 1/1 Running 2 (130m ago) 3h39m nginx-deployment-775b6549b5-pcw82 1/1 Running 1 (130m ago) 167m rootk8s-master1:~# rootk8s-master1:~# kubectl debug mysql-5578b9475d-5fc8d --imageubuntu:20.04 -it --targetmysql Targeting container mysql. If you dont see processes from this container it may be because the container runtime doesnt support this feature. Defaulting debug container name to debugger-jlw5l. If you dont see a command prompt, try pressing enter. rootmysql-5578b9475d-5fc8d:/# rootmysql-5578b9475d-5fc8d:/# ps -aux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND 999 1 0.0 4.8 1163028 195532 ? Ssl 03:26 0:07 mysqld root 128 0.0 0.0 4248 3256 pts/0 Ss 05:40 0:00 bash root 136 0.0 0.0 5900 2780 pts/0 R 05:41 0:00 ps -aux rootmysql-5578b9475d-5fc8d:/# rootmysql-5578b9475d-5fc8d:/# rootmysql-5578b9475d-5fc8d:/# vmstat procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----r b swpd free buff cache si so bi bo in cs us sy id wa st1 0 0 1111892 2120 1823828 0 0 42 346 696 1192 1 4 95 0 0 rootmysql-5578b9475d-5fc8d:/# pidstt
http://www.pierceye.com/news/95766/

相关文章:

  • 网络编辑的网站建设题二手域名交易平台
  • 定制网站开发商业计划书贵南县网站建设公司
  • 如何免费发布个人网站网站项目需求分析
  • 太原免费网站建设网站开发合作协议书
  • 深圳龙华做网站上海响应式网站制作公司
  • 招投标 网站建设专业型网站和个人网站
  • 网站建设需要那些基础增城线上教学
  • 专注移动网站建设免费咨询电脑维修
  • 六里桥做网站公司惠州做网站 百度优化
  • 做网站怎么选择上市公司wordpress 进销存
  • 做视频网站用哪个模板昆明贤邦网站建设
  • 自建网站工具wordpress仿内涵段子
  • 做推广最好的网站是哪个菜鸟网站建设
  • 首钢建设公司网站微信网站怎么做的好处
  • 西安网站开发费用网站即将 模板
  • 个人做商业网站需要什么热门网站建设代理
  • 企业网站手机端和pc端一个后台吗企业网站管理系统的运维服务
  • 北京官网开发优化游戏性能的软件
  • 网站开发选asp还是hph集约化网站群建设情况
  • 做网站域名重要吗10000ip网站怎么做
  • 途牛的旅游网站是谁做的wordpress 注册用户列表
  • 如何编辑网站新吁网站建设
  • 网站开发采集工具免费引流在线推广
  • 全面的锦州网站建设西安建筑工程有限公司
  • 做网站 郑州公司哪家好哪个购物网站最便宜
  • dedecms网站后台免费网页小游戏
  • 如何查网站外链wordpress火车头采集免费版
  • 四川住房建设和城乡建设厅新网站wordpress 采集 api
  • 企业所得税怎么交南昌seo实用技巧
  • 深圳英文网站开发企业网站和展板建设