> 本文作者:丁辉 # Kubernetes手动证书签发 ## 环境准备 > 安装 CFSSL 1. 创建证书目录 ```bash mkdir /root/k8s cd /root/k8s ``` 2. 下载 CFSSL 文件 [Github下载地址](https://github.com/cloudflare/cfssl/releases) ```bash wget https://github.com/cloudflare/cfssl/releases/download/v1.6.4/cfssl_1.6.4_linux_amd64 wget https://github.com/cloudflare/cfssl/releases/download/v1.6.4/cfssljson_1.6.4_linux_amd64 wget https://github.com/cloudflare/cfssl/releases/download/v1.6.4/cfssl-certinfo_1.6.4_linux_amd64 ``` 3. 授权并移动到可执行目录下 ```bash chmod +x cfssl_*_linux_amd64 cfssljson_*_linux_amd64 cfssl-certinfo_*_linux_amd64 mv cfssl_*_linux_amd64 /usr/local/bin/cfssl mv cfssljson_*_linux_amd64 /usr/local/bin/cfssljson mv cfssl-certinfo_*_linux_amd64 /usr/bin/cfssl-certinfo ``` ## 开始签发证书 1. 创建 CA 证书签名请求 ```bash cat > ca-csr.json < ca-config.json < kubernetes-csr.json < admin-csr.json < kube-proxy-csr.json < kube-controller-manager-csr.json < kube-scheduler-csr.json <