$ kubectl rolling-update frontend-v1 frontend-v2 --rollback # 中止进行中的过程 $ cat pod.json | kubectl replace -f - # 根据传入标准输入的 JSON 替换一个 pod # 强制替换,先删除,然后再重建资源。会导致服务中断。 $ kubectl replace --force -f ./pod.json # 为副本控制器(rc)创建服务,它开...
CrashLoopBackOff: 容器退出,kubelet正在将它重启 InvalidImageName: 无法解析镜像名称 ImageInspectError: 无法校验镜像 ErrImageNeverPull: 策略禁止拉取镜像 ImagePullBackOff: 正在重试拉取 RegistryUnavailable: 连接不到镜像中心 ErrImagePull: 通用的拉取镜像出错 CreateContainerConfigError: 不能创建kubelet使用的容器...
kubectl drain <node-name> --ignore-daemonsets=true --delete-local-data=true To force drain you can add the--forceflag though this is not recommended. Apply yaml files and folders You can useapplyargument to apply a configuration to a resource by filename or stdin. The command syntax is:...
kubectl delete ns nsName# 强制删除其他资源kubectl delete svc --grace-period=0 --force# 强制删除kubectl delete pods <pod> --grace-period=0 --force kubectl delete pod podName -n nsName --grace-period=0 --force kubectl delete pod podName -n nsName --grace-period=1 kubectl delete pod p...
kubectl是Kubernetes集群的命令行工具,通过kubectl能够对集群本身进行管理,并能够在集群上进行容器化应用的安装部署。运行kubectl命令的语法如下所示: 代码语言:javascript 复制 $ kubectl[command][TYPE][NAME][flags] comand:指定要对资源执行的操作,例如create、get、describe和delete ...
[root@hdss7-21 ~]# kubectl get all -n kube-public NAME READY STATUS RESTARTS AGE pod/nginx-dp-58f74bd894-9b5f7 0/1 ImagePullBackOff 0 2m31s NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/nginx-dp ClusterIP 192.168.196.123 <none> 80/TCP 40s NAME READY UP-TO-DATE ...
1.0.0 #容器对应的 Docker ImageimagePullPolicy:IfNotPresentports:-containerPort:80env:# 注入到容器的环境变量-name:env1value:"k8s-env1"-name:env2value:"k8s-env2"resources:requests:cpu:100m-name:myredis #容器的名称image:redis #容器对应的 Docker ImageimagePullPolicy:IfNotPresentports:-container...
允許的值:dockerRegistry、generic。 預設值:dockerRegistry。 建立/更新泛型或 docker imagepullsecret。 選取 dockerRegistry 以建立/更新所選取登錄的 imagepullsecret。 imagePullSecret 是一種將包含容器登錄密碼的秘密傳遞至 Kubelet 的方式,以便代表您的 Pod 提取私人映像。
如果托管Pod的Node节点已经停止或者无法连接API Server,使用delete命令删除Pod需等待时间更长。要强制删除资源,需指定- force flag,且设置周期(宽限期)为0。 如果执行强制删除Pod,则调度程序会在节点释放这些Pod之前将新的Pod放在这些节点上,并使之前Pod立即被逐出。
Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion). --hostport=-1: The host port mapping for the container port. To demonstrate a single-machine container. --image='': 指定容器要运行的镜像. ...