diff --git a/docs/02-certificate-authority.md b/docs/02-certificate-authority.md index c67ede9..975c200 100644 --- a/docs/02-certificate-authority.md +++ b/docs/02-certificate-authority.md @@ -1,8 +1,6 @@ -# Setting up a Certificate Authority and TLS Cert Generation +# Setting up a Certificate Authority and Creating TLS Certificates -In this lab you will setup the necessary PKI infrastructure to secure the Kubernetes components. This lab will leverage CloudFlare's PKI toolkit, [cfssl](https://github.com/cloudflare/cfssl), to bootstrap a Certificate Authority and generate TLS certificates. - -In this lab you will generate a set of TLS certificates that can be used to secure the following Kubernetes components: +In this lab you will setup the necessary PKI infrastructure to secure the Kubernetes components. This lab will leverage CloudFlare's PKI toolkit, [cfssl](https://github.com/cloudflare/cfssl), to bootstrap a Certificate Authority and generate TLS certificates to secure the following Kubernetes components: * etcd * kube-apiserver @@ -22,7 +20,6 @@ kube-proxy.pem kube-proxy-key.pem ``` - ## Install CFSSL This lab requires the `cfssl` and `cfssljson` binaries. Download them from the [cfssl repository](https://pkg.cfssl.org). @@ -101,7 +98,7 @@ cat > ca-csr.json < kubernetes-csr.json < kubernetes-csr.json < Login to each machine using the gcloud compute ssh command + +--- + Copy the bootstrap token into place: ``` @@ -79,18 +83,13 @@ sudo mv kube-apiserver kube-controller-manager kube-scheduler kubectl /usr/bin/ ### Kubernetes API Server - -#### Create the systemd unit file - -Capture the internal IP address: +Capture the internal IP address of the machine: ``` INTERNAL_IP=$(curl -s -H "Metadata-Flavor: Google" \ http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/ip) ``` ---- - Create the systemd unit file: ``` diff --git a/docs/06-kubernetes-worker.md b/docs/06-kubernetes-worker.md index 9cc264a..5e09d2f 100644 --- a/docs/06-kubernetes-worker.md +++ b/docs/06-kubernetes-worker.md @@ -17,9 +17,13 @@ Some people would like to run workers and cluster services anywhere in the clust ## Prerequisites -Each worker node will provision a unqiue TLS client certificate as defined in the [kubelet TLS bootstrapping guide](https://kubernetes.io/docs/admin/kubelet-tls-bootstrapping/). The `kubelet-bootstrap` user must be granted permission to request a client TLS certificate. Run the following command on a controller node to enable TLS bootstrapping: +Each worker node will provision a unqiue TLS client certificate as defined in the [kubelet TLS bootstrapping guide](https://kubernetes.io/docs/admin/kubelet-tls-bootstrapping/). The `kubelet-bootstrap` user must be granted permission to request a client TLS certificate. -Bind the `kubelet-bootstrap` user to the `system:node-bootstrapper` cluster role: +``` +gcloud compute ssh controller0 +``` + +Enable TLS bootstrapping by binding the `kubelet-bootstrap` user to the `system:node-bootstrapper` cluster role: ``` kubectl create clusterrolebinding kubelet-bootstrap \ @@ -32,21 +36,13 @@ kubectl create clusterrolebinding kubelet-bootstrap \ Run the following commands on `worker0`, `worker1`, `worker2`: ``` -sudo mkdir -p /var/lib/kubelet -``` - -``` -sudo mkdir -p /var/lib/kube-proxy +sudo mkdir -p /var/lib/{kubelet,kube-proxy,kubernetes} ``` ``` sudo mkdir -p /var/run/kubernetes ``` -``` -sudo mkdir -p /var/lib/kubernetes -``` - ``` sudo mv bootstrap.kubeconfig /var/lib/kubelet ``` diff --git a/docs/07-kubectl.md b/docs/07-kubectl.md index 8505b1b..f86861f 100644 --- a/docs/07-kubectl.md +++ b/docs/07-kubectl.md @@ -74,7 +74,6 @@ etcd-0 Healthy {"health": "true"} etcd-1 Healthy {"health": "true"} ``` - ``` kubectl get nodes ``` diff --git a/docs/09-dns-addon.md b/docs/09-dns-addon.md index 814bf02..bf26486 100644 --- a/docs/09-dns-addon.md +++ b/docs/09-dns-addon.md @@ -19,8 +19,6 @@ kubectl create clusterrolebinding serviceaccounts-cluster-admin \ kubectl create -f https://raw.githubusercontent.com/kelseyhightower/kubernetes-the-hard-way/master/services/kubedns.yaml ``` -#### Verification - ``` kubectl --namespace=kube-system get svc ``` @@ -36,8 +34,6 @@ kube-dns 10.32.0.10 53/UDP,53/TCP 5s kubectl create -f https://raw.githubusercontent.com/kelseyhightower/kubernetes-the-hard-way/master/deployments/kubedns.yaml ``` -#### Verification - ``` kubectl --namespace=kube-system get pods ```