mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-02-15 01:59:57 +00:00
Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f0380af79 | ||
|
|
c825b97058 | ||
|
|
7af11d3120 | ||
|
|
454e8b8f23 | ||
|
|
d1609845a9 | ||
|
|
1020a8ff86 | ||
|
|
ec3476173a | ||
|
|
4c1169c785 | ||
|
|
8b9ee3ecbb | ||
|
|
724753b8b9 | ||
|
|
5c4267afda | ||
|
|
f01bc2a7a9 | ||
|
|
8f89953d25 | ||
|
|
b07720c703 | ||
|
|
e3b71d35a6 | ||
|
|
a32d4132f9 | ||
|
|
3e1fac323c | ||
|
|
5bb8c2a6c2 | ||
|
|
739c20fa4c | ||
|
|
3200de3bea | ||
|
|
4e0ec722bc | ||
|
|
10e6891dca | ||
|
|
8dd3bccf7a | ||
|
|
970cbdd8fd | ||
|
|
67ed422aaf | ||
|
|
720f2fc86e | ||
|
|
a9e99e3bae | ||
|
|
ee9b775f01 | ||
|
|
a94271c14c | ||
|
|
c04dafd698 | ||
|
|
96be5c16bf | ||
|
|
e4e0386efd | ||
|
|
9b54ea95ac | ||
|
|
3eaa844c55 |
25
prepare-vms/settings/k8s2d.yaml
Normal file
25
prepare-vms/settings/k8s2d.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
# Number of VMs per cluster
|
||||
clustersize: 5
|
||||
|
||||
# Jinja2 template to use to generate ready-to-cut cards
|
||||
cards_template: cards.html
|
||||
|
||||
# Use "Letter" in the US, and "A4" everywhere else
|
||||
paper_size: Letter
|
||||
|
||||
# Feel free to reduce this if your printer can handle it
|
||||
paper_margin: 0.2in
|
||||
|
||||
# Note: paper_size and paper_margin only apply to PDF generated with pdfkit.
|
||||
# If you print (or generate a PDF) using ips.html, they will be ignored.
|
||||
# (The equivalent parameters must be set from the browser's print dialog.)
|
||||
|
||||
# This can be "test" or "stable"
|
||||
engine_version: stable
|
||||
|
||||
# These correspond to the version numbers visible on their respective GitHub release pages
|
||||
compose_version: 1.21.2
|
||||
machine_version: 0.14.0
|
||||
|
||||
# Password used to connect with the "docker user"
|
||||
docker_user_password: training
|
||||
@@ -1,5 +1,5 @@
|
||||
{# Feel free to customize or override anything in there! #}
|
||||
{%- set url = "http://container.training/" -%}
|
||||
{%- set url = "http://k8s2d.container.training/" -%}
|
||||
{%- set pagesize = 12 -%}
|
||||
{%- if clustersize == 1 -%}
|
||||
{%- set workshop_name = "Docker workshop" -%}
|
||||
|
||||
2
slides/_redirects
Normal file
2
slides/_redirects
Normal file
@@ -0,0 +1,2 @@
|
||||
/ /kube-fullday.yml.html 200!
|
||||
|
||||
@@ -227,3 +227,21 @@ Note: it might take a minute or two for the app to be up and running.
|
||||
- On our clusters, they are installed as `kns` and `kctx`
|
||||
|
||||
(for brevity and to avoid completion clashes between `kubectx` and `kubectl`)
|
||||
|
||||
---
|
||||
|
||||
## `kube-ps1`
|
||||
|
||||
- It's easy to lose track of our current cluster / context / namespace
|
||||
|
||||
- `kube-ps1` makes it easy to track these, by showing them in our shell prompt
|
||||
|
||||
- It's a simple shell script availble from https://github.com/jonmosco/kube-ps1
|
||||
|
||||
- On our clusters, `kube-ps1` is installed and included in `PS1`:
|
||||
```
|
||||
[123.45.67.89] `(kubernetes-admin@kubernetes:default)` docker@node1 ~
|
||||
```
|
||||
(The highlighted part is `context:namespace`, managed by `kube-ps1`)
|
||||
|
||||
- Highly recommended if you work across multiple contexts or namespaces!
|
||||
|
||||
@@ -122,13 +122,13 @@
|
||||
|
||||
- Create a 10 GB file on each node:
|
||||
```bash
|
||||
for N in $(seq 1 5); do ssh node$N sudo truncate --size 10G /portworx.blk; done
|
||||
for N in $(seq 1 4); do ssh node$N sudo truncate --size 10G /portworx.blk; done
|
||||
```
|
||||
(If SSH asks to confirm host keys, enter `yes` each time.)
|
||||
|
||||
- Associate the file to a loop device on each node:
|
||||
```bash
|
||||
for N in $(seq 1 5); do ssh node$N sudo losetup /dev/loop4 /portworx.blk; done
|
||||
for N in $(seq 1 4); do ssh node$N sudo losetup /dev/loop4 /portworx.blk; done
|
||||
```
|
||||
|
||||
]
|
||||
|
||||
@@ -20,7 +20,6 @@ And *then* it is time to look at orchestration!
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Options for our first production cluster
|
||||
|
||||
- Get a managed cluster from a major cloud provider (AKS, EKS, GKE...)
|
||||
@@ -57,26 +56,6 @@ And *then* it is time to look at orchestration!
|
||||
|
||||
---
|
||||
|
||||
## Namespaces
|
||||
|
||||
- Namespaces let you run multiple identical stacks side by side
|
||||
|
||||
- Two namespaces (e.g. `blue` and `green`) can each have their own `redis` service
|
||||
|
||||
- Each of the two `redis` services has its own `ClusterIP`
|
||||
|
||||
- CoreDNS creates two entries, mapping to these two `ClusterIP` addresses:
|
||||
|
||||
`redis.blue.svc.cluster.local` and `redis.green.svc.cluster.local`
|
||||
|
||||
- Pods in the `blue` namespace get a *search suffix* of `blue.svc.cluster.local`
|
||||
|
||||
- As a result, resolving `redis` from a pod in the `blue` namespace yields the "local" `redis`
|
||||
|
||||
.warning[This does not provide *isolation*! That would be the job of network policies.]
|
||||
|
||||
---
|
||||
|
||||
## Stateful services (databases etc.)
|
||||
|
||||
- As a first step, it is wiser to keep stateful services *outside* of the cluster
|
||||
@@ -97,91 +76,6 @@ And *then* it is time to look at orchestration!
|
||||
|
||||
---
|
||||
|
||||
## Stateful services (second take)
|
||||
|
||||
- If we want to host stateful services on Kubernetes, we can use:
|
||||
|
||||
- a storage provider
|
||||
|
||||
- persistent volumes, persistent volume claims
|
||||
|
||||
- stateful sets
|
||||
|
||||
- Good questions to ask:
|
||||
|
||||
- what's the *operational cost* of running this service ourselves?
|
||||
|
||||
- what do we gain by deploying this stateful service on Kubernetes?
|
||||
|
||||
---
|
||||
|
||||
## HTTP traffic handling
|
||||
|
||||
- *Services* are layer 4 constructs
|
||||
|
||||
- HTTP is a layer 7 protocol
|
||||
|
||||
- It is handled by *ingresses* (a different resource kind)
|
||||
|
||||
- *Ingresses* allow:
|
||||
|
||||
- virtual host routing
|
||||
- session stickiness
|
||||
- URI mapping
|
||||
- and much more!
|
||||
|
||||
- Check out e.g. [Træfik](https://docs.traefik.io/user-guide/kubernetes/)
|
||||
|
||||
---
|
||||
|
||||
## Logging
|
||||
|
||||
- Logging is delegated to the container engine
|
||||
|
||||
- Logs are exposed through the API
|
||||
|
||||
- Logs are also accessible through local files (`/var/log/containers`)
|
||||
|
||||
- Log shipping to a central platform is usually done through these files
|
||||
|
||||
(e.g. with an agent bind-mounting the log directory)
|
||||
|
||||
---
|
||||
|
||||
## Metrics
|
||||
|
||||
- The kubelet embeds [cAdvisor](https://github.com/google/cadvisor), which exposes container metrics
|
||||
|
||||
(cAdvisor might be separated in the future for more flexibility)
|
||||
|
||||
- It is a good idea to start with [Prometheus](https://prometheus.io/)
|
||||
|
||||
(even if you end up using something else)
|
||||
|
||||
- Starting from Kubernetes 1.8, we can use the [Metrics API](https://kubernetes.io/docs/tasks/debug-application-cluster/core-metrics-pipeline/)
|
||||
|
||||
- [Heapster](https://github.com/kubernetes/heapster) was a popular add-on
|
||||
|
||||
(but is being [deprecated](https://github.com/kubernetes/heapster/blob/master/docs/deprecation.md) starting with Kubernetes 1.11)
|
||||
|
||||
---
|
||||
|
||||
## Managing the configuration of our applications
|
||||
|
||||
- Two constructs are particularly useful: secrets and config maps
|
||||
|
||||
- They allow to expose arbitrary information to our containers
|
||||
|
||||
- **Avoid** storing configuration in container images
|
||||
|
||||
(There are some exceptions to that rule, but it's generally a Bad Idea)
|
||||
|
||||
- **Never** store sensitive information in container images
|
||||
|
||||
(It's the container equivalent of the password on a post-it note on your screen)
|
||||
|
||||
---
|
||||
|
||||
## Managing stack deployments
|
||||
|
||||
- The best deployment tool will vary, depending on:
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
title: |
|
||||
Deploying and Scaling Microservices
|
||||
with Kubernetes
|
||||
Kubernetes bootcamp:
|
||||
Deploying and scaling microservices
|
||||
|
||||
#chat: "[Slack](https://dockercommunity.slack.com/messages/C7GKACWDV)"
|
||||
#chat: "[Gitter](https://gitter.im/jpetazzo/workshop-yyyymmdd-city)"
|
||||
chat: "In person!"
|
||||
chat: "[Gitter](https://gitter.im/jpetazzo/training-20180930-nyc)"
|
||||
|
||||
gitrepo: github.com/jpetazzo/container.training
|
||||
|
||||
slides: http://container.training/
|
||||
slides: http://k8s2d.container.training/
|
||||
|
||||
exclude:
|
||||
- self-paced
|
||||
@@ -48,7 +46,6 @@ chapters:
|
||||
- k8s/netpol.md
|
||||
- k8s/authn-authz.md
|
||||
- - k8s/ingress.md
|
||||
- k8s/gitworkflows.md
|
||||
- k8s/prometheus.md
|
||||
- - k8s/volumes.md
|
||||
- k8s/build-with-docker.md
|
||||
|
||||
@@ -1,28 +1,12 @@
|
||||
## Intros
|
||||
|
||||
- This slide should be customized by the tutorial instructor(s).
|
||||
- Hello! I'm Jérôme ([@jpetazzo](https://twitter.com/jpetazzo), Enix SAS)
|
||||
|
||||
- Hello! We are:
|
||||
- The workshop will run from 9am to 5pm
|
||||
|
||||
- .emoji[👩🏻🏫] Ann O'Nymous ([@...](https://twitter.com/...), Megacorp Inc)
|
||||
- Lunch will be served at 12:30pm (in Rhinelander)
|
||||
|
||||
- .emoji[👨🏾🎓] Stu Dent ([@...](https://twitter.com/...), University of Wakanda)
|
||||
|
||||
<!-- .dummy[
|
||||
|
||||
- .emoji[👷🏻♀️] AJ ([@s0ulshake](https://twitter.com/s0ulshake), Travis CI)
|
||||
|
||||
- .emoji[🐳] Jérôme ([@jpetazzo](https://twitter.com/jpetazzo), Enix SAS)
|
||||
|
||||
- .emoji[⛵] Jérémy ([@jeremygarrouste](twitter.com/jeremygarrouste), Inpiwee)
|
||||
|
||||
] -->
|
||||
|
||||
- The workshop will run from ...
|
||||
|
||||
- There will be a lunch break at ...
|
||||
|
||||
(And coffee breaks!)
|
||||
- Morning and afternoon breaks are scheduled at 10:30am and 3pm (in Sutton Foyer)
|
||||
|
||||
- Feel free to interrupt for questions at any time
|
||||
|
||||
|
||||
17
slides/override.css
Normal file
17
slides/override.css
Normal file
@@ -0,0 +1,17 @@
|
||||
.remark-slide-content:not(.pic) {
|
||||
background-repeat: no-repeat;
|
||||
background-position: 99% 1%;
|
||||
background-size: 8%;
|
||||
background-image: url(https://enix.io/static/img/logos/logo-domain-cropped.png);
|
||||
}
|
||||
|
||||
div.extra-details:not(.pic) {
|
||||
background-image: url("images/extra-details.png"), url(https://enix.io/static/img/logos/logo-domain-cropped.png);
|
||||
background-position: 0.5% 1%, 99% 1%;
|
||||
background-size: 4%, 8%;
|
||||
}
|
||||
|
||||
.remark-slide-content:not(.pic) div.remark-slide-number {
|
||||
top: 16px;
|
||||
right: 112px
|
||||
}
|
||||
@@ -4,8 +4,20 @@ Thank you!
|
||||
|
||||
---
|
||||
|
||||
class: title, in-person
|
||||
# Final words
|
||||
|
||||
That's all, folks! <br/> Questions?
|
||||
- For $$$ reasons, our clusters will be shut down *now*
|
||||
|
||||

|
||||
- if you want another cluster that you can keep longer, come talk to me
|
||||
|
||||
- If you liked this tutorial:
|
||||
|
||||
- [rate it on the O'Reilly website](https://conferences.oreilly.com/velocity/vl-ny/public/schedule/evaluate/69875)
|
||||
|
||||
- tweet about it, tagging @jpetazzo and #VelocityConf
|
||||
|
||||
- hire me to deliver it for your team: jerome.petazzoni@gmail.com
|
||||
|
||||
- If you didn't like this tutorial:
|
||||
|
||||
- please tell me why, so I can do better next time!
|
||||
|
||||
@@ -11,6 +11,9 @@ class: title, in-person
|
||||
@@TITLE@@<br/></br>
|
||||
|
||||
.footnote[
|
||||
WiFi: OReilly18<br/>
|
||||
Password: velocity<br/>
|
||||
|
||||
**Be kind to the WiFi!**<br/>
|
||||
<!-- *Use the 5G network.* -->
|
||||
*Don't use your hotspot.*<br/>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<title>@@TITLE@@</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<link rel="stylesheet" href="workshop.css">
|
||||
<link rel="stylesheet" href="override.css">
|
||||
</head>
|
||||
<body>
|
||||
<!--
|
||||
|
||||
Reference in New Issue
Block a user