diff --git a/slides/common/intro.md b/slides/common/intro.md index 0048853f..1660fa1f 100644 --- a/slides/common/intro.md +++ b/slides/common/intro.md @@ -9,12 +9,10 @@ - We recommend having a mentor to help you ... -- ... Or be comfortable spending some time reading the Docker - [documentation](https://docs.docker.com/) ... +- ... Or be comfortable spending some time reading the Kubernetes + [documentation](https://kubernetes.io/docs/) ... -- ... And looking for answers in the [Docker forums](forums.docker.com), - [StackOverflow](http://stackoverflow.com/questions/tagged/docker), - and other outlets +- ... And looking for answers on [StackOverflow](http://stackoverflow.com/questions/tagged/kubernetes) and other outlets --- diff --git a/slides/common/prereqs.md b/slides/common/prereqs.md index 28e6770d..d18cb730 100644 --- a/slides/common/prereqs.md +++ b/slides/common/prereqs.md @@ -26,7 +26,7 @@ class: extra-details - This slide should have a little magnifying glass in the top left corner - (If it doesn't, it's because CSS is hard — Jérôme is only a backend person, alas) + (If it doesn't, it's because CSS is hard — we're only backend people, alas!) - Slides with that magnifying glass indicate slides providing extra details @@ -62,7 +62,7 @@ Misattributed to Benjamin Franklin - This is the stuff you're supposed to do! -- Go to [container.training](http://container.training/) to view these slides +- Go to [indexconf2018.container.training](http://indexconf2018.container.training/) to view these slides - Join the chat room on @@CHAT@@ @@ -78,17 +78,11 @@ class: in-person --- -class: in-person, pic - -![You get five VMs](images/you-get-five-vms.jpg) - ---- - class: in-person -## You get five VMs +## You get three VMs -- Each person gets 5 private VMs (not shared with anybody else) +- Each person gets 3 private VMs (not shared with anybody else) - They'll remain up for the duration of the workshop @@ -153,7 +147,7 @@ class: in-person - -] - -Tip: use `^S` and `^Q` to pause/resume log output. - ---- - -class: extra-details - -## Upgrading from Compose 1.6 - -.warning[The `logs` command has changed between Compose 1.6 and 1.7!] - -- Up to 1.6 - - - `docker-compose logs` is the equivalent of `logs --follow` - - - `docker-compose logs` must be restarted if containers are added - -- Since 1.7 - - - `--follow` must be specified explicitly - - - new containers are automatically picked up by `docker-compose logs` - ---- - ## Connecting to the web UI - The `webui` container exposes a web dashboard; let's view it @@ -275,245 +145,6 @@ graph will appear. --- -class: self-paced, extra-details - -## If the graph doesn't load - -If you just see a `Page not found` error, it might be because your -Docker Engine is running on a different machine. This can be the case if: - -- you are using the Docker Toolbox - -- you are using a VM (local or remote) created with Docker Machine - -- you are controlling a remote Docker Engine - -When you run DockerCoins in development mode, the web UI static files -are mapped to the container using a volume. Alas, volumes can only -work on a local environment, or when using Docker4Mac or Docker4Windows. - -How to fix this? - -Edit `dockercoins.yml` and comment out the `volumes` section, and try again. - ---- - -class: extra-details - -## Why does the speed seem irregular? - -- It *looks like* the speed is approximately 4 hashes/second - -- Or more precisely: 4 hashes/second, with regular dips down to zero - -- Why? - --- - -class: extra-details - -- The app actually has a constant, steady speed: 3.33 hashes/second -
- (which corresponds to 1 hash every 0.3 seconds, for *reasons*) - -- Yes, and? - ---- - -class: extra-details - -## The reason why this graph is *not awesome* - -- The worker doesn't update the counter after every loop, but up to once per second - -- The speed is computed by the browser, checking the counter about once per second - -- Between two consecutive updates, the counter will increase either by 4, or by 0 - -- The perceived speed will therefore be 4 - 4 - 4 - 0 - 4 - 4 - 0 etc. - -- What can we conclude from this? - --- - -class: extra-details - -- Jérôme is clearly incapable of writing good frontend code - ---- - -## Scaling up the application - -- Our goal is to make that performance graph go up (without changing a line of code!) - --- - -- Before trying to scale the application, we'll figure out if we need more resources - - (CPU, RAM...) - -- For that, we will use good old UNIX tools on our Docker node - ---- - -## Looking at resource usage - -- Let's look at CPU, memory, and I/O usage - -.exercise[ - -- run `top` to see CPU and memory usage (you should see idle cycles) - - - -- run `vmstat 1` to see I/O usage (si/so/bi/bo) -
(the 4 numbers should be almost zero, except `bo` for logging) - - - -] - -We have available resources. - -- Why? -- How can we use them? - ---- - -## Scaling workers on a single node - -- Docker Compose supports scaling -- Let's scale `worker` and see what happens! - -.exercise[ - -- Start one more `worker` container: - ```bash - docker-compose scale worker=2 - ``` - -- Look at the performance graph (it should show a x2 improvement) - -- Look at the aggregated logs of our containers (`worker_2` should show up) - -- Look at the impact on CPU load with e.g. top (it should be negligible) - -] - ---- - -## Adding more workers - -- Great, let's add more workers and call it a day, then! - -.exercise[ - -- Start eight more `worker` containers: - ```bash - docker-compose scale worker=10 - ``` - -- Look at the performance graph: does it show a x10 improvement? - -- Look at the aggregated logs of our containers - -- Look at the impact on CPU load and memory usage - -] - ---- - -# Identifying bottlenecks - -- You should have seen a 3x speed bump (not 10x) - -- Adding workers didn't result in linear improvement - -- *Something else* is slowing us down - --- - -- ... But what? - --- - -- The code doesn't have instrumentation - -- Let's use state-of-the-art HTTP performance analysis! -
(i.e. good old tools like `ab`, `httping`...) - ---- - -## Accessing internal services - -- `rng` and `hasher` are exposed on ports 8001 and 8002 - -- This is declared in the Compose file: - - ```yaml - ... - rng: - build: rng - ports: - - "8001:80" - - hasher: - build: hasher - ports: - - "8002:80" - ... - ``` - ---- - -## Measuring latency under load - -We will use `httping`. - -.exercise[ - -- Check the latency of `rng`: - ```bash - httping -c 3 localhost:8001 - ``` - -- Check the latency of `hasher`: - ```bash - httping -c 3 localhost:8002 - ``` - -] - -`rng` has a much higher latency than `hasher`. - ---- - -## Let's draw hasty conclusions - -- The bottleneck seems to be `rng` - -- *What if* we don't have enough entropy and can't generate enough random numbers? - -- We need to scale out the `rng` service on multiple machines! - -Note: this is a fiction! We have enough entropy. But we need a pretext to scale out. - -(In fact, the code of `rng` uses `/dev/urandom`, which never runs out of entropy... -
-...and is [just as good as `/dev/random`](http://www.slideshare.net/PacSecJP/filippo-plain-simple-reality-of-entropy).) - ---- - ## Clean up - Before moving on, let's remove those containers diff --git a/slides/common/thankyou.md b/slides/common/thankyou.md index af8fc431..696feaaa 100644 --- a/slides/common/thankyou.md +++ b/slides/common/thankyou.md @@ -6,7 +6,7 @@ Thank you! class: title, in-person -That's all folks!
Questions? +That's all, folks!
Questions? ![end](images/end.jpg) @@ -14,13 +14,9 @@ That's all folks!
Questions? # Links and resources -- [Docker Community Slack](https://community.docker.com/registrations/groups/4316) -- [Docker Community Forums](https://forums.docker.com/) -- [Docker Hub](https://hub.docker.com) -- [Docker Blog](http://blog.docker.com/) -- [Docker documentation](http://docs.docker.com/) -- [Docker on StackOverflow](https://stackoverflow.com/questions/tagged/docker) -- [Docker on Twitter](http://twitter.com/docker) -- [Play With Docker Hands-On Labs](http://training.play-with-docker.com/) +- [Kubernetes Community](https://kubernetes.io/community/) - Slack, Google Groups, meetups +- [Play With Kubernetes Hands-On Labs](https://medium.com/@marcosnils/introducing-pwk-play-with-k8s-159fcfeb787b) +- [Local meetups](https://www.meetup.com/) +- [Microsoft Cloud Developer Advocates](https://developer.microsoft.com/en-us/advocates/) .footnote[These slides (and future updates) are on → http://container.training/] diff --git a/slides/common/title.md b/slides/common/title.md index 1d7755d4..d7e36ce5 100644 --- a/slides/common/title.md +++ b/slides/common/title.md @@ -17,5 +17,5 @@ class: title, in-person *Don't stream videos or download big files during the workshop.*
*Thank you!* -**Slides: http://container.training/** -] \ No newline at end of file +**Slides: http://indexconf2018.container.training/** +] diff --git a/slides/index.html b/slides/index.html index 7a2500a9..c4abfae3 100644 --- a/slides/index.html +++ b/slides/index.html @@ -66,14 +66,10 @@ Coming soon at a conference near you - - - Nothing for now (stay tuned...) + February 22, 2018: IndexConf - Kubernetes 101 - + Past workshops @@ -157,4 +153,4 @@ - \ No newline at end of file + diff --git a/slides/kube-halfday.yml b/slides/kube-halfday.yml index 7ca89f17..06858592 100644 --- a/slides/kube-halfday.yml +++ b/slides/kube-halfday.yml @@ -1,9 +1,7 @@ title: | - Deploying and Scaling Microservices - with Docker and Kubernetes + Kubernetes 101 -chat: "[Slack](https://dockercommunity.slack.com/messages/C7GKACWDV)" -#chat: "[Gitter](https://gitter.im/jpetazzo/workshop-yyyymmdd-city)" +chat: "[Gitter](https://gitter.im/jpetazzo/workshop-20180222-sf)" exclude: - self-paced diff --git a/slides/kube/daemonset.md b/slides/kube/daemonset.md index c878c6da..b07244f3 100644 --- a/slides/kube/daemonset.md +++ b/slides/kube/daemonset.md @@ -4,7 +4,7 @@ - We want one (and exactly one) instance of `rng` per node -- If we just scale `deploy/rng` to 4, nothing guarantees that they spread +- If we just scale `deploy/rng` to 2, nothing guarantees that they spread - Instead of a `deployment`, we will use a `daemonset` @@ -22,7 +22,7 @@ ## Creating a daemon set -- Unfortunately, as of Kubernetes 1.8, the CLI cannot create daemon sets +- Unfortunately, as of Kubernetes 1.9, the CLI cannot create daemon sets -- @@ -406,4 +406,4 @@ The timestamps should give us a hint about how many pods are currently receiving - Bonus exercise 1: clean up the pods of the "old" daemon set -- Bonus exercise 2: how could we have done to avoid creating new pods? +- Bonus exercise 2: how could we have done this to avoid creating new pods? diff --git a/slides/kube/dashboard.md b/slides/kube/dashboard.md index 21ef54b6..6ca02517 100644 --- a/slides/kube/dashboard.md +++ b/slides/kube/dashboard.md @@ -89,7 +89,13 @@ The goo.gl URL expands to: - Connect to https://oneofournodes:3xxxx/ - (You will have to work around the TLS certificate validation warning) + - Yes, https. If you use http it will say: + + This page isn’t working + sent an invalid response. + ERR_INVALID_HTTP_RESPONSE + + - You will have to work around the TLS certificate validation warning @@ -109,7 +115,7 @@ The goo.gl URL expands to: ## Granting more rights to the dashboard -- The dashboard documentation [explains how to do](https://github.com/kubernetes/dashboard/wiki/Access-control#admin-privileges) +- The dashboard documentation [explains how to do this](https://github.com/kubernetes/dashboard/wiki/Access-control#admin-privileges) - We just need to load another YAML file! diff --git a/slides/kube/kubectlget.md b/slides/kube/kubectlget.md index c29744fb..c3087d98 100644 --- a/slides/kube/kubectlget.md +++ b/slides/kube/kubectlget.md @@ -48,7 +48,7 @@ .exercise[ -- Give us more info about them nodes: +- Give us more info about the nodes: ```bash kubectl get nodes -o wide ``` @@ -136,7 +136,7 @@ There is already one service on our cluster: the Kubernetes API itself. ``` - `-k` is used to skip certificate verification - - Make sure to replace 10.96.0.1 with the CLUSTER-IP shown earlier + - Make sure to replace 10.96.0.1 with the CLUSTER-IP shown by `$ kubectl get svc` ] @@ -173,7 +173,7 @@ The error that we see is expected: the Kubernetes API requires authentication. ## Namespaces -- Namespaces allow to segregate resources +- Namespaces allow us to segregate resources .exercise[ diff --git a/slides/kube/kubectlrun.md b/slides/kube/kubectlrun.md index f94439f1..665e3038 100644 --- a/slides/kube/kubectlrun.md +++ b/slides/kube/kubectlrun.md @@ -245,4 +245,4 @@ at the Google NOC ...
.small[are we getting 1000 packets per second]
-.small[of ICMP ECHO traffic from EC2 ?!?”] +.small[of ICMP ECHO traffic from Azure ?!?”] diff --git a/slides/kube/ourapponkube.md b/slides/kube/ourapponkube.md index f50d28e4..f2ec887d 100644 --- a/slides/kube/ourapponkube.md +++ b/slides/kube/ourapponkube.md @@ -40,7 +40,7 @@ In this part, we will: - We could use the Docker Hub -- Or a service offered by our cloud provider (GCR, ECR...) +- Or a service offered by our cloud provider (ACR, GCR, ECR...) - Or we could just self-host that registry diff --git a/slides/kube/rollout.md b/slides/kube/rollout.md index 10a49913..21e25898 100644 --- a/slides/kube/rollout.md +++ b/slides/kube/rollout.md @@ -149,7 +149,7 @@ Our rollout is stuck. However, the app is not dead (just 10% slower). - We want to: - - revert to `v0.1` + - revert to `v0.1` (which we now realize we didn't tag - yikes!) - be conservative on availability (always have desired number of available workers) - be aggressive on rollout speed (update more than one pod at a time) - give some time to our workers to "warm up" before starting more @@ -163,7 +163,7 @@ spec: spec: containers: - name: worker - image: $REGISTRY/worker:v0.1 + image: $REGISTRY/worker:latest strategy: rollingUpdate: maxUnavailable: 0 @@ -192,7 +192,7 @@ spec: spec: containers: - name: worker - image: $REGISTRY/worker:v0.1 + image: $REGISTRY/worker:latest strategy: rollingUpdate: maxUnavailable: 0 diff --git a/slides/kube/setup-k8s.md b/slides/kube/setup-k8s.md index 1bccce18..48e4c845 100644 --- a/slides/kube/setup-k8s.md +++ b/slides/kube/setup-k8s.md @@ -4,7 +4,7 @@ -- -- We used `kubeadm` on "fresh" EC2 instances with Ubuntu 16.04 LTS +- We used `kubeadm` on Azure instances with Ubuntu 16.04 LTS 1. Install Docker @@ -36,26 +36,25 @@ -- -- It's still twice as many steps as setting up a Swarm cluster 😕 +- "It's still twice as many steps as setting up a Swarm cluster 😕 " -- Jérôme --- ## Other deployment options -- If you are on Google Cloud: - [GKE](https://cloud.google.com/container-engine/) +- If you are on Azure: + [AKS](https://azure.microsoft.com/services/container-service/) - Empirically the best Kubernetes deployment out there +- If you are on Google Cloud: + [GKE](https://cloud.google.com/kubernetes-engine/) - If you are on AWS: - [kops](https://github.com/kubernetes/kops) - - ... But with AWS re:invent just around the corner, expect some changes + [EKS](https://aws.amazon.com/eks/) - On a local machine: [minikube](https://kubernetes.io/docs/getting-started-guides/minikube/), [kubespawn](https://github.com/kinvolk/kube-spawn), - [Docker4Mac (coming soon)](https://beta.docker.com/) + [Docker4Mac](https://docs.docker.com/docker-for-mac/kubernetes/) - If you want something customizable: [kubicorn](https://github.com/kris-nova/kubicorn) diff --git a/slides/kube/versions-k8s.md b/slides/kube/versions-k8s.md index d2b0a68c..0b946f72 100644 --- a/slides/kube/versions-k8s.md +++ b/slides/kube/versions-k8s.md @@ -1,8 +1,8 @@ ## Brand new versions! -- Kubernetes 1.8 -- Docker Engine 17.11 -- Docker Compose 1.17 +- Kubernetes 1.9.3 +- Docker Engine 18.02.0-ce +- Docker Compose 1.18.0 .exercise[ diff --git a/slides/kube/whatsnext.md b/slides/kube/whatsnext.md index e33a658d..71665d74 100644 --- a/slides/kube/whatsnext.md +++ b/slides/kube/whatsnext.md @@ -131,6 +131,7 @@ And *then* it is time to look at orchestration! - shell scripts invoking `kubectl` - YAML resources descriptions committed to a repo + - [Brigade](https://brigade.sh/) (event-driven scripting; no YAML) - [Helm](https://github.com/kubernetes/helm) (~package manager) - [Spinnaker](https://www.spinnaker.io/) (Netflix' CD platform) @@ -160,7 +161,7 @@ Sorry Star Trek fans, this is not the federation you're looking for! - Raft recommends low latency between nodes -- What if our cluster spreads multiple regions? +- What if our cluster spreads to multiple regions? -- diff --git a/slides/logistics.md b/slides/logistics.md index fea20340..73b163f1 100644 --- a/slides/logistics.md +++ b/slides/logistics.md @@ -2,18 +2,17 @@ - Hello! We are: - - .emoji[👷🏻‍♀️] AJ ([@s0ulshake](https://twitter.com/s0ulshake), Travis CI) + - .emoji[✨] Bridget ([@bridgetkromhout](https://twitter.com/bridgetkromhout)) - - .emoji[🐳] Jérôme ([@jpetazzo](https://twitter.com/jpetazzo), Docker Inc.) + - .emoji[🐳] Jérôme ([@jpetazzo](https://twitter.com/jpetazzo)) -- The workshop will run from 9am to 4pm +- This workshop will run from 10:30am-12:45pm. -- There will be a lunch break at noon +- Lunchtime is after the workshop! - (And coffee breaks!) + (And we will take a 15min break at 11:30am!) - Feel free to interrupt for questions at any time - *Especially when you see full screen container pictures!* -- Live feedback, questions, help on @@CHAT@@