[root@master01 ~]# kubectl run nginx-deployment --image=nginx --port=80 --replicas=3 #创建名称为nginx-deployment,nginx镜像,端口为80端口,副本集为3的pod集群 kubectl run --generator=deployment/apps.v1beta1 is DEPRECATED and will be removed in a future version. Use kubectl create instead. de...
name: nginx-deployment labels: app: nginx spec: replicas: 2 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:latest ports: - containerPort: 80 [root@master nginx]# kubectl create -f nginx-deploy.yaml [root@master nginx...
kubectl create cronjob test-job --image=busybox --schedule="*/1 * * * *" -- date $ job NAME --image=image [--from=cronjob/name] -- [COMMAND] [args...] kubectl create job my-job --image=busybox -- date $ deployment NAME --image=image [--dry-run] kubectl create deployment...
ReplicaSet 的 PodSpec 字段是从 Deployment 的 manifest 以及其他相关元数据中复制而来。有时 Deployment 在此之后也需要更新(例如,如果设置了 process deadline)。 当完成以上步骤之后,该Deployment 的 status 就会被更新,然后重新进入与之前相同的循环,等待 Deployment 与期望的状态相匹配。由于 Deployment Controller ...
runkubectl run NAME --image=image [--env="key=value"] [--port=port] [--dry-run=server|client] [--overrides=inline-json] [--command] -- [COMMAND] [args...] [options]基于一个镜像在 kubernetes 集群上启动一个 deployment 基本命令中级 ...
kubectl create deployment see-dev --image=registry.cn-beijing.aliyuncs.com/see_obj/see_dev_1 --dry-run-oyamlapiVersion: apps/v1kind: Deploymentmetadata:creationTimestamp: nulllabels:app: see-devname: see-devspec:replicas:1selector:matchLabels:app: see-devstrategy: {}template:metadata:creation...
kubectl create deployment nginx --image=registry.aliyuncs.com/spacexnice/netdia:latest 1.18及以下版本的集群,使用以下命令启动。 kubectl run -it nginx --image=registry.aliyuncs.com/spacexnice/netdia:latest 执行以下命令,为该容器创建一个服务入口,指定--type=LoadBalancer将会为您创建一个阿里云负载均衡路...
v1.autoscaling Local True 25h v1.batch Local True 25h v1.certificates.k8s.io Local True 25h v1.coordination.k8s.io Local True 25h v1.discovery.k8s.io Local True 25h v1.events.k8s.io Local True 25h v1.networking.k8s.io Local True 25h ...
Kubernetes 命令 kubectl create 用于向集群添加新资源。用户可以使用此命令创建 Pod、Service和Deployment等资源。 使用以下命令,将使用 nginx 映像创建一个名为my-nginx 的新deployment: 复制 $ kubectl create deployment my-nginx--image=nginx deployment.apps/my-nginx created ...
kubectl create 通过yaml/json 文件或者标准输入创建一个资源对象,支持很多子命令 例如namespace pod deployment service等 kubectl expose 将json/yaml文件中定义的资源对象的端口暴露给新的service资源对象 kubectl run 创建并运行一个或多个容器镜像 kubectlset配置资源对象设置特定功能 ...