Skip to content

Commit b974042

Browse files
Update to Kubernetes 1.10.2 and add gVisor support
1 parent 4f5cecb commit b974042

15 files changed

+892
-295
lines changed

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,23 @@ admin-csr.json
22
admin-key.pem
33
admin.csr
44
admin.pem
5+
admin.kubeconfig
56
ca-config.json
67
ca-csr.json
78
ca-key.pem
89
ca.csr
910
ca.pem
1011
encryption-config.yaml
12+
kube-controller-manager-csr.json
13+
kube-controller-manager-key.pem
14+
kube-controller-manager.csr
15+
kube-controller-manager.kubeconfig
16+
kube-controller-manager.pem
17+
kube-scheduler-csr.json
18+
kube-scheduler-key.pem
19+
kube-scheduler.csr
20+
kube-scheduler.kubeconfig
21+
kube-scheduler.pem
1122
kube-proxy-csr.json
1223
kube-proxy-key.pem
1324
kube-proxy.csr
@@ -32,3 +43,7 @@ worker-2-key.pem
3243
worker-2.csr
3344
worker-2.kubeconfig
3445
worker-2.pem
46+
service-account-key.pem
47+
service-account.csr
48+
service-account.pem
49+
service-account-csr.json

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ The target audience for this tutorial is someone planning to support a productio
1414

1515
Kubernetes The Hard Way guides you through bootstrapping a highly available Kubernetes cluster with end-to-end encryption between components and RBAC authentication.
1616

17-
* [Kubernetes](https://github.com/kubernetes/kubernetes) 1.9.0
18-
* [cri-containerd Container Runtime](https://github.com/kubernetes-incubator/cri-containerd) 1.0.0-beta.0
17+
* [Kubernetes](https://github.com/kubernetes/kubernetes) 1.10.2
18+
* [containerd Container Runtime](https://github.com/containerd/containerd) 1.1.0
19+
* [gVisor](https://github.com/google/gvisor) 08879266fef3a67fac1a77f1ea133c3ac75759dd
1920
* [CNI Container Networking](https://github.com/containernetworking/cni) 0.6.0
20-
* [etcd](https://github.com/coreos/etcd) 3.2.11
21+
* [etcd](https://github.com/coreos/etcd) 3.3.5
2122

2223
## Labs
2324

docs/01-prerequisites.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This tutorial leverages the [Google Cloud Platform](https://cloud.google.com/) t
1414

1515
Follow the Google Cloud SDK [documentation](https://cloud.google.com/sdk/) to install and configure the `gcloud` command line utility.
1616

17-
Verify the Google Cloud SDK version is 183.0.0 or higher:
17+
Verify the Google Cloud SDK version is 200.0.0 or higher:
1818

1919
```
2020
gcloud version
@@ -44,4 +44,14 @@ gcloud config set compute/zone us-west1-c
4444

4545
> Use the `gcloud compute zones list` command to view additional regions and zones.
4646
47+
## Running Commands in Parallel with tmux
48+
49+
[tmux](https://github.com/tmux/tmux/wiki) can be used to run commands on multiple compute instances at the same time. Labs in this tutorial may require running the same commands across multiple compute instances, in those cases consider using tmux and splitting a window into multiple panes with `synchronize-panes` enabled to speed up the provisioning process.
50+
51+
> The use of tmux is optional and not required to complete this tutorial.
52+
53+
![tmux screenshot](images/tmux-screenshot.png)
54+
55+
> Enable `synchronize-panes`: `ctrl+b` then `shift :`. Then type `set synchronize-panes on` at the prompt. To disable synchronization: `set synchronize-panes off`.
56+
4757
Next: [Installing the Client Tools](02-client-tools.md)

docs/02-client-tools.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ chmod +x cfssl cfssljson
2424
sudo mv cfssl cfssljson /usr/local/bin/
2525
```
2626

27+
Some OS X users may experience problems using the pre-built binaries in which case [Homebrew](https://brew.sh) might be a better option:
28+
29+
```
30+
brew install cfssl
31+
```
32+
2733
### Linux
2834

2935
```
@@ -69,7 +75,7 @@ The `kubectl` command line utility is used to interact with the Kubernetes API S
6975
### OS X
7076

7177
```
72-
curl -o kubectl https://storage.googleapis.com/kubernetes-release/release/v1.9.0/bin/darwin/amd64/kubectl
78+
curl -o kubectl https://storage.googleapis.com/kubernetes-release/release/v1.10.2/bin/darwin/amd64/kubectl
7379
```
7480

7581
```
@@ -83,7 +89,7 @@ sudo mv kubectl /usr/local/bin/
8389
### Linux
8490

8591
```
86-
wget https://storage.googleapis.com/kubernetes-release/release/v1.9.0/bin/linux/amd64/kubectl
92+
wget https://storage.googleapis.com/kubernetes-release/release/v1.10.2/bin/linux/amd64/kubectl
8793
```
8894

8995
```
@@ -96,7 +102,7 @@ sudo mv kubectl /usr/local/bin/
96102

97103
### Verification
98104

99-
Verify `kubectl` version 1.9.0 or higher is installed:
105+
Verify `kubectl` version 1.10.2 or higher is installed:
100106

101107
```
102108
kubectl version --client
@@ -105,7 +111,7 @@ kubectl version --client
105111
> output
106112
107113
```
108-
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.0", GitCommit:"925c127ec6b946659ad0fd596fa959be43f0cc05", GitTreeState:"clean", BuildDate:"2017-12-15T21:07:38Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"darwin/amd64"}
114+
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.2", GitCommit:"81753b10df112992bf51bbc2c2f85208aad78335", GitTreeState:"clean", BuildDate:"2018-04-27T09:22:21Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
109115
```
110116

111117
Next: [Provisioning Compute Resources](03-compute-resources.md)

docs/03-compute-resources.md

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ kubernetes-the-hard-way us-west1 XX.XXX.XXX.XX RESERVED
9292

9393
## Compute Instances
9494

95-
The compute instances in this lab will be provisioned using [Ubuntu Server](https://www.ubuntu.com/server) 16.04, which has good support for the [cri-containerd container runtime](https://github.com/containerd/cri-containerd). Each compute instance will be provisioned with a fixed private IP address to simplify the Kubernetes bootstrapping process.
95+
The compute instances in this lab will be provisioned using [Ubuntu Server](https://www.ubuntu.com/server) 18.04, which has good support for the [containerd container runtime](https://github.com/containerd/containerd). Each compute instance will be provisioned with a fixed private IP address to simplify the Kubernetes bootstrapping process.
9696

9797
### Kubernetes Controllers
9898

@@ -104,7 +104,7 @@ for i in 0 1 2; do
104104
--async \
105105
--boot-disk-size 200GB \
106106
--can-ip-forward \
107-
--image-family ubuntu-1604-lts \
107+
--image-family ubuntu-1804-lts \
108108
--image-project ubuntu-os-cloud \
109109
--machine-type n1-standard-1 \
110110
--private-network-ip 10.240.0.1${i} \
@@ -128,7 +128,7 @@ for i in 0 1 2; do
128128
--async \
129129
--boot-disk-size 200GB \
130130
--can-ip-forward \
131-
--image-family ubuntu-1604-lts \
131+
--image-family ubuntu-1804-lts \
132132
--image-project ubuntu-os-cloud \
133133
--machine-type n1-standard-1 \
134134
--metadata pod-cidr=10.200.${i}.0/24 \
@@ -159,4 +159,72 @@ worker-1 us-west1-c n1-standard-1 10.240.0.21 XX.XXX.XX.XXX
159159
worker-2 us-west1-c n1-standard-1 10.240.0.22 XXX.XXX.XX.XX RUNNING
160160
```
161161

162+
## Configuring SSH Access
163+
164+
SSH will be used to configure the controller and worker instances. When connecting to compute instances for the first time SSH keys will be generated for you and stored in the project or instance metadata as describe in the [connecting to instances](https://cloud.google.com/compute/docs/instances/connecting-to-instance) documentation.
165+
166+
Test SSH access to the `controller-0` compute instances:
167+
168+
```
169+
gcloud compute ssh controller-0
170+
```
171+
172+
If this is your first time connecting to a compute instance SSH keys will be generated for you. Enter a passphrase at the prompt to continue:
173+
174+
```
175+
WARNING: The public SSH key file for gcloud does not exist.
176+
WARNING: The private SSH key file for gcloud does not exist.
177+
WARNING: You do not have an SSH key for gcloud.
178+
WARNING: SSH keygen will be executed to generate a key.
179+
Generating public/private rsa key pair.
180+
Enter passphrase (empty for no passphrase):
181+
Enter same passphrase again:
182+
```
183+
184+
At this point the generated SSH keys will be uploaded and stored in your project:
185+
186+
```
187+
Your identification has been saved in /home/$USER/.ssh/google_compute_engine.
188+
Your public key has been saved in /home/$USER/.ssh/google_compute_engine.pub.
189+
The key fingerprint is:
190+
SHA256:nz1i8jHmgQuGt+WscqP5SeIaSy5wyIJeL71MuV+QruE $USER@$HOSTNAME
191+
The key's randomart image is:
192+
+---[RSA 2048]----+
193+
| |
194+
| |
195+
| |
196+
| . |
197+
|o. oS |
198+
|=... .o .o o |
199+
|+.+ =+=.+.X o |
200+
|.+ ==O*B.B = . |
201+
| .+.=EB++ o |
202+
+----[SHA256]-----+
203+
Updating project ssh metadata...-Updated [https://www.googleapis.com/compute/v1/projects/$PROJECT_ID].
204+
Updating project ssh metadata...done.
205+
Waiting for SSH key to propagate.
206+
```
207+
208+
After the SSH keys have been updated you'll be logged into the `controller-0` instance:
209+
210+
```
211+
Welcome to Ubuntu 18.04 LTS (GNU/Linux 4.15.0-1006-gcp x86_64)
212+
213+
...
214+
215+
Last login: Sun May 13 14:34:27 2018 from XX.XXX.XXX.XX
216+
```
217+
218+
Type `exit` at the prompt to exit the `controller-0` compute instance:
219+
220+
```
221+
$USER@controller-0:~$ exit
222+
```
223+
> output
224+
225+
```
226+
logout
227+
Connection to XX.XXX.XXX.XXX closed
228+
```
229+
162230
Next: [Provisioning a CA and Generating TLS Certificates](04-certificate-authority.md)

0 commit comments

Comments
 (0)