Errata

Kubernetes: Up and Running

Errata for Kubernetes: Up and Running

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Chapter3
Kubernetes UI

localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/

link is wrong. It should be

localhost:8001/api/v1/namespaces/kubernetes-system/services/https:kubernetes-dashboard:/proxy/

Mustafa Daşgın  Mar 29, 2020 
Other Digital Version Kindle location 569 or 6393
Chapter 2: "Creating and Running Containers", Section: "Multistage Image Builds"

Nowhere in the book does it actually reference where the associated code repo is!

I.e. https://github.com/kubernetes-up-and-running/kuard.git.

...the "Preface" section suggests using this repo: https://github.com/kubernetes-up-and-running/examples
but this doesn't contain the code related to the kurad app!

The first point that this becomes problematic is in Chapter 2: "Creating and Running Containers", Section: "Multistage Image Builds", when you run `docker build t kuard .` and get the error, "/bin/sh: build/build.sh: not found".

In fact, I didn't even realize that that there was a different repo that I should be using until I found this github issue (https://github.com/kubernetes-up-and-running/kuard/issues/30) associated with the error in which someone pointed out that "this issue comes when you running the Dockerfile outside the repo directory", and then provided the correct directory.





Then,

Anonymous  Apr 05, 2020 
PDF Page 24-25
Chapter 3 - Installing Kubernetes with Azure Container Service

As long as Azure Container Service will retire on January 31, 2020 (see https://azure.microsoft.com/en-us/updates/azure-container-service-will-retire-on-january-31-2020/ for more info) it's nice to slightly edit instructions for deploying Kubernetes cluster in Azure section.

I think we can use next section to replace one in the book:

Microsoft Azure offers a hosted Kubernetes-as-a-Service as Azure Kubernetes
Service. The easiest way to get started with Azure Kubernetes Service is to use
the built-in Azure Cloud Shell in the Azure portal. You can activate the shell by clicking
the shell icon:

shell icon image placeholder

in the upper-right toolbar. The shell has the az tool automatically installed and configured
to work with your Azure environment.
Alternatively, you can install the az command-line interface (CLI) on your local
machine.
Once you have the shell up and working, you can run:
$ az group create --name=kuar --location=westus
Once the resource group is created, you can create a cluster using:
$ az aks create --resource-group=kuar --name=kuar-cluster
This will take a few minutes. Once the cluster is created, you can get credentials for
the cluster with:
$ az aks get-credentials --resource-group=kuar --name=kuar-cluster
If you don’t already have the kubectl tool installed, you can install it using:
$ az aks install-cli
Complete instructions for installing Kubernetes on Azure can be found in the Azure
documentation (https://docs.microsoft.com/en-us/azure/aks/.

Andrii  Jul 09, 2019 
Printed Page 30
second title: Kuernetes UI, The final Kubernetes component is a GUI

First Edition Sept 2017 verion:

Page 30

running gcloud SDK from own laptop, Ubuntu 19.


$kubectl get services --namespace=kube-system kubernetes-dashboard

returns
Error from server (NotFound): services "kubernetes-dashboard" not found

$ kubectl get deployments --namespace=kube-system kubernetes-dashboard
Error from server (NotFound): deployments.extensions "kubernetes-dashboard" not found

next command

$kubectl proxy
works fine and able to actually access localhost:8001/ui

mambwe mumba  Feb 08, 2020 
Printed Page 57
2nd paragraph, line 2

Resource Management subject begins at page 56.

Examples from page 57 to 59 use resources.limits and resources.requests defined using "Mi" (Mebibytes) but the explanations in the book describe these values as "MB" (Megabytes)

The first example on page 57 expresses the following resource:

```yaml
---
apiVersion: v1
kind: Pod
metadata:
name: kuard
spec:
containers:
- image: gcr.io/kuar-demo/kuard-amd64:blue
name: kuard
resources:
requests:
cpu: "500m"
memory: "128Mi"
ports:
- containerPort: 8080
- name: http
- protocol: TCP
```

and describes `memory: "128Mi"` as: "128 MB of memory".

This happens in each paragraph just before each example on page 57 to 58 and in this chapters last paragraph, just above "Persisting Data with Volumes" on page 59.

Vincent Van Driessche  Jan 05, 2022 
PDF Page 73
2nd paragraph

Deprecated command
$ kubectl exec kuard date
$ kubectl exec -it kuard ash

Should be

$kubectl exec kuard -- date
$kubectl exec -it kuard -- ash

Ileriayo Adebiyi  Jan 22, 2022 
ePub Page 143
Code block for creating sample Service Objects

In Chapter 7, and many areas throughout the book, it is suggested to use

`kubectl run` with the flag --replicas. This is improper for two reasons:

1. The replicas flag is deprecated.
2. `kubectl run` is no longer recommended.

`Kubectl create` is recommended if you want to create deployments via cmd line.
This would require you to subsequently apply the labels, as `kubectl create` doesn't support --labels flag.

Example from CH. 7
$ kubectl run alpaca-prod \
--image=gcr.io/kuar-demo/kuard-amd64:blue \
--replicas=3 \
--port=8080 \
--labels="ver=1,app=alpaca,env=prod"

In actuality, to achieve this same deployment via CLI, you must:
$ kubectl create deployment alpaca-prod --image=gcr.io/kuar-demo/kuard-amd64:blue \
--replicas=3 \
--port=8080
$ kubectl label deployments alpaca-prod app- && \
kubectl label deployments alpaca-prod app=alpaca ver=1 env=prod

Note that the 'app' label is automatically applied to match the deployment name, and therefore first removed before applying all labels (in order to be congruent with the subsequent book's content and use of labels).



Adam Woolhether  Dec 07, 2020 
Printed Page 149
12-7 job-consumers.yaml

KUAR 2nd Edition
Chapter 12 Job Patterns
Page 149
12-7 job-consumers.yaml

Using the printed spec.spec.containers.image ':blue' image version and the containers do not start due to

```
Error: failed to start container "worker": Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"--keygen-enable\": executable file not found in $PATH": unknown
```

Changing the image to "gcr.io/kuar-demo/kuard-amd64:1" seems to solve the issue.

Andy Duss  Jan 29, 2020