You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dsProject/操作文档/8、使用命令行创建K8S发布和服务.md

851 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

使用命令行创建K8S发布和服务

一、创建注册仓库信息

kubectl create secret docker-registry regcred  --docker-server=registry.cn-hangzhou.aliyuncs.com   --docker-username=东师黄海   --docker-password=DsideaL4r5t6y7u   --docker-email=10402852@qq.com

返回信息: secret/regcred created

二、创建发布和服务

kubectl apply -f ds-base-deployment.yaml
kubectl apply -f ds-base-service.yaml

kubectl apply -f ds-base-web-deployment.yaml
kubectl apply -f ds-base-web-service.yaml

三、持久扩容为2个容器

编辑 ds-base-deployment.yaml将 spec.replicas 的值设置为 2然后

kubectl apply -f ds-base-deployment.yaml

四、临时扩容为2个容器

kubectl scale deployments ds-base --replicas=2