通过命令kubectl cp把堆栈日志从容器拷贝到宿主机上(当前所在目录) [root@pr-dr-13-47 ~]# kubectl cp projectName-sit/aaa-web-a07a8-cc75f8b79-k2xrq:/usr/local/tomcat/log202202081247 log202202081247.txt Defaulted container "aaa-web-a07a8" out of: aaa-web-a07a8, skywalking-agent (init), j...
[root@server1 pod]# kubectl exec -it pod-example -- sh Defaulted container "nginx" out of: nginx, busybox command terminated with exit code 130 [root@server1 pod]# kubectl exec -it pod-example -c busybox -- sh / # curl localhost <!DOCTYPE html> Welcome to nginx! 1. 2. 3. ...
Defaulted container"kubectl-trace-3d9981a0-e59b-11ee-a570-000c290e5d5f"out of: kubectl-trace-3d9981a0-e59b-11ee-a570-000c290e5d5f, kubectl-trace-init (init) ifyour program has maps toprint, send a SIGINT using Ctrl-C,ifyou want to interrupt the execution send SIGINT twotimes Attaching...
[root@ku8-1tmp]# ls yamlsmysql.yamlsonar.yaml[root@ku8-1tmp]# cat yamls/mysql.yaml---kind:DeploymentapiVersion:extensions/v1beta1metadata:name:mysqlspec:replicas:1template:metadata:labels:name:mysqlspec:containers:-name:mysqlimage:192.168.32.131:5000/mysql:5.7.16ports:-containerPort:3306proto...
$ kubectl logs -n demo myapp-1 -c myapp Defaulted container "myapp" out of: myapp, init (init) /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/ /docker-entrypoint.sh...
status<Object>Status is the most recently observed statusofthe replication controller.This data may be outofdate by some windowoftime.Populated by the system.Read-only.More info:http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status ...
30、令项番命令说明No.1version显示客户端和服务器侧版本信息No.2api-versions以group/version的格式显示服务器侧所支持的API版本No.3explain显示资源文档信息No.4get取得确认对象信息列表No.5describe取得确认对象的详细信息No.6logs取得pod中容器的log信息No.7exec在容器中执行一条命令No.8cp从容器考出或向容器考...
Container ID: docker://47ef1495e86f4b69414789e81081fa55b837dafe9e47944894e7cb3733700410 Image: 192.168.32.131:5000/mysql:5.7.16 Image ID: docker-pullable://192.168.32.131:5000/mysql@sha256:410b279f6827492da7a355135e6e9125849f62eeca76429974a534f021852b58 ...
logs Print the logsfora containerina pod attach Attach to a running container exec Execute a commandina container port-forward Forward one or more local ports to a pod proxy Run a proxy to the Kubernetes API server cp Copy files and directories to andfromcontainers. ...
https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#cp Copyright 2020 The Kubernetes Authors. GETTING STARTED This section contains the most basic commands for getting a workload running on your cluster. runwill start running 1 or more instances of a container image on your clus...