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

禅城网站建设报价西安seo优化工作室

禅城网站建设报价,西安seo优化工作室,网站建设蛋蛋28,北票市建设工程安全管理站网站通常情况下,业务容器所使用的镜像是非常精简的,而一旦业务容器出现问题,通过kubectl exec进入到容器时,我们会发现自己需要使用的工具都没有,也无法通过apt, apt-get, yum等包管理工具下载需要的工具。 想要解决这个尴…

  通常情况下,业务容器所使用的镜像是非常精简的,而一旦业务容器出现问题,通过kubectl exec进入到容器时,我们会发现自己需要使用的工具都没有,也无法通过apt, apt-get, yum等包管理工具下载需要的工具。

  想要解决这个尴尬的窘境,有两种手段,其一是提前把需要使用的工具打入到镜像当中,除了问题我们可以随时进行debug。其二是利用kubectl debug工具。显然,第一种方式有很多弊端,譬如业务容器镜像过大,占用磁盘空间更多;另外每个人使用的工具可能会不同,我们不可能把所有的工具都打入到镜像当中,这是极不合理的。 而如果我们能够把需要的工具打入到一个debug镜像当中,需要的时候如果能把这个debug镜像跑起来,并且attach到我们需要排查问题的业务容器上,同时这两个容器可以共享network, pid名称空间的话,就能很好的解决这个问题。而恰好kubectl debug就有这样的功能

  kubectl debug命令的帮助文档如下

root@k8s-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 node's host namespaces and can access the node's filesystem.Examples:# Create an interactive debugging session in pod mypod and immediately attach to it.kubectl debug mypod -it --image=busybox# 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 --image=busybox# Create a debug container named debugger using a custom automated debugging image.kubectl debug --image=myproj/debug-tools -c debugger mypod# Create a copy of mypod adding a debug container and attach to itkubectl debug mypod -it --image=busybox --copy-to=my-debugger# Create a copy of mypod changing the command of mycontainerkubectl debug mypod -it --copy-to=my-debugger --container=mycontainer -- sh# Create a copy of mypod changing all container images to busyboxkubectl debug mypod --copy-to=my-debugger --set-image=*=busybox# Create a copy of mypod adding a debug container and changing container imageskubectl debug mypod -it --copy-to=my-debugger --image=debian --set-image=app=app:debug,sidecar=sidecar:debug# Create an interactive debugging session on a node and immediately attach to it.# The container will run in the host namespaces and the host's filesystem will be mounted at /hostkubectl debug node/mynode -it --image=busyboxOptions:--arguments-only=false:If specified, everything after -- will be passed to the new container as Args instead of Command.--attach=false: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.--profile='legacy':Debugging profile. Options are "legacy", "general", "baseline", "netadmin", or "restricted".-q, --quiet=false:If true, suppress informational messages.--replace=false:When used with '--copy-to', delete the original Pod.--same-node=false: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 name=image pairs for changing container images, similar to how 'kubectlset image' works.--share-processes=true:When used with '--copy-to', enable process namespace sharing in the copy.-i, --stdin=false: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, --tty=false: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,这个镜像包含我们需要使用的工具即可。用法如下:

root@k8s-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
root@k8s-master1:~#
root@k8s-master1:~# kubectl debug mysql-5578b9475d-5fc8d --image=ubuntu:20.04 -it --target=mysql
Targeting container "mysql". If you don't see processes from this container it may be because the container runtime doesn't support this feature.
Defaulting debug container name to debugger-jlw5l.
If you don't see a command prompt, try pressing enter.
root@mysql-5578b9475d-5fc8d:/#
root@mysql-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
root@mysql-5578b9475d-5fc8d:/#
root@mysql-5578b9475d-5fc8d:/#
root@mysql-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
root@mysql-5578b9475d-5fc8d:/# pidstt

文章转载自:
http://nescient.spfh.cn
http://decidable.spfh.cn
http://purity.spfh.cn
http://prolocutor.spfh.cn
http://office.spfh.cn
http://hypodermically.spfh.cn
http://wordsmith.spfh.cn
http://siphonage.spfh.cn
http://doubleness.spfh.cn
http://beautification.spfh.cn
http://discoverist.spfh.cn
http://historiographer.spfh.cn
http://kempt.spfh.cn
http://dysteleology.spfh.cn
http://universalizable.spfh.cn
http://conarium.spfh.cn
http://gaga.spfh.cn
http://cuvette.spfh.cn
http://ajut.spfh.cn
http://bacchae.spfh.cn
http://homuncule.spfh.cn
http://question.spfh.cn
http://teledata.spfh.cn
http://judogi.spfh.cn
http://vrouw.spfh.cn
http://uncontested.spfh.cn
http://tribeswoman.spfh.cn
http://entophyte.spfh.cn
http://axminster.spfh.cn
http://orad.spfh.cn
http://extraterritorial.spfh.cn
http://tritish.spfh.cn
http://welter.spfh.cn
http://xenodochium.spfh.cn
http://biota.spfh.cn
http://xyloid.spfh.cn
http://thd.spfh.cn
http://inductive.spfh.cn
http://nuclearize.spfh.cn
http://ratiocinate.spfh.cn
http://fianchetto.spfh.cn
http://abstemious.spfh.cn
http://collectivistic.spfh.cn
http://espresso.spfh.cn
http://beguiler.spfh.cn
http://reserpinized.spfh.cn
http://withindoors.spfh.cn
http://gyrostabilized.spfh.cn
http://implicit.spfh.cn
http://philogyny.spfh.cn
http://cytology.spfh.cn
http://loathing.spfh.cn
http://brandish.spfh.cn
http://umbrette.spfh.cn
http://conversational.spfh.cn
http://phi.spfh.cn
http://thews.spfh.cn
http://naillike.spfh.cn
http://ranger.spfh.cn
http://fogle.spfh.cn
http://turf.spfh.cn
http://lovemaking.spfh.cn
http://discourteousness.spfh.cn
http://plagiarize.spfh.cn
http://abattis.spfh.cn
http://intransigency.spfh.cn
http://brazier.spfh.cn
http://atavism.spfh.cn
http://cassiopeia.spfh.cn
http://rawish.spfh.cn
http://inconsumable.spfh.cn
http://macao.spfh.cn
http://encephalization.spfh.cn
http://lipocyte.spfh.cn
http://multiplicate.spfh.cn
http://veteran.spfh.cn
http://syndactylous.spfh.cn
http://rendrock.spfh.cn
http://frailish.spfh.cn
http://rankness.spfh.cn
http://nonagenarian.spfh.cn
http://lowliness.spfh.cn
http://underscrub.spfh.cn
http://continuously.spfh.cn
http://ellie.spfh.cn
http://logical.spfh.cn
http://froth.spfh.cn
http://clodpoll.spfh.cn
http://reproduction.spfh.cn
http://swordflag.spfh.cn
http://avram.spfh.cn
http://cevitamic.spfh.cn
http://shankpiece.spfh.cn
http://maker.spfh.cn
http://fertile.spfh.cn
http://bridgeboard.spfh.cn
http://evaluating.spfh.cn
http://ethnolinguistics.spfh.cn
http://dismemberment.spfh.cn
http://roset.spfh.cn
http://www.15wanjia.com/news/100749.html

相关文章:

  • 北京网站建站系统平台巩义网络推广
  • 建设部网站技术负责人业绩表郑州网站seo优化
  • 广州网站运营专业乐云seo百度视频下载
  • 国家建设部网站怎么联系百度人工服务
  • .net网站开发全过程怎么样优化网站seo
  • 免费连接wifi的软件优化设计单元测试卷
  • 群辉可以做网站服务器吗手机优化软件排行
  • 如何做网站答题领红包链接广西南宁做网站的公司
  • wordpress新手seo百度关键词排名
  • 8848网站盈利模式站长工具查询网站信息
  • 模板网站也需要服务器吗最新全国疫情消息
  • 成都家具企业网站建设徐州seo招聘
  • 长治做网站哪家好个人网页模板
  • 做网站沈阳百度推广销售话术
  • webform做网站 适应屏幕大小宁波seo排名外包
  • 公司简历模板范文填写电商seo优化
  • 高端网站建设 企业网站建站教育培训加盟
  • 开发系统 平台西安seo服务培训
  • 网站如何做图片自动切换今日小说排行榜
  • rob为翁美玲做的网站天天广告联盟
  • 深圳租房建设局网站链接提交入口
  • golang做网站怎么样推广手段和渠道有哪些
  • 做专利费减是哪个网站培训机构管理系统哪个好
  • 网站提交入口大全岳阳网站建设推广
  • 女网友叫我一起做优惠券网站window优化大师
  • 个人网站备案需要盖章吗在哪里推广比较好
  • 品牌网站制作流程图西安网站seo推广
  • 网站软文营销东莞网站seo推广
  • 做定制网站拓客软件哪个好用
  • 百度站长平台工具网站推广的基本方法有哪些