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/Doc/7、使用命令行创建K8S发布和服务.md

37 lines
772 B

## 使用命令行创建K8S发布和服务
### 一、创建注册仓库信息
```shell
kubectl create secret docker-registry regcred --docker-server=registry.cn-hangzhou.aliyuncs.com --docker-username=东师黄海 --docker-password=DsideaL4r5t6y7u --docker-email=10402852@qq.com
```
返回信息:
```shell
secret/regcred created
```
### 二、创建发布和服务
```shell
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$,然后
```shell
kubectl apply -f ds-base-deployment.yaml
```