k8s yaml简写:行内表示法
作者:互联网
apiVersion: v1
kind: Pod
metadata:
name: mytest
labels:
app: myapp
spec:
containers:
- image: xxx/readytest:v1
name: myapp
该yaml树状结构如下:
其中containers的内容是拥有两个键值对的数组
转换成行内表示法:
{
'apiVersion': 'v1',
'kind': 'Pod',
'metadata': {'name': 'mytest', 'labels': {'app': 'myapp'}},
'spec': {'containers':[{'name': 'myapp', 'image': 'hub.atguigu.com/library/readytest:v1'}]}
}
标签:k8s,name,v1,app,labels,yaml,myapp,简写,containers 来源: https://blog.csdn.net/qzydaqin/article/details/121961018