$ kubectl run myapp --image=nginx --dry-run -o yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
creationTimestamp: null
labels:
run: myapp
name: myapp
spec:
replicas: 1
selector:
matchLabels:
run: myapp
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
run: myapp
spec:
containers:
- image: nginx
name: myapp
resources: {}
status: {}复制代码$ kubectl create secret generic mysecret --from-literal=quiet-phrase="Shh! Dont' tell" -o yaml --dry-run
apiVersion: v1
data:
quiet-phrase: U2hoISBEb250JyB0ZWxs
kind: Secret
metadata:
creationTimestamp: null
name: mysecret复制代码$ kubectl get deployment mysql --export -o yaml > mysql.yaml 复制代码ve