Skip to content

Commit bf28509

Browse files
Update to Kubernetes 1.12.0 and add CoreDNS support
1 parent b974042 commit bf28509

10 files changed

+118
-106
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ 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.10.2
18-
* [containerd Container Runtime](https://github.com/containerd/containerd) 1.1.0
19-
* [gVisor](https://github.com/google/gvisor) 08879266fef3a67fac1a77f1ea133c3ac75759dd
17+
* [Kubernetes](https://github.com/kubernetes/kubernetes) 1.12.0
18+
* [containerd Container Runtime](https://github.com/containerd/containerd) 1.2.0-rc.0
19+
* [gVisor](https://github.com/google/gvisor) 50c283b9f56bb7200938d9e207355f05f79f0d17
2020
* [CNI Container Networking](https://github.com/containernetworking/cni) 0.6.0
21-
* [etcd](https://github.com/coreos/etcd) 3.3.5
21+
* [etcd](https://github.com/coreos/etcd) v3.3.9
22+
* [CoreDNS](https://github.com/coredns/coredns) v1.2.2
2223

2324
## Labs
2425

docs/01-prerequisites.md

Lines changed: 1 addition & 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 200.0.0 or higher:
17+
Verify the Google Cloud SDK version is 218.0.0 or higher:
1818

1919
```
2020
gcloud version

docs/02-client-tools.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ The `kubectl` command line utility is used to interact with the Kubernetes API S
7575
### OS X
7676

7777
```
78-
curl -o kubectl https://storage.googleapis.com/kubernetes-release/release/v1.10.2/bin/darwin/amd64/kubectl
78+
curl -o kubectl https://storage.googleapis.com/kubernetes-release/release/v1.12.0/bin/darwin/amd64/kubectl
7979
```
8080

8181
```
@@ -89,7 +89,7 @@ sudo mv kubectl /usr/local/bin/
8989
### Linux
9090

9191
```
92-
wget https://storage.googleapis.com/kubernetes-release/release/v1.10.2/bin/linux/amd64/kubectl
92+
wget https://storage.googleapis.com/kubernetes-release/release/v1.12.0/bin/linux/amd64/kubectl
9393
```
9494

9595
```
@@ -102,7 +102,7 @@ sudo mv kubectl /usr/local/bin/
102102

103103
### Verification
104104

105-
Verify `kubectl` version 1.10.2 or higher is installed:
105+
Verify `kubectl` version 1.12.0 or higher is installed:
106106

107107
```
108108
kubectl version --client
@@ -111,7 +111,7 @@ kubectl version --client
111111
> output
112112
113113
```
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"}
114+
Client Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.0", GitCommit:"0ed33881dc4355495f623c6f22e7dd0b7632b7c0", GitTreeState:"clean", BuildDate:"2018-09-27T17:05:32Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}
115115
```
116116

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

docs/07-bootstrapping-etcd.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ Download the official etcd release binaries from the [coreos/etcd](https://githu
2222

2323
```
2424
wget -q --show-progress --https-only --timestamping \
25-
"https://github.com/coreos/etcd/releases/download/v3.3.5/etcd-v3.3.5-linux-amd64.tar.gz"
25+
"https://github.com/coreos/etcd/releases/download/v3.3.9/etcd-v3.3.9-linux-amd64.tar.gz"
2626
```
2727

2828
Extract and install the `etcd` server and the `etcdctl` command line utility:
2929

3030
```
3131
{
32-
tar -xvf etcd-v3.3.5-linux-amd64.tar.gz
33-
sudo mv etcd-v3.3.5-linux-amd64/etcd* /usr/local/bin/
32+
tar -xvf etcd-v3.3.9-linux-amd64.tar.gz
33+
sudo mv etcd-v3.3.9-linux-amd64/etcd* /usr/local/bin/
3434
}
3535
```
3636

docs/08-bootstrapping-kubernetes-controllers.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ Download the official Kubernetes release binaries:
2828

2929
```
3030
wget -q --show-progress --https-only --timestamping \
31-
"https://storage.googleapis.com/kubernetes-release/release/v1.10.2/bin/linux/amd64/kube-apiserver" \
32-
"https://storage.googleapis.com/kubernetes-release/release/v1.10.2/bin/linux/amd64/kube-controller-manager" \
33-
"https://storage.googleapis.com/kubernetes-release/release/v1.10.2/bin/linux/amd64/kube-scheduler" \
34-
"https://storage.googleapis.com/kubernetes-release/release/v1.10.2/bin/linux/amd64/kubectl"
31+
"https://storage.googleapis.com/kubernetes-release/release/v1.12.0/bin/linux/amd64/kube-apiserver" \
32+
"https://storage.googleapis.com/kubernetes-release/release/v1.12.0/bin/linux/amd64/kube-controller-manager" \
33+
"https://storage.googleapis.com/kubernetes-release/release/v1.12.0/bin/linux/amd64/kube-scheduler" \
34+
"https://storage.googleapis.com/kubernetes-release/release/v1.12.0/bin/linux/amd64/kubectl"
3535
```
3636

3737
Install the Kubernetes binaries:
@@ -267,7 +267,7 @@ curl -H "Host: kubernetes.default.svc.cluster.local" -i http://127.0.0.1/healthz
267267
```
268268
HTTP/1.1 200 OK
269269
Server: nginx/1.14.0 (Ubuntu)
270-
Date: Mon, 14 May 2018 13:45:39 GMT
270+
Date: Sun, 30 Sep 2018 17:44:24 GMT
271271
Content-Type: text/plain; charset=utf-8
272272
Content-Length: 2
273273
Connection: keep-alive
@@ -397,12 +397,12 @@ curl --cacert ca.pem https://${KUBERNETES_PUBLIC_ADDRESS}:6443/version
397397
```
398398
{
399399
"major": "1",
400-
"minor": "10",
401-
"gitVersion": "v1.10.2",
402-
"gitCommit": "81753b10df112992bf51bbc2c2f85208aad78335",
400+
"minor": "12",
401+
"gitVersion": "v1.12.0",
402+
"gitCommit": "0ed33881dc4355495f623c6f22e7dd0b7632b7c0",
403403
"gitTreeState": "clean",
404-
"buildDate": "2018-04-27T09:10:24Z",
405-
"goVersion": "go1.9.3",
404+
"buildDate": "2018-09-27T16:55:41Z",
405+
"goVersion": "go1.10.4",
406406
"compiler": "gc",
407407
"platform": "linux/amd64"
408408
}

docs/09-bootstrapping-kubernetes-workers.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ Install the OS dependencies:
3131

3232
```
3333
wget -q --show-progress --https-only --timestamping \
34-
https://github.com/kubernetes-incubator/cri-tools/releases/download/v1.0.0-beta.0/crictl-v1.0.0-beta.0-linux-amd64.tar.gz \
35-
https://storage.googleapis.com/kubernetes-the-hard-way/runsc \
34+
https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.12.0/crictl-v1.12.0-linux-amd64.tar.gz \
35+
https://storage.googleapis.com/kubernetes-the-hard-way/runsc-50c283b9f56bb7200938d9e207355f05f79f0d17 \
3636
https://github.com/opencontainers/runc/releases/download/v1.0.0-rc5/runc.amd64 \
3737
https://github.com/containernetworking/plugins/releases/download/v0.6.0/cni-plugins-amd64-v0.6.0.tgz \
38-
https://github.com/containerd/containerd/releases/download/v1.1.0/containerd-1.1.0.linux-amd64.tar.gz \
39-
https://storage.googleapis.com/kubernetes-release/release/v1.10.2/bin/linux/amd64/kubectl \
40-
https://storage.googleapis.com/kubernetes-release/release/v1.10.2/bin/linux/amd64/kube-proxy \
41-
https://storage.googleapis.com/kubernetes-release/release/v1.10.2/bin/linux/amd64/kubelet
38+
https://github.com/containerd/containerd/releases/download/v1.2.0-rc.0/containerd-1.2.0-rc.0.linux-amd64.tar.gz \
39+
https://storage.googleapis.com/kubernetes-release/release/v1.12.0/bin/linux/amd64/kubectl \
40+
https://storage.googleapis.com/kubernetes-release/release/v1.12.0/bin/linux/amd64/kube-proxy \
41+
https://storage.googleapis.com/kubernetes-release/release/v1.12.0/bin/linux/amd64/kubelet
4242
```
4343

4444
Create the installation directories:
@@ -57,12 +57,13 @@ Install the worker binaries:
5757

5858
```
5959
{
60-
chmod +x kubectl kube-proxy kubelet runc.amd64 runsc
60+
sudo mv runsc-50c283b9f56bb7200938d9e207355f05f79f0d17 runsc
6161
sudo mv runc.amd64 runc
62+
chmod +x kubectl kube-proxy kubelet runc runsc
6263
sudo mv kubectl kube-proxy kubelet runc runsc /usr/local/bin/
63-
sudo tar -xvf crictl-v1.0.0-beta.0-linux-amd64.tar.gz -C /usr/local/bin/
64+
sudo tar -xvf crictl-v1.12.0-linux-amd64.tar.gz -C /usr/local/bin/
6465
sudo tar -xvf cni-plugins-amd64-v0.6.0.tgz -C /opt/cni/bin/
65-
sudo tar -xvf containerd-1.1.0.linux-amd64.tar.gz -C /
66+
sudo tar -xvf containerd-1.2.0-rc.0.linux-amd64.tar.gz -C /
6667
}
6768
```
6869

@@ -129,6 +130,10 @@ cat << EOF | sudo tee /etc/containerd/config.toml
129130
runtime_type = "io.containerd.runtime.v1.linux"
130131
runtime_engine = "/usr/local/bin/runsc"
131132
runtime_root = "/run/containerd/runsc"
133+
[plugins.cri.containerd.gvisor]
134+
runtime_type = "io.containerd.runtime.v1.linux"
135+
runtime_engine = "/usr/local/bin/runsc"
136+
runtime_root = "/run/containerd/runsc"
132137
EOF
133138
```
134139

@@ -189,12 +194,15 @@ clusterDomain: "cluster.local"
189194
clusterDNS:
190195
- "10.32.0.10"
191196
podCIDR: "${POD_CIDR}"
197+
resolvConf: "/run/systemd/resolve/resolv.conf"
192198
runtimeRequestTimeout: "15m"
193199
tlsCertFile: "/var/lib/kubelet/${HOSTNAME}.pem"
194200
tlsPrivateKeyFile: "/var/lib/kubelet/${HOSTNAME}-key.pem"
195201
EOF
196202
```
197203

204+
> The `resolvConf` configuration is used to avoid loops when using CoreDNS for service discovery on systems running `systemd-resolved`.
205+
198206
Create the `kubelet.service` systemd unit file:
199207

200208
```
@@ -287,10 +295,10 @@ gcloud compute ssh controller-0 \
287295
> output
288296
289297
```
290-
NAME STATUS ROLES AGE VERSION
291-
worker-0 Ready <none> 20s v1.10.2
292-
worker-1 Ready <none> 20s v1.10.2
293-
worker-2 Ready <none> 20s v1.10.2
298+
NAME STATUS ROLES AGE VERSION
299+
worker-0 Ready <none> 35s v1.12.0
300+
worker-1 Ready <none> 36s v1.12.0
301+
worker-2 Ready <none> 36s v1.12.0
294302
```
295303

296304
Next: [Configuring kubectl for Remote Access](10-configuring-kubectl.md)

docs/10-configuring-kubectl.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ kubectl get nodes
6161
> output
6262
6363
```
64-
NAME STATUS ROLES AGE VERSION
65-
worker-0 Ready <none> 1m v1.10.2
66-
worker-1 Ready <none> 1m v1.10.2
67-
worker-2 Ready <none> 1m v1.10.2
64+
NAME STATUS ROLES AGE VERSION
65+
worker-0 Ready <none> 117s v1.12.0
66+
worker-1 Ready <none> 118s v1.12.0
67+
worker-2 Ready <none> 118s v1.12.0
6868
```
6969

7070
Next: [Provisioning Pod Network Routes](11-pod-network-routes.md)

docs/11-pod-network-routes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ gcloud compute routes list --filter "network: kubernetes-the-hard-way"
5050
5151
```
5252
NAME NETWORK DEST_RANGE NEXT_HOP PRIORITY
53-
default-route-236a40a8bc992b5b kubernetes-the-hard-way 0.0.0.0/0 default-internet-gateway 1000
54-
default-route-df77b1e818a56b30 kubernetes-the-hard-way 10.240.0.0/24 1000
53+
default-route-081879136902de56 kubernetes-the-hard-way 10.240.0.0/24 kubernetes-the-hard-way 1000
54+
default-route-55199a5aa126d7aa kubernetes-the-hard-way 0.0.0.0/0 default-internet-gateway 1000
5555
kubernetes-route-10-200-0-0-24 kubernetes-the-hard-way 10.200.0.0/24 10.240.0.20 1000
5656
kubernetes-route-10-200-1-0-24 kubernetes-the-hard-way 10.200.1.0/24 10.240.0.21 1000
5757
kubernetes-route-10-200-2-0-24 kubernetes-the-hard-way 10.200.2.0/24 10.240.0.22 1000

docs/12-dns-addon.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
# Deploying the DNS Cluster Add-on
22

3-
In this lab you will deploy the [DNS add-on](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/) which provides DNS based service discovery to applications running inside the Kubernetes cluster.
3+
In this lab you will deploy the [DNS add-on](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/) which provides DNS based service discovery, backed by [CoreDNS](https://coredns.io/), to applications running inside the Kubernetes cluster.
44

55
## The DNS Cluster Add-on
66

7-
Deploy the `kube-dns` cluster add-on:
7+
Deploy the `coredns` cluster add-on:
88

99
```
10-
kubectl create -f https://storage.googleapis.com/kubernetes-the-hard-way/kube-dns.yaml
10+
kubectl apply -f https://storage.googleapis.com/kubernetes-the-hard-way/coredns.yaml
1111
```
1212

1313
> output
1414
1515
```
16-
service "kube-dns" created
17-
serviceaccount "kube-dns" created
18-
configmap "kube-dns" created
19-
deployment.extensions "kube-dns" created
16+
serviceaccount/coredns created
17+
clusterrole.rbac.authorization.k8s.io/system:coredns created
18+
clusterrolebinding.rbac.authorization.k8s.io/system:coredns created
19+
configmap/coredns created
20+
deployment.extensions/coredns created
21+
service/kube-dns created
2022
```
2123

2224
List the pods created by the `kube-dns` deployment:
@@ -28,16 +30,17 @@ kubectl get pods -l k8s-app=kube-dns -n kube-system
2830
> output
2931
3032
```
31-
NAME READY STATUS RESTARTS AGE
32-
kube-dns-3097350089-gq015 3/3 Running 0 20s
33+
NAME READY STATUS RESTARTS AGE
34+
coredns-699f8ddd77-94qv9 1/1 Running 0 20s
35+
coredns-699f8ddd77-gtcgb 1/1 Running 0 20s
3336
```
3437

3538
## Verification
3639

3740
Create a `busybox` deployment:
3841

3942
```
40-
kubectl run busybox --image=busybox --command -- sleep 3600
43+
kubectl run busybox --image=busybox:1.28 --command -- sleep 3600
4144
```
4245

4346
List the pod created by the `busybox` deployment:
@@ -49,8 +52,8 @@ kubectl get pods -l run=busybox
4952
> output
5053
5154
```
52-
NAME READY STATUS RESTARTS AGE
53-
busybox-2125412808-mt2vb 1/1 Running 0 15s
55+
NAME READY STATUS RESTARTS AGE
56+
busybox-bd8fb7cbd-vflm9 1/1 Running 0 10s
5457
```
5558

5659
Retrieve the full name of the `busybox` pod:

0 commit comments

Comments
 (0)