K8S 二进制安装部署_03_部署签发证书环境

在运维主机:10.4.7.200 上面部署

安装证书签发工具CFSSL:R1.2
需要下载三个软件:
wget https://pkg.cfssl.org/R1.2/cfssl_linux-amd64 -O /usr/bin/cfssl
wget https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64 -O /usr/bin/cfssl-json
wget https://pkg.cfssl.org/R1.2/cfssl-certinfo_linux-amd64 -O /usr/bin/cfssl-certinfo

chmod +x /usr/bin/cfssl*
mkdir -p /opt/certs && cd /opt/certs
++++++++++
我们要自签证书,首先要有一个根证书,这个根证书叫 CA 证书。

制作根证书:

先创建CA证书签名请求(csr)的json配置文件

vim /opt/certs/ca-csr.json

{
      "CN": "OldboyEdu",
      "hosts": [
      ],
      "key": {
           "algo": "rsa",
           "size": 2048
      },
      "names": [
         {
             "C": "CN",
             "ST": "beijing",
             "L": "beijing",
             "O": "od",
             "OU": "ops"
         }
     ],
     "ca": {
         "expiry": "175200h"
     }
}



文件说明:
"CN": "OldboyEdu" (CA证书机构)
hosts: 这里暂时没有,后面签发证书的时候会有
"key": {
     "algo": "rsa", ##加密算法
     "size": 2048  #长度
},

name:[ ] 说明:
CN:Common Name,浏览器使用该字段验证网站是否合法,一般写的是域名。
C:Country,国家
ST:State,州,省
L:Locality,地区,城市
O:Organization Name,组织名称,公司名称
OU:Organization Unit Name ,组织单位名称,公司部门

"ca": {
   "expiry": "175200h"  ##过期时间(20年)
}
+++++++++++=
开始签证书:
cd /opt/certs/
cfssl gencert -initca ca-csr.json | cfssl-json -bare ca



ca-key.pem ## 根证书的私钥