k8s YAML

two ways to create resources

1.cmd
kubectl run nginx-deployment --image=nginx:1.7.9 --replicas=2

2.configuration file :yml
kubectl apply -f nginx.yml

the advantage of yml:
1.describes What the app acheives final status
2.provides template for creating resources which can be deployed repeatly
3.deployment can be manged the same as the code mangement
4.suitable formal、cross-environment、scale deployment
5.difficult to be familar with grammar of yml

the configuration format of Deployment YAML

在这里插入图片描述

1.apiVersion is the version of current configuration format
2.kind is the type of created resource,now is Deployment
3.metadata is the Metadata of the resource ,the name is the required item.
4.spec is the size info of Deployment
5.replicas is the number of copy,by default is 1
6.tempate defines the template of Pod,which is important of YAML
7.metadata is the Metadata of the resource,at least one label
8.spec describes the size of Pod which defines the property of each container in Pod,the name and image is a must.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值