可以从命令行创建(启动清单) pv/pvc吗?
ie.创建部署
kubectl create deployment abc --image=logger:1 --dry-run=client -o yaml > abc.ymlie.创建一个pod
kubectl run pod xyz --image=logger:1 --dry-run=client -o yaml > xyz.yml我想做什么,
kubectl create persitentvolume --name my-pv spec.capacity.storage=1Gi --dry-run=client -o yaml > my-pv.yml使用的参考资料:https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands
发布于 2021-02-19 19:45:05
We cannot create the manifest file for `pv` using the command line. For only the following objects created using the command line(imperatively) is possible.
--->kubectl create [press tab] [press tab]
clusterrole cronjob namespace quota secret
clusterrolebinding deployment poddisruptionbudget role service
configmap job priorityclass rolebinding serviceaccount 或者可以使用--help和kubectl create检查可用的选项。
Available Commands:
clusterrole Create a cluster role
clusterrolebinding Create a cluster role binding for a particular cluster role
configmap Create a config map from a local file, directory or literal value
cronjob Create a cron job with the specified name
deployment Create a deployment with the specified name
ingress Create an ingress with the specified name
job Create a job with the specified name
namespace Create a namespace with the specified name
poddisruptionbudget Create a pod disruption budget with the specified name
priorityclass Create a priority class with the specified name
quota Create a quota with the specified name
role Create a role with single rule
rolebinding Create a role binding for a particular role or cluster role
secret Create a secret using specified subcommand
service Create a service using a specified subcommand
serviceaccount Create a service account with the specified name
token Request a service account token注意:
上面的
v1.24.2或更低版本。这可能与未来的releases.kubectl create token不同,在1.24版中添加了https://stackoverflow.com/questions/66283989
复制相似问题