首次提交:初始化项目
This commit is contained in:
25
010-中间件/002-postgresql/deploy.sh
Normal file
25
010-中间件/002-postgresql/deploy.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 创建命名空间
|
||||
kubectl create namespace postgresql
|
||||
|
||||
# 部署 PostgreSQL
|
||||
kubectl apply -f postgresql-deployment.yaml
|
||||
|
||||
# 等待 PostgreSQL 启动
|
||||
echo "等待 PostgreSQL 启动..."
|
||||
kubectl wait --for=condition=ready pod -l app=postgresql -n postgresql --timeout=300s
|
||||
|
||||
# 显示状态
|
||||
echo "PostgreSQL 部署完成!"
|
||||
kubectl get pods -n postgresql
|
||||
kubectl get pvc -n postgresql
|
||||
kubectl get svc -n postgresql
|
||||
|
||||
echo ""
|
||||
echo "连接信息:"
|
||||
echo " 主机: postgresql-service.postgresql.svc.cluster.local"
|
||||
echo " 端口: 5432"
|
||||
echo " 用户: postgres"
|
||||
echo " 密码: postgres123"
|
||||
echo " 数据库: postgres"
|
||||
Reference in New Issue
Block a user