Files
k3s/010-中间件/002-postgresql/deploy.sh
2026-02-05 00:11:05 +08:00

26 lines
628 B
Bash

#!/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"