attach Attach 到一个运行中的 container #(连接到这个容器:远程连接) exec 在一个 container 中执行一个命令 #(进入容器) port-forward Forward one or more local ports to a pod #(负责端口转发) proxy 运行一个 proxy 到 Kubernetes API server #(做代理) cp
logs Print the logs for a container in a pod attach Attach to a running container exec Execute a command in a 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 and from containers auth Inspect ...
If omitted, the first container in the pod will be chosen -i, --stdin=false: Pass stdin to the container -t, --tty=false: Stdin is a TTY 2.6 在容器内部执行命令 kubectl exec 用于在一个正在运行的容器执行命令。跟 docker 的 exec 命令类似。 代码语言:javascript 代码运行次数:0 运行 AI代...
cmd := &cobra.Command{ Use: componentKubelet, Long: `The kubelet is the primary "node agent" that runs on each node. The kubelet works in terms of a PodSpec. A PodSpec is a YAML or JSON object that describes a pod. The kubelet takes a set of PodSpecs that are provided through v...
$ kubectl create deployment NAME --image=image -- [COMMAND] [args...] Flags ingress Create a single ingress called 'simple' that directs requests to foo.com/bar to svc # svc1:8080 with a tls secret "my-cert" kubectl create ingress simple --rule="foo.com/bar=svc1:8080,tls=my-cert...
kubectl run <deployname> --image=busybox --command -- ping example.com set 在对象上设置特定功能。 例如: 滚动更新一个Deployment的容器镜像改为1.0版本: kubectl set image deployment/<deployname> <containername>=<containername>:1.0 edit edit提供了另一种更新资源的操作。 例如: 使用edit直接更新Pod的...
1 apiVersion: v1 2 kind: Pod 3 metadata: 4 name: foo 5 namespace: awesomeapps 6 spec: 7 containers: 8 - name: foo 9 image: registry.baidubce.com/private-online/awesomeapp:v1 10 imagePullSecrets: 11 - name: myregistrykey 在dashboard中指定创建服务的ImagePullSecrets 在通过kubectl创建成...
CCE支持使用已有的对象存储卷(PersistentVolumeClaim),创建有状态工作负载(StatefulSet)。如下配置示例适用于Kubernetes 1.13及以下版本的集群。touch obs-statefulset-example.yamlvi obs-statefulset-example.yamlyaml示例如下:k
If you’ve created a deployment yaml file and would like to validate thesyntax, use the command: kubectl create --dry-run --validate -f <file>.yaml Example: $ kubectl create --dry-run=client --validate -f hello-world.yml pod/hello-world created (dry run) ...
# Run Command in Container kubectl exec -it -n [namespace] [pod-name] -- [command] # Working Imperatively # Modify Resource kubectl edit -n [namespace] [resource-kind]/[resource-name] # Delete Resource kubectl delete [resource-kind]/[resource-name] ...