创建 PersistentVolumeClaim 命令式方式?

Nur*_*hun 7 kubernetes kubectl persistent-volumes persistent-volume-claims kubernetes-pvc

为什么我们不能以命令式的方式创建PV或PVC?

尝试使用创建命令,但它没有显示任何一个。

kubectl create --help

Available Commands:
  clusterrole         Create a ClusterRole.
  clusterrolebinding  Create a ClusterRoleBinding for a particular ClusterRole
  configmap           Create a configmap from a local file, directory or literal value
  cronjob             Create a cronjob 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 priorityclass with the specified name.
  quota               Create a quota with the specified name.
  role                Create a role with single rule.
  rolebinding         Create a RoleBinding for a particular Role or ClusterRole
  secret              Create a secret using specified subcommand
  service             Create a service using specified subcommand.
  serviceaccount      Create a service account with the specified name
   
Run Code Online (Sandbox Code Playgroud)

aci*_*uji 7

如文档 中所述,kubectl使用kubectl 命令行工具内置的命令式命令来帮助您快速创建对象。

经过一些检查后,这似乎不可用,因为它尚未实施。您可以在kubectl/pkg/cmd/ create中查看创建选项的完整列表。例如,#78153负责kubectl create ingress功能。

通过询问开发人员并提出新问题,您可能会获得更多信息以及未实现此功能的原因。