devops/xxljob/install-xxljob.sh

38 lines
1.1 KiB
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
echo "开始安装 XXL-JOB 到 Kubernetes 集群..."
# 检查 kubectl 是否可用
if ! command -v kubectl &> /dev/null; then
echo "错误: kubectl 命令未找到,请先安装 kubectl"
exit 1
fi
# 应用 XXL-JOB 配置
echo "应用 XXL-JOB Deployment..."
kubectl apply -f xxljob-deployment.yaml
echo "应用 XXL-JOB Service..."
kubectl apply -f xxljob-service.yaml
echo "应用 XXL-JOB Ingress..."
kubectl apply -f xxljob-ingress.yaml
# 等待 Pod 启动
echo "等待 XXL-JOB Pod 启动..."
kubectl wait --for=condition=ready pod -l app=xxl-job-admin -n default --timeout=300s
# 检查状态
echo "检查 XXL-JOB 部署状态..."
kubectl get pods -l app=xxl-job-admin -n default
kubectl get svc xxl-job-admin -n default
kubectl get ingress xxl-job-admin-ingress -n default
echo "XXL-JOB 安装完成!"
echo "访问地址: https://xxljob-ops.t-aaron.com"
echo "默认用户名/密码: admin/123456"
echo ""
echo "注意: 使用H2内存数据库Pod重启后数据会丢失"
echo "如需持久化数据请配置MySQL或PostgreSQL数据库"