mgmt/scripts/deploy-nfs-csi-plugin.sh

45 lines
963 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# NFS CSI Plugin 部署脚本
# 这个脚本会安装NFS CSI插件让您的NFS存储能在Nomad UI中显示
set -e
echo "🚀 开始部署NFS CSI Plugin..."
# 检查是否为root用户
if [ "$EUID" -ne 0 ]; then
echo "❌ 请以root用户运行此脚本"
exit 1
fi
# 1. 安装CSI插件
echo "📦 安装NFS CSI插件..."
ansible-playbook -i deployment/ansible/inventories/production/hosts \
deployment/ansible/playbooks/install/install-nfs-csi-plugin.yml
# 2. 等待Nomad服务重启
echo "⏳ 等待Nomad服务重启..."
sleep 30
# 3. 注册CSI Volume
echo "📝 注册CSI Volume..."
nomad volume register components/nomad/volumes/nfs-csi-volume.hcl
# 4. 验证CSI插件状态
echo "✅ 验证CSI插件状态..."
nomad plugin status
# 5. 显示CSI volumes
echo "📊 显示CSI volumes..."
nomad volume status
echo "🎉 NFS CSI Plugin部署完成"
echo "现在您可以在Nomad UI中看到CSI插件和volumes了"