install

描述

在您的 Kubernetes 集群中安装 DirectPV。

语法

kubectl directpv install [flags]

参数

标志

标志 描述
--apparmor-profile <string> Apparmor 配置文件路径
--image <string> DirectPV 镜像名称(默认 directpv:4.0.6
--image-pull-secrets <string> DirectPV 镜像的镜像拉取密钥 (SECRET1,..)
--kube-version <string> 用于清单生成的 Kubernetes 版本(默认“1.27.0”)
--legacy 启用传统模式(与 ‘-o’ 一起使用)
--node-selector <string> 使用标签选择存储节点 (KEY=VALUE,..)
-o, --output <string> 生成安装清单。指定格式为 yamljson
--openshift 使用 OpenShift 特定的安装
--org <string> 注册表中的组织名称(默认 minio
--registry <string> 容器注册表名称(默认“quay.io”)
--seccomp-profile <string> Seccomp 配置文件路径
--tolerations <string> 在存储节点上设置容忍度标签 (KEY[=VALUE]:EFFECT,..)

全局标志

您可以将以下全局 DirectPV 标志与 kubectl directpv install 一起使用

标志 描述
--kubeconfig <string> 用于 CLI 请求的 kube.config 文件路径
--quiet 抑制打印错误消息

示例

安装 DirectPV

以下命令使用所有默认选项安装 DirectPV。

kubectl directpv install

从私有注册表安装 DirectPV

以下命令使用来自 private-registry.io 私有注册表中 my-org-name 组织的镜像安装 DirectPV。

kubectl directpv install --registry private-registry.io --org my-org-name

在选定节点上部署 DirectPV Pod

以下命令仅在指定节点上的 Pod 上部署 DirectPV DaemonSet。

kubectl directpv install --node-selector node-label-key=node-label-value

node-label-key 替换为用作选择器的标签键。将 node-label-value 替换为要在其上安装 DirectPV 的节点键的值。

使用容忍度控制 DirectPV Pod 的放置

以下命令使用容忍度来限制 DirectPV 的安装位置。容忍度采用 key=value:effect 的形式。

kubectl directpv install --tolerations key=value:NoSchedule

生成 DirectPV 安装清单文件

以下命令生成一个 YAML 清单文件,可用于安装 DirectPV。

kubectl directpv install -o yaml > directpv-install.yaml

使用 AppArmor 配置文件安装 DirectPV

以下命令使用 AppArmor 配置文件 安装 DirectPV。

kubectl directpv install --apparmor-profile directpv

使用 seccomp 配置文件安装 DirectPV

以下命令使用 seccomp 配置文件 安装 DirectPV。

kubectl directpv install --seccomp-profile profiles/seccomp.json