]# kubectl get [资源] -n [namespace] -o|--output wide -A|--all-namespaces -l|--selector [标签] -w|--watch
]# kubectl create [资源] -f xxx.yaml # 通过yaml文件创建资源
]# kubectl create deploy NAME --image=NAME --dry-run=client -o wide
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: nginx
name: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: nginx
spec:
containers:
- image: nginx
name: nginx
resources: {}
status: {}
]# kubectl explain pod.spec
原文:https://www.cnblogs.com/kclinux/p/14802852.html