mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-02-16 02:29:57 +00:00
Compare commits
25 Commits
exercises
...
septembre2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df58206de5 | ||
|
|
f144e40852 | ||
|
|
93ad2abe94 | ||
|
|
2f832b4978 | ||
|
|
1995be3bec | ||
|
|
529b74c041 | ||
|
|
280bd2d52c | ||
|
|
e4be1179f4 | ||
|
|
dca705a76f | ||
|
|
05eb798dd9 | ||
|
|
fbfb5e6b73 | ||
|
|
1fef53bcc2 | ||
|
|
77fda648ce | ||
|
|
f4a6935088 | ||
|
|
06c695db6e | ||
|
|
d1f8248cfb | ||
|
|
db8e8377ac | ||
|
|
08934cedd9 | ||
|
|
77f7cc6b4f | ||
|
|
6e6b624077 | ||
|
|
d258f696e3 | ||
|
|
34f4dfbc45 | ||
|
|
fb94450738 | ||
|
|
51882896d4 | ||
|
|
3eaa844c55 |
1
slides/_redirects
Normal file
1
slides/_redirects
Normal file
@@ -0,0 +1 @@
|
||||
/ /kube-fullday.yml.html 200!
|
||||
22
slides/images/enix-io.svg
Normal file
22
slides/images/enix-io.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 7.9 KiB |
@@ -59,9 +59,9 @@ Under the hood: `kube-proxy` is using a userland proxy and a bunch of `iptables`
|
||||
|
||||
.exercise[
|
||||
|
||||
- Start a bunch of ElasticSearch containers:
|
||||
- Start a bunch of HTTP servers:
|
||||
```bash
|
||||
kubectl run elastic --image=elasticsearch:2 --replicas=7
|
||||
kubectl run httpenv --image=jpetazzo/httpenv --replicas=10
|
||||
```
|
||||
|
||||
- Watch them being started:
|
||||
@@ -70,15 +70,17 @@ Under the hood: `kube-proxy` is using a userland proxy and a bunch of `iptables`
|
||||
```
|
||||
|
||||
<!--
|
||||
```wait elastic-```
|
||||
```wait httpenv-```
|
||||
```keys ^C```
|
||||
-->
|
||||
|
||||
]
|
||||
|
||||
The `-w` option "watches" events happening on the specified resources.
|
||||
The `jpetazzo/httpenv` image runs an HTTP server on port 8888.
|
||||
<br/>
|
||||
It serves its environment variables in JSON format.
|
||||
|
||||
Note: please DO NOT call the service `search`. It would collide with the TLD.
|
||||
The `-w` option "watches" events happening on the specified resources.
|
||||
|
||||
---
|
||||
|
||||
@@ -88,9 +90,9 @@ Note: please DO NOT call the service `search`. It would collide with the TLD.
|
||||
|
||||
.exercise[
|
||||
|
||||
- Expose the ElasticSearch HTTP API port:
|
||||
- Expose the HTTP port of our server:
|
||||
```bash
|
||||
kubectl expose deploy/elastic --port 9200
|
||||
kubectl expose deploy/httpenv --port 8888
|
||||
```
|
||||
|
||||
- Look up which IP address was allocated:
|
||||
@@ -122,36 +124,34 @@ Note: please DO NOT call the service `search`. It would collide with the TLD.
|
||||
|
||||
## Testing our service
|
||||
|
||||
- We will now send a few HTTP requests to our ElasticSearch pods
|
||||
- We will now send a few HTTP requests to our pods
|
||||
|
||||
.exercise[
|
||||
|
||||
- Let's obtain the IP address that was allocated for our service, *programmatically:*
|
||||
```bash
|
||||
IP=$(kubectl get svc elastic -o go-template --template '{{ .spec.clusterIP }}')
|
||||
IP=$(kubectl get svc httpenv -o go-template --template '{{ .spec.clusterIP }}')
|
||||
```
|
||||
|
||||
<!--
|
||||
```hide kubectl wait deploy elastic --for condition=available```
|
||||
```hide sleep 5``` (give some time for elasticsearch to start... hopefully this is enough!)
|
||||
```hide kubectl wait deploy httpenv --for condition=available```
|
||||
-->
|
||||
|
||||
- Send a few requests:
|
||||
```bash
|
||||
curl http://$IP:9200/
|
||||
curl http://$IP:8888/
|
||||
```
|
||||
|
||||
- Too much output? Filter it with `jq`:
|
||||
```bash
|
||||
curl -s http://$IP:8888/ | jq .HOSTNAME
|
||||
```
|
||||
|
||||
]
|
||||
|
||||
--
|
||||
|
||||
We may see `curl: (7) Failed to connect to _IP_ port 9200: Connection refused`.
|
||||
|
||||
This is normal while the service starts up.
|
||||
|
||||
--
|
||||
|
||||
Once it's running, our requests are load balanced across multiple pods.
|
||||
Our requests are load balanced across multiple pods.
|
||||
|
||||
---
|
||||
|
||||
@@ -205,9 +205,9 @@ class: extra-details
|
||||
|
||||
.exercise[
|
||||
|
||||
- Check the endpoints that Kubernetes has associated with our `elastic` service:
|
||||
- Check the endpoints that Kubernetes has associated with our `httpenv` service:
|
||||
```bash
|
||||
kubectl describe service elastic
|
||||
kubectl describe service httpenv
|
||||
```
|
||||
|
||||
]
|
||||
@@ -229,15 +229,15 @@ class: extra-details
|
||||
|
||||
- If we want to see the full list, we can use one of the following commands:
|
||||
```bash
|
||||
kubectl describe endpoints elastic
|
||||
kubectl get endpoints elastic -o yaml
|
||||
kubectl describe endpoints httpenv
|
||||
kubectl get endpoints httpenv -o yaml
|
||||
```
|
||||
|
||||
- These commands will show us a list of IP addresses
|
||||
|
||||
- These IP addresses should match the addresses of the corresponding pods:
|
||||
```bash
|
||||
kubectl get pods -l run=elastic -o wide
|
||||
kubectl get pods -l run=httpenv -o wide
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -20,6 +20,43 @@ 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...)
|
||||
|
||||
(price: $, difficulty: medium)
|
||||
|
||||
- Hire someone to deploy it for us
|
||||
|
||||
(price: $$, difficulty: easy)
|
||||
|
||||
- Do it ourselves
|
||||
|
||||
(price: $-$$$, dificulty: hard)
|
||||
|
||||
---
|
||||
|
||||
## One big cluster vs. multiple small ones
|
||||
|
||||
- Yes, it is possible to have prod+dev in a single cluster
|
||||
|
||||
(and implement good isolation and security with RBAC, network policies...)
|
||||
|
||||
- But it is not a good idea to do that for our first deployment
|
||||
|
||||
- Start with a production cluster + at least a test cluster
|
||||
|
||||
- Implement and check RBAC and isolation on the test cluster
|
||||
|
||||
(e.g. deploy multiple test versions side-by-side)
|
||||
|
||||
- Make sure that all our devs have usable dev clusters
|
||||
|
||||
(wether it's a local minikube or a full-blown multi-node cluster)
|
||||
|
||||
---
|
||||
|
||||
## Namespaces
|
||||
|
||||
- Namespaces let you run multiple identical stacks side by side
|
||||
@@ -62,15 +99,19 @@ And *then* it is time to look at orchestration!
|
||||
|
||||
## Stateful services (second take)
|
||||
|
||||
- If you really want to host stateful services on Kubernetes, you can look into:
|
||||
- If we want to host stateful services on Kubernetes, we can use:
|
||||
|
||||
- volumes (to carry persistent data)
|
||||
- a storage provider
|
||||
|
||||
- storage plugins
|
||||
- persistent volumes, persistent volume claims
|
||||
|
||||
- persistent volume claims (to ask for specific volume characteristics)
|
||||
- stateful sets
|
||||
|
||||
- stateful sets (pods that are *not* ephemeral)
|
||||
- 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?
|
||||
|
||||
---
|
||||
|
||||
@@ -123,8 +164,6 @@ And *then* it is time to look at orchestration!
|
||||
|
||||
(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
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
title: |
|
||||
Deploying and Scaling Microservices
|
||||
with Kubernetes
|
||||
Déployer ses applications
|
||||
avec Kubernetes
|
||||
|
||||
#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/enix/formation-kubernetes-20180920)"
|
||||
#chat: "FIXME"
|
||||
|
||||
gitrepo: github.com/jpetazzo/container.training
|
||||
|
||||
slides: http://container.training/
|
||||
slides: http://septembre2018.container.training/
|
||||
|
||||
exclude:
|
||||
- self-paced
|
||||
|
||||
@@ -1,26 +1,45 @@
|
||||
## Intros
|
||||
|
||||
- This slide should be customized by the tutorial instructor(s).
|
||||
|
||||
- Hello! We are:
|
||||
|
||||
- .emoji[👩🏻🏫] Ann O'Nymous ([@...](https://twitter.com/...), Megacorp Inc)
|
||||
|
||||
- .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)
|
||||
- .emoji[🚁] Alexandre ([@alexbuisine](https://twitter.com/alexbuisine), Enix SAS)
|
||||
|
||||
] -->
|
||||
- Who are you?
|
||||
|
||||
- The workshop will run from ...
|
||||
- devs?
|
||||
|
||||
- There will be a lunch break at ...
|
||||
- ops?
|
||||
|
||||
- architects?
|
||||
|
||||
- other?
|
||||
|
||||
---
|
||||
|
||||
## Who's Enix?
|
||||
|
||||
- Virtualization
|
||||
|
||||
- Hosting
|
||||
|
||||
- Networking
|
||||
|
||||
- Container Orchestration
|
||||
|
||||
- Consulting
|
||||
|
||||
- Training
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Logistics
|
||||
|
||||
- The workshop will run until 17:30
|
||||
|
||||
- There will be a lunch break at 12:15
|
||||
|
||||
(And coffee breaks!)
|
||||
|
||||
|
||||
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
|
||||
}
|
||||
@@ -6,16 +6,19 @@ class: title, self-paced
|
||||
|
||||
---
|
||||
|
||||
class: title, pic
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
class: title, in-person
|
||||
|
||||
@@TITLE@@<br/></br>
|
||||
|
||||
.footnote[
|
||||
**Be kind to the WiFi!**<br/>
|
||||
<!-- *Use the 5G network.* -->
|
||||
*Don't use your hotspot.*<br/>
|
||||
*Don't stream videos or download big files during the workshop.*<br/>
|
||||
*Thank you!*
|
||||
**WiFi: EnixTraining**<br/>
|
||||
**Password: kubeforever**
|
||||
|
||||
**Slides: @@SLIDES@@**
|
||||
]
|
||||
|
||||
@@ -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