File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
content/zh-cn/docs/reference/kubectl Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ kubectl create cronjob hello --image=busybox:1.28 --schedule="*/1 * * * *" --
216
216
kubectl explain pods # get the documentation for pod manifests
217
217
218
218
# Create multiple YAML objects from stdin
219
- cat <<EOF | kubectl apply -f -
219
+ kubectl apply -f - <<EOF
220
220
apiVersion: v1
221
221
kind: Pod
222
222
metadata:
@@ -243,7 +243,7 @@ spec:
243
243
EOF
244
244
245
245
# Create a secret with several keys
246
- cat <<EOF | kubectl apply -f -
246
+ kubectl apply -f - <<EOF
247
247
apiVersion: v1
248
248
kind: Secret
249
249
metadata:
@@ -271,7 +271,7 @@ kubectl create cronjob hello --image=busybox:1.28 --schedule="*/1 * * * *" --
271
271
kubectl explain pods # 获取 pod 清单的文档说明
272
272
273
273
# 从标准输入创建多个 YAML 对象
274
- cat << EOF | kubectl apply -f -
274
+ kubectl apply -f - << EOF
275
275
apiVersion: v1
276
276
kind: Pod
277
277
metadata:
@@ -298,7 +298,7 @@ spec:
298
298
EOF
299
299
300
300
# 创建有多个 key 的 Secret
301
- cat << EOF | kubectl apply -f -
301
+ kubectl apply -f - << EOF
302
302
apiVersion: v1
303
303
kind: Secret
304
304
metadata:
You can’t perform that action at this time.
0 commit comments