自签证书

#!/bin/bash

# 生成私钥
openssl genpkey -algorithm RSA -out private.key

# 生成证书请求
openssl req -new -key private.key -out certificate.csr

# 自签名证书
openssl x509 -req -days 365 -in certificate.csr -signkey private.key -out certificate.crt

# 输出证书信息
openssl x509 -in certificate.crt -noout -subject -issuer

# 生成私钥
(umask 077; openssl genrsa -out blog.wxx.com.key 2048)
# 生成证书请求
openssl req -new -x509 -key blog.wxx.com.key -out blog.wxx.com.crt -subj /C=CN/ST=Beijing/L=Beijing/O=DevOps/CN=blog.wxx.com
#k8s中创建secret
kubectl create secret tls blog.magedu.com --cert=./blog.wxx.com.crt --key=./blog.wxx.com.key -n blog

kubectl create ingress wordpress --rule='blog.magedu.com/*=wordpress:80,tls=blog.magedu.com' --class='nginx' -n blog

posted on 2024-07-16 17:39  HowOldAreYou  阅读(14)  评论(0编辑  收藏  举报

导航