手动创建deployment
[root@k8s-master01 5]# kubectl create deployment myapp --image =nginx:1.26.5 --dry-run -o yaml
W0616 16:47:48.031032 2643512 helpers.go:704] --dry-run is deprecated and can be replaced with --dry-run=client.
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: myapp
name: myapp
spec:
replicas: 1
selector:
matchLabels:
app: myapp
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: myapp
spec:
containers:
- image: =nginx:1.26.5
name: =nginx
resources: {}
status: {}
kubectl create deployment myapp --image =nginx:1.26.5 --dry-run -o yaml > delpoyment_test.yml
posted on 2025-06-16 16:50 FLOWERS_WAN 阅读(9) 评论(0) 收藏 举报
浙公网安备 33010602011771号