码迷,mamicode.com
首页 > 其他好文 > 详细

k8s 之证书签发

时间:2020-06-08 16:15:54      阅读:104      评论:0      收藏:0      [点我收藏+]

标签:根证书   tps   k8s   from   工具   mod   new   amd   mes   

1.证书签发准备
准备签发证书环境
运维主机 HDSS7-200.host.com上:
安装CFSSL
证书签发工具CFSSL:R1.2
cfssl下载地址
cfssl-json下载地址
cfssl-certinfo下载地址
[root@hdss7-200 ~]# wget https://pkg.cfssl.org/R1.2/cfssl_linux-amd64 -O /usr/bin/cfssl
[root@hdss7-200 ~]# wget https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64 -O /usr/bin/cfssl-json
[root@hdss7-200 ~]# wget https://pkg.cfssl.org/R1.2/cfssl-certinfo_linux-amd64 -O /usr/bin/cfssl-certinfo
[root@hdss7-200 ~]# chmod +x /usr/bin/cfssl*
[root@hdss7-200 ~]# cd /opt/
[root@hdss7-200 opt]# mkdir certs
[root@hdss7-200 opt]# vim /opt/certs/ca-csr.json
[root@hdss7-200 opt]# cat /opt/certs/ca-csr.json
{
"CN": "Banma",
"hosts": [
],
"key": {
"algo": "rsa",
"size": 2048
},
"names": [
{
"C": "CN",
"ST": "beijing",
"L": "beijing",
"O": "od",
"OU": "ops"
}
],
"ca": {
"expiry": "175200h"
}
}
[root@hdss7-200 certs]# cfssl gencert -initca ca-csr.json | cfssl-json -bare ca
2020/06/06 11:19:07 [INFO] generating a new CA key and certificate from CSR
2020/06/06 11:19:07 [INFO] generate received request
2020/06/06 11:19:07 [INFO] received CSR
2020/06/06 11:19:07 [INFO] generating key: rsa-2048
2020/06/06 11:19:07 [INFO] encoded CSR
2020/06/06 11:19:07 [INFO] signed certificate with serial number 338063746541492966339048061307851413764026027302
[root@hdss7-200 certs]# ll
total 16
-rw-r--r-- 1 root root 989 Jun 6 11:19 ca.csr
-rw-r--r-- 1 root root 334 Jun 6 11:18 ca-csr.json
-rw------- 1 root root 1679 Jun 6 11:19 ca-key.pem #根证书私钥
-rw-r--r-- 1 root root 1334 Jun 6 11:19 ca.pem #根证书

k8s 之证书签发

标签:根证书   tps   k8s   from   工具   mod   new   amd   mes   

原文地址:https://blog.51cto.com/13786105/2502344

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!