diff --git a/docs/04-certificate-authority.md b/docs/04-certificate-authority.md index f8842d9..aba47d4 100644 --- a/docs/04-certificate-authority.md +++ b/docs/04-certificate-authority.md @@ -1,6 +1,6 @@ # Provisioning a CA and Generating TLS Certificates -In this lab you will provision a [PKI Infrastructure](https://en.wikipedia.org/wiki/Public_key_infrastructure) using CloudFlare's PKI toolkit, [cfssl](https://github.com/cloudflare/cfssl), then use it to bootstrap a Certificate Authority, and generate TLS certificates for the following components: etcd, kube-apiserver, kube-controller-manager, kube-scheduler, kubelet, and kube-proxy. +In this chapter, you will provision a [PKI Infrastructure](https://en.wikipedia.org/wiki/Public_key_infrastructure) using CloudFlare's PKI toolkit, [cfssl](https://github.com/cloudflare/cfssl), then use it to bootstrap a Certificate Authority, and generate TLS certificates for the following components: etcd, kube-apiserver, kube-controller-manager, kube-scheduler, kubelet, and kube-proxy. ## Certificate Authority @@ -9,7 +9,7 @@ In this section you will provision a Certificate Authority that can be used to g Generate the CA configuration file, certificate, and private key: ``` -{ +$ { cat > ca-config.json < admin-csr.json < ${instance}-csr.json < worker-${num}-csr.json < ${instance}-csr.json < kubernetes-csr.json < +$ for num in 1 2 3; do + scp -i ~/.ssh/id_rsa-k8s.pub ca.pem worker-${num}-key.pem worker-${num}.pem ${USERNAME}@10.240.0.2${num}:~/ done ``` Copy the appropriate certificates and private keys to each controller instance: ``` -for instance in controller-0 controller-1 controller-2; do - gcloud compute scp ca.pem ca-key.pem kubernetes-key.pem kubernetes.pem \ - service-account-key.pem service-account.pem ${instance}:~/ +$ USERNAME= +$ for num in 1 2 3; do + scp -i ~/.ssh/id_rsa-k8s.pub ca.pem ca-key.pem kubernetes-key.pem kubernetes.pem \ + service-account-key.pem service-account.pem ${USERNAME}@10.240.0.1${num}:~/ done ```