devops/cert/initcert.sh

26 lines
588 B
Bash
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
# 安装证书脚本
# 在 master 节点上执行
set -e
echo "开始安装TLS证书..."
# 1. 删除已存在的Secret如果存在
echo "删除已存在的tls Secret..."
kubectl -n default delete secret tls --ignore-not-found=true
# 2. 创建新的TLS Secret
echo "创建新的TLS Secret..."
kubectl -n default create secret tls tls \
--cert=./t-aaron.com.pem \
--key=./t-aaron.com.key
# 3. 验证Secret创建成功
echo "验证Secret创建状态..."
kubectl -n default get secret tls
echo "TLS证书安装完成"
echo "现在可以应用Ingress配置了"