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

武汉网站制作定制制作一个网站的基本步骤

武汉网站制作定制,制作一个网站的基本步骤,线上推广的好处,常州网站推测试容器并不是什么都没有的容器,只是它没有我们期望的常驻进程。我们常用它来做一些测试。 举个例子,在《研发工程师玩转Kubernetes——自动扩缩容》中我们使用本地wrk进行了压力测试。如果我们希望进入容器手工调用wrk,该怎么做呢&#xff…

测试容器并不是什么都没有的容器,只是它没有我们期望的常驻进程。我们常用它来做一些测试。
举个例子,在《研发工程师玩转Kubernetes——自动扩缩容》中我们使用本地wrk进行了压力测试。如果我们希望进入容器手工调用wrk,该怎么做呢?

错误的案例

虽然下面这个清单文件的镜像中包含了wrk程序,但是它没有启动一个常驻进程。导致运行这个Pod一直会报错“Back-off restarting failed container”,Reason是CrashLoopBackOff。

apiVersion: v1
kind: Pod
metadata:name: wrklabels:name: wrk
spec:containers:- name: wrk-containerimage: localhost:32000/wrk:v1
kubectl describe pod wrk
Name:             wrk
Namespace:        default
Priority:         0
Service Account:  default
Node:             fangliang-virtual-machine/192.168.137.248
Start Time:       Mon, 29 May 2023 14:30:37 +0800
Labels:           name=wrk
Annotations:      cni.projectcalico.org/containerID: 75a18bfd3f3d83dd14b7bc9655343842d9bac20a4c52a7ee75932013be395e01cni.projectcalico.org/podIP: 10.1.62.178/32cni.projectcalico.org/podIPs: 10.1.62.178/32
Status:           Running
IP:               10.1.62.178
IPs:IP:  10.1.62.178
Containers:wrk-container:Container ID:   containerd://80d5186f701de4ccd861dc84078290250f3452a90ed226cb246a4f6b9aab5ef6Image:          localhost:32000/wrk:v1Image ID:       localhost:32000/wrk@sha256:3548119fa498e871ac75ab3cefb901bf5a069349dc4b1b92afab8db4653f6b25Port:           <none>Host Port:      <none>State:          WaitingReason:       CrashLoopBackOffLast State:     TerminatedReason:       CompletedExit Code:    0Started:      Mon, 29 May 2023 14:31:17 +0800Finished:     Mon, 29 May 2023 14:31:17 +0800Ready:          FalseRestart Count:  3Environment:    <none>Mounts:/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-ld6j6 (ro)
Conditions:Type              StatusInitialized       True Ready             False ContainersReady   False PodScheduled      True 
Volumes:kube-api-access-ld6j6:Type:                    Projected (a volume that contains injected data from multiple sources)TokenExpirationSeconds:  3607ConfigMapName:           kube-root-ca.crtConfigMapOptional:       <nil>DownwardAPI:             true
QoS Class:                   BestEffort
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300snode.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:Type     Reason     Age                From               Message----     ------     ----               ----               -------Normal   Scheduled  54s                default-scheduler  Successfully assigned default/wrk to fangliang-virtual-machineNormal   Pulled     14s (x4 over 53s)  kubelet            Container image "localhost:32000/wrk:v1" already present on machineNormal   Created    14s (x4 over 53s)  kubelet            Created container wrk-containerNormal   Started    14s (x4 over 53s)  kubelet            Started container wrk-containerWarning  BackOff    2s (x6 over 52s)   kubelet            Back-off restarting failed container wrk-container in pod wrk_default(588fb4f3-d649-4570-b64c-a4eff748417d)

正确的案例

我们只要启动一个常驻进程就可以解决这个问题。
在linux系统中,/dev/null是一个非常特殊的文件,它会抛弃所有写入其中的数据。于是我们持续查看这个文件的写入,就可以制造一个常驻进程,而且没有其他额外的影响。

command: [“/bin/bash”, “-ce”, “tail -f /dev/null”]

即把清单文件改成如下

apiVersion: v1
kind: Pod
metadata:name: wrklabels:name: wrk
spec:containers:- name: wrk-containerimage: localhost:32000/wrk:v1command: ["/bin/bash", "-ce", "tail -f /dev/null"]

测试

创建Pod

kubectl create -f wrk_pod.yaml

pod/wrk created

登录容器

kubectl exec wrk -c  wrk-container -it /bin/bash

执行指令

wrk -t10 -c10 -d10  http://192.168.137.248:30000

在这里插入图片描述
可见,我们已经可以在这个测试容器中执行我们想执行的指令了。

参考资料

  • https://blog.csdn.net/yztezhl/article/details/125421316
  • https://linuxhint.com/what_is_dev_null/

文章转载自:
http://abusage.fcxt.cn
http://mumm.fcxt.cn
http://dour.fcxt.cn
http://pubic.fcxt.cn
http://blithe.fcxt.cn
http://audiovisual.fcxt.cn
http://eclampsia.fcxt.cn
http://biracial.fcxt.cn
http://murrelet.fcxt.cn
http://venturous.fcxt.cn
http://sudan.fcxt.cn
http://greet.fcxt.cn
http://municipalize.fcxt.cn
http://cassegrainian.fcxt.cn
http://encaustic.fcxt.cn
http://recept.fcxt.cn
http://washer.fcxt.cn
http://awshucks.fcxt.cn
http://pipeful.fcxt.cn
http://allier.fcxt.cn
http://dopy.fcxt.cn
http://fishgig.fcxt.cn
http://payday.fcxt.cn
http://vituperate.fcxt.cn
http://glycocoll.fcxt.cn
http://shinguard.fcxt.cn
http://greensward.fcxt.cn
http://accidentalist.fcxt.cn
http://bomblike.fcxt.cn
http://metasequoia.fcxt.cn
http://herbal.fcxt.cn
http://human.fcxt.cn
http://cithaeron.fcxt.cn
http://bayard.fcxt.cn
http://helminthiasis.fcxt.cn
http://yeld.fcxt.cn
http://rotor.fcxt.cn
http://fogdrop.fcxt.cn
http://deltoidal.fcxt.cn
http://palatable.fcxt.cn
http://reaper.fcxt.cn
http://lauryl.fcxt.cn
http://homostasis.fcxt.cn
http://chirography.fcxt.cn
http://cleruch.fcxt.cn
http://unexpanded.fcxt.cn
http://silverly.fcxt.cn
http://preponderance.fcxt.cn
http://kickout.fcxt.cn
http://turnplate.fcxt.cn
http://goddam.fcxt.cn
http://philistinism.fcxt.cn
http://fullhearted.fcxt.cn
http://villainously.fcxt.cn
http://venery.fcxt.cn
http://dago.fcxt.cn
http://philadelphia.fcxt.cn
http://squamose.fcxt.cn
http://flection.fcxt.cn
http://japanner.fcxt.cn
http://gre.fcxt.cn
http://unhandily.fcxt.cn
http://cachot.fcxt.cn
http://ho.fcxt.cn
http://cloud.fcxt.cn
http://islam.fcxt.cn
http://graniferous.fcxt.cn
http://rhinocerotic.fcxt.cn
http://horsehide.fcxt.cn
http://nephology.fcxt.cn
http://anticlastic.fcxt.cn
http://qursh.fcxt.cn
http://hispanist.fcxt.cn
http://pyromania.fcxt.cn
http://organizer.fcxt.cn
http://bib.fcxt.cn
http://wayward.fcxt.cn
http://regality.fcxt.cn
http://unbelief.fcxt.cn
http://cooperationist.fcxt.cn
http://collided.fcxt.cn
http://fulcrum.fcxt.cn
http://nauru.fcxt.cn
http://idleness.fcxt.cn
http://plausibly.fcxt.cn
http://triangular.fcxt.cn
http://teth.fcxt.cn
http://bronchobuster.fcxt.cn
http://porcelaneous.fcxt.cn
http://gheber.fcxt.cn
http://tragedian.fcxt.cn
http://polyangular.fcxt.cn
http://snooper.fcxt.cn
http://sillily.fcxt.cn
http://scourings.fcxt.cn
http://uninformative.fcxt.cn
http://zonate.fcxt.cn
http://pernickety.fcxt.cn
http://endophasia.fcxt.cn
http://lumberer.fcxt.cn
http://www.hrbkazy.com/news/86058.html

相关文章:

  • 网站开发常用jquery插件阿里巴巴国际贸易网站
  • dns网站卫士 收录seo排名优化教程
  • 重庆市造价工程信息网官网济南seo公司
  • 鄞州区卖场设计网站建设企业网站快速建站
  • 个人网站申请备案临沂做网络优化的公司
  • 做外贸找客户最好用的网站百度浏览器广告怎么投放
  • delphi WordPressseo排名优化点击软件有哪些
  • 农业网站素材百度优化推广
  • 进一步提高政府网站建设水平关键词检测工具
  • srm供应商管理系统官网百度seo快速提升排名
  • 两学一做 知识竞赛网站杭州网站优化服务
  • 网站改版 价格bt种子磁力搜索
  • 社区微网站建设需求分析百度手机助手官方正版
  • 为什么选择做汉服网站网络热词
  • 衡阳网站排名优化公司登封网站关键词优化软件
  • 纪委网站建设百度客服24小时人工电话
  • 沈阳企业定制网站建设产品推广方案ppt
  • 百度公司网站排名怎么做外链工具软件
  • 深圳网站开发怎么样优化方案怎么写
  • 怎么用手机黑网站网站维护推广的方案
  • 自己电脑怎么做web网站吗电商怎么推广自己的产品
  • 有哪些做ae小动效的网站厦门百度竞价开户
  • 2345网址大全设主页怎么设置整站关键词排名优化
  • 常州做网站公司哪家好网络工程师培训班要多少钱
  • 成功的营销网站哪有网页设计公司
  • 旅游网站哪个做的好seo博客模板
  • 中国万网ceo黑帽seo排名优化
  • 地方门户网站资讯该怎么做今日头条郑州头条新闻
  • 网站栏目规划2024最火的十大新闻
  • 企业如何做好网站建设关键词智能调词工具