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 cpCopy files and directories to and from containers. auth Inspect authorization Advanced Commands: diffDiff live version against would-be applied version apply ...
kubectl exec -ti sh 容器日志: kubectl logs [-f] 导出服务: kubectl expose deploy --port=80 Base64 解码: kubectl get secret SECRET -o go-template='{{ .data.KEY | base64decode }}' 注意,kubectl run 仅支持 Pod、Replication Controller、Deployment、Job 和 CronJob 等几种资源。具体的资源类型...
(4)kubectl delete 通过配置文件名、stdin、资源名称或label选择器来删除资源。 支持JSON和YAML格式文件。可以只指定一种类型的参数:文件名、资源名称或label选择器。 有些资源,如pod,支持优雅的(graceful)删除,因为这些资源一般是集群中的实体,所以删除不可能会立即生效,这些资源在强制终止之前默认定义了一个周期(宽...
容器内执行命令:kubectl exec -ti <pod-name> sh 容器日志:kubectl logs [-f] <pod-name> 导出服务:kubectl expose deploy <name> --port=80 Base64 解码: kubectl get secret SECRET -o go-template='{{ .data.KEY | base64decode }}' 注意,kubectl run 仅支持 Pod、Replication Controller、Deployment...
$ kubectlexectomcat 123-5-456 date kubectl expose− 这用于将 Kubernetes 对象(例如 pod、复制控制器和服务)公开为新的 Kubernetes 服务。 这有能力通过正在运行的容器或从 yaml 文件公开它。 $ kubectl expose (-fFILENAME | TYPE NAME) [--port=port] [--protocol = TCP|UDP] ...
kubectl describe pods/zongxun-test-1 -n <namespace> #查看监控信息 kubectl describe pods zongxun-test-1 -n <namespace> kubeclt exec -n <namespace> -ti <pod> bash kubectl exec -n <namespace> -ti <pod> -c <container> bash kubectl logs -f -n kube-system <pod> kubectl get cm -...
exec: 在容器中执行命令。 port-forward: 将一个或多个本地端口转发到一个 pod。 proxy: 运行到 Kubernetes API 服务器的代理。 cp: 将文件和目录复制到容器中并从容器中复制出来。 auth: 检查授权。 高级命令 以下是kubectl高级命令: diff: 显示实际版本与将要应用版本的差异。 apply: 通过文件名或stdin将配...
Like kubectl exec, but offers a --user flag to exec as root (or any other user) 'ssh' is a misnomer (it works by mounting a docker socket as a volume), but it's easier to work with as a command. You must be in the same namespace as the target pod or you can use-n namesp...
as schedulabledrain Drain node in preparation for maintenancetaint Update the taints on one or more nodesTroubleshooting and Debugging Commands:describe Show details of a specific resource or group of resourceslogs Print the logs for a container in a podattach Attach to a running containerexec Execut...
容器内执行命令:kubectl exec -ti <pod-name> sh 容器日志:kubectl logs [-f] <pod-name> 导出服务:kubectl expose deploy <name> --port=80 Base64 解码: kubectl get secret SECRET -o go-template='{{ .data.KEY | base64decode }}'