Compare commits

...

41 Commits

Author SHA1 Message Date
Jerome Petazzoni
df58206de5 fix-redirects.sh: adding forced redirect 2020-04-07 16:57:15 -05:00
Jerome Petazzoni
f144e40852 Merge branch 'master' into septembre2018 2018-09-21 09:09:12 +02:00
Jerome Petazzoni
32e1edc2a2 Long slide is long 2018-09-21 09:08:58 +02:00
Jerome Petazzoni
93ad2abe94 5G -> 2G 2018-09-20 02:07:44 -05:00
Jerome Petazzoni
2f832b4978 Merge branch 'master' into septembre2018 2018-09-19 14:02:29 -05:00
Jerome Petazzoni
84225e982f Merge branch 'Julien-Eyraud-fix-kaniko-build' 2018-09-19 14:01:24 -05:00
Jerome Petazzoni
e76a06e942 Merge branch 'fix-kaniko-build' of git://github.com/Julien-Eyraud/container.training into Julien-Eyraud-fix-kaniko-build 2018-09-19 14:01:02 -05:00
Jerome Petazzoni
1995be3bec Update Gitter link for 2nd session 2018-09-19 14:00:08 -05:00
Nicolas Gavalda
0519682c30 Fix small typo 2018-09-18 18:50:41 +02:00
Jérôme Petazzoni
91f7a81964 Merge branch 'master' into fix-kaniko-build 2018-09-18 18:49:13 +02:00
Nicolas Schwartz
a66fcaf04c Update kaniko-build.yaml
Fix option
2018-09-18 18:48:01 +02:00
Julien Eyraud
9a0649e671 Change postgresql mount path 2018-09-18 17:42:10 +02:00
Julien Eyraud
d23ad0cd8f Fix kaniko-build.yaml to use insecure registry 2018-09-18 16:05:05 +02:00
Jerome Petazzoni
529b74c041 css 2018-09-17 03:42:54 -05:00
Jerome Petazzoni
280bd2d52c enix 2018-09-17 01:21:17 -05:00
Jerome Petazzoni
e4be1179f4 gitter 2018-09-17 01:20:10 -05:00
Jerome Petazzoni
dca705a76f wifi 2018-09-17 01:16:15 -05:00
Jerome Petazzoni
05eb798dd9 Merge branch 'master' into septembre2018 2018-09-16 15:35:32 -05:00
Jerome Petazzoni
63755c1cd3 Minor fixes 2018-09-16 15:35:23 -05:00
Jerome Petazzoni
fbfb5e6b73 Enix Customization 2018-09-16 15:15:52 -05:00
Jerome Petazzoni
149cf79615 Add ENIX cluster files 2018-09-16 12:49:33 -05:00
Jerome Petazzoni
1fef53bcc2 Merge branch 'master' into septembre2018 2018-09-16 10:58:21 -05:00
Jerome Petazzoni
a627128570 Set EFK UID to 0 (fixes #325) 2018-09-16 10:58:10 -05:00
Jerome Petazzoni
77fda648ce Add gitter link 2018-09-16 10:49:24 -05:00
Jerome Petazzoni
f4a6935088 Merge branch 'master' into septembre2018 2018-09-16 09:10:32 -05:00
Jerome Petazzoni
91e3078d2e Better error checking + GRO fix 2018-09-16 09:10:14 -05:00
Jerome Petazzoni
31dd943141 Typo 2018-09-16 09:09:08 -05:00
Jerome Petazzoni
3866701475 Fix postgres data volume 2018-09-16 09:08:23 -05:00
Jerome Petazzoni
06c695db6e Merge branch 'master' into septembre2018 2018-09-15 11:11:20 -05:00
Jerome Petazzoni
521f8e9889 More typo fixes courtesy of @abuisine 2018-09-15 11:11:08 -05:00
Jerome Petazzoni
49c3fdd3b2 Minor updates (thanks @abuisine) 2018-09-15 11:03:24 -05:00
Jerome Petazzoni
4bb6a49ee0 Typo fix (thanks @sload) 2018-09-15 10:45:37 -05:00
Jerome Petazzoni
d1f8248cfb Merge branch 'replace-es-with-httpenv' into septembre2018 2018-09-12 15:50:32 -05:00
Jerome Petazzoni
08934cedd9 Merge branch 'master' into septembre2018 2018-09-12 00:16:09 -05:00
Jerome Petazzoni
77f7cc6b4f Fix logistics 2018-09-12 00:12:05 -05:00
Jerome Petazzoni
6e6b624077 avé l'accent 2018-09-12 00:10:48 -05:00
Jerome Petazzoni
d258f696e3 Enix Sep 2018 2018-09-12 00:06:59 -05:00
Jerome Petazzoni
34f4dfbc45 Merge branch 'update-final-words' into septembre2018 2018-09-12 00:01:47 -05:00
Jerome Petazzoni
fb94450738 Merge branch 'enixlogo' into septembre2018 2018-09-12 00:01:44 -05:00
Jerome Petazzoni
51882896d4 Update last chapter (what's next) 2018-09-10 03:29:21 -05:00
Jerome Petazzoni
3eaa844c55 Add ENIX logo
Warning: do not merge this branch to your content, otherwise you
will get the ENIX logo in the top right of all your decks
2018-09-08 07:49:38 -05:00
27 changed files with 360 additions and 74 deletions

View File

@@ -72,6 +72,8 @@ spec:
value: "elastic"
- name: FLUENT_ELASTICSEARCH_PASSWORD
value: "changeme"
- name: FLUENT_UID
value: "0"
resources:
limits:
memory: 200Mi

View File

@@ -14,5 +14,5 @@ frontend the-frontend
backend the-backend
server google.com-80 google.com:80 maxconn 32 check
server bing.com-80 bing.com:80 maxconn 32 check
server ibm.fr-80 ibm.fr:80 maxconn 32 check

View File

@@ -19,7 +19,7 @@ spec:
image: gcr.io/kaniko-project/executor:latest
args:
- "--context=/workspace/dockercoins/rng"
- "--skip-tls-verify"
- "--insecure"
- "--destination=registry:5000/rng-kaniko:latest"
volumeMounts:
- name: workspace

View File

@@ -17,7 +17,7 @@ spec:
- name: postgres
image: postgres:10.5
volumeMounts:
- mountPath: /var/lib/postgresql
- mountPath: /var/lib/postgresql/data
name: postgres
volumeClaimTemplates:
- metadata:

View File

@@ -134,13 +134,13 @@ _cmd_kube() {
sudo tee /etc/apt/sources.list.d/kubernetes.list"
pssh --timeout 200 "
sudo apt-get update -q &&
sudo apt-get install -qy kubelet kubeadm kubectl
sudo apt-get install -qy kubelet kubeadm kubectl &&
kubectl completion bash | sudo tee /etc/bash_completion.d/kubectl"
# Initialize kube master
pssh --timeout 200 "
if grep -q node1 /tmp/node && [ ! -f /etc/kubernetes/admin.conf ]; then
kubeadm token generate > /tmp/token
kubeadm token generate > /tmp/token &&
sudo kubeadm init --token \$(cat /tmp/token)
fi"
@@ -157,29 +157,29 @@ _cmd_kube() {
# Install weave as the pod network
pssh "
if grep -q node1 /tmp/node; then
kubever=\$(kubectl version | base64 | tr -d '\n')
kubever=\$(kubectl version | base64 | tr -d '\n') &&
kubectl apply -f https://cloud.weave.works/k8s/net?k8s-version=\$kubever
fi"
# Join the other nodes to the cluster
pssh --timeout 200 "
if ! grep -q node1 /tmp/node && [ ! -f /etc/kubernetes/kubelet.conf ]; then
TOKEN=\$(ssh -o StrictHostKeyChecking=no node1 cat /tmp/token)
TOKEN=\$(ssh -o StrictHostKeyChecking=no node1 cat /tmp/token) &&
sudo kubeadm join --discovery-token-unsafe-skip-ca-verification --token \$TOKEN node1:6443
fi"
# Install stern
pssh "
if [ ! -x /usr/local/bin/stern ]; then
sudo curl -L -o /usr/local/bin/stern https://github.com/wercker/stern/releases/download/1.8.0/stern_linux_amd64
sudo chmod +x /usr/local/bin/stern
sudo curl -L -o /usr/local/bin/stern https://github.com/wercker/stern/releases/download/1.8.0/stern_linux_amd64 &&
sudo chmod +x /usr/local/bin/stern &&
stern --completion bash | sudo tee /etc/bash_completion.d/stern
fi"
# Install helm
pssh "
if [ ! -x /usr/local/bin/helm ]; then
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | sudo bash
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | sudo bash &&
helm completion bash | sudo tee /etc/bash_completion.d/helm
fi"
@@ -380,6 +380,32 @@ _cmd_test() {
test_tag $TAG
}
_cmd netfix "Disable GRO and run a pinger job on the VMs"
_cmd_netfix () {
TAG=$1
need_tag $TAG
link_tag $TAG
pssh "
sudo ethtool -K ens3 gro off
sudo tee /root/pinger.service <<EOF
[Unit]
Description=pinger
[Install]
WantedBy=multi-user.target
[Service]
WorkingDirectory=/
ExecStart=/bin/ping -w60 1.1
User=nobody
Group=nogroup
Restart=always
EOF
sudo systemctl enable /root/pinger.service
sudo systemctl start pinger"
}
###
greet() {

View File

@@ -0,0 +1,117 @@
{# Feel free to customize or override anything in there! #}
{%- set url = "http://septembre2018.container.training" -%}
{%- set pagesize = 9 -%}
{%- if clustersize == 1 -%}
{%- set workshop_name = "Docker workshop" -%}
{%- set cluster_or_machine = "machine" -%}
{%- set this_or_each = "this" -%}
{%- set machine_is_or_machines_are = "machine is" -%}
{%- set image_src = "https://s3-us-west-2.amazonaws.com/www.breadware.com/integrations/docker.png" -%}
{%- else -%}
{%- set workshop_name = "Kubernetes workshop" -%}
{%- set cluster_or_machine = "cluster" -%}
{%- set this_or_each = "each" -%}
{%- set machine_is_or_machines_are = "machines are" -%}
{%- set image_src_swarm = "https://cdn.wp.nginx.com/wp-content/uploads/2016/07/docker-swarm-hero2.png" -%}
{%- set image_src_kube = "https://avatars1.githubusercontent.com/u/13629408" -%}
{%- set image_src = image_src_kube -%}
{%- endif -%}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><style>
body, table {
margin: 0;
padding: 0;
line-height: 1em;
font-size: 14px;
}
table {
border-spacing: 0;
margin-top: 0.4em;
margin-bottom: 0.4em;
border-left: 0.8em double grey;
padding-left: 0.4em;
}
div {
float: left;
border: 1px dotted black;
padding-top: 1%;
padding-bottom: 1%;
/* columns * (width+left+right) < 100% */
width: 30%;
padding-left: 1.5%;
padding-right: 1.5%;
}
p {
margin: 0.4em 0 0.4em 0;
}
img {
height: 4em;
float: right;
margin-right: -0.3em;
}
img.enix {
height: 4.5em;
margin-top: 0.2em;
}
img.kube {
height: 4.2em;
margin-top: 1.7em;
}
.logpass {
font-family: monospace;
font-weight: bold;
}
.pagebreak {
page-break-after: always;
clear: both;
display: block;
height: 8px;
}
</style></head>
<body>
{% for cluster in clusters %}
{% if loop.index0>0 and loop.index0%pagesize==0 %}
<span class="pagebreak"></span>
{% endif %}
<div>
<p>
Voici les informations permettant de se connecter à votre
cluster pour cette formation. Vous pouvez vous connecter
à ces machines virtuelles avec n'importe quel client SSH.
</p>
<p>
<img class="enix" src="https://enix.io/static/img/logos/logo-domain-cropped.png" />
<table>
<tr><td>identifiant:</td></tr>
<tr><td class="logpass">docker</td></tr>
<tr><td>mot de passe:</td></tr>
<tr><td class="logpass">{{ docker_user_password }}</td></tr>
</table>
</p>
<p>
Vos serveurs sont :
<img class="kube" src="{{ image_src }}" />
<table>
{% for node in cluster %}
<tr><td>node{{ loop.index }}:</td><td>{{ node }}</td></tr>
{% endfor %}
</table>
</p>
<p>Le support de formation est à l'adresse suivante :
<center>{{ url }}</center>
</p>
</div>
{% endfor %}
</body>
</html>

View File

@@ -0,0 +1,25 @@
# Number of VMs per cluster
clustersize: 5
# Jinja2 template to use to generate ready-to-cut cards
cards_template: settings/enix.html
# Use "Letter" in the US, and "A4" everywhere else
paper_size: A4
# 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.22.0
machine_version: 0.14.0
# Password used to connect with the "docker user"
docker_user_password: training

1
slides/_redirects Normal file
View File

@@ -0,0 +1 @@
/ /kube-fullday.yml.html 200!

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

View File

@@ -24,15 +24,9 @@
(it examines headers, certificates ... anything available)
- Many authentication methods can be used simultaneously:
- Many authentication methods are available and can be used simultaneously
- TLS client certificates (that's what we've been doing with `kubectl` so far)
- bearer tokens (a secret token in the HTTP headers of the request)
- [HTTP basic auth](https://en.wikipedia.org/wiki/Basic_access_authentication) (carrying user and password in a HTTP header)
- authentication proxy (sitting in front of the API and setting trusted headers)
(we will see them on the next slide)
- It's the job of the authentication method to produce:
@@ -44,6 +38,26 @@
---
## Authentication methods
- TLS client certificates
(that's what we've been doing with `kubectl` so far)
- Bearer tokens
(a secret token in the HTTP headers of the request)
- [HTTP basic auth](https://en.wikipedia.org/wiki/Basic_access_authentication)
(carrying user and password in a HTTP header)
- Authentication proxy
(sitting in front of the API and setting trusted headers)
---
## Anonymous requests
- If any authentication method *rejects* a request, it's denied
@@ -182,23 +196,23 @@ class: extra-details
kubectl get sa
```
]
]
There should be just one service account in the default namespace: `default`.
There should be just one service account in the default namespace: `default`.
---
---
class: extra-details
class: extra-details
## Finding the secret
## Finding the secret
.exercise[
.exercise[
- List the secrets for the `default` service account:
```bash
kubectl get sa default -o yaml
SECRET=$(kubectl get sa default -o json | jq -r .secrets[0].name)
```
- List the secrets for the `default` service account:
```bash
kubectl get sa default -o yaml
SECRET=$(kubectl get sa default -o json | jq -r .secrets[0].name)
```
]

View File

@@ -327,7 +327,7 @@ We'll cover them just after!*
- We will provide a simple HAproxy configuration, `k8s/haproxy.cfg`
- It listens on port 80, and load balances connections between Google and Bing
- It listens on port 80, and load balances connections between IBM and Google
---

View File

@@ -36,7 +36,7 @@
## Creating a daemon set
- Unfortunately, as of Kubernetes 1.10, the CLI cannot create daemon sets
- Unfortunately, as of Kubernetes 1.11, the CLI cannot create daemon sets
--

View File

@@ -182,7 +182,7 @@ The dashboard will then ask you which authentication you want to use.
kubectl -n kube-system edit service kubernetes-dashboard
```
- Change `ClusterIP` to `NodePort`, save, and exit
- Change type `type:` from `ClusterIP` to `NodePort`, save, and exit
<!--
```wait Please edit the object below```

View File

@@ -111,7 +111,7 @@
- Display that key:
```
kubectl get logs deployment flux | grep identity
kubectl logs deployment flux | grep identity
```
- Then add that key to the repository, giving it **write** access

View File

@@ -344,7 +344,7 @@ This is normal: we haven't provided any ingress rule yet.
- To make our lives easier, we will use [nip.io](http://nip.io)
- Check out `http://cheddar.A.B.C.D.mip.io`
- Check out `http://cheddar.A.B.C.D.nip.io`
(replacing A.B.C.D with the IP address of `node1`)

View File

@@ -43,14 +43,14 @@ Under the hood: `kube-proxy` is using a userland proxy and a bunch of `iptables`
- an external load balancer is allocated for the service
- the load balancer is configured accordingly
<br/>(e.g.: a `NodePort` service is created, and the load balancer sends traffic to that port)
- available only when the underlying infrastructure provides some "load balancer as a service"
<br/>(e.g. AWS, Azure, GCE, OpenStack...)
- `ExternalName`
- the DNS entry managed by CoreDNS will just be a `CNAME` to a provided record
- no port, no IP address, no nothing else is allocated
The `LoadBalancer` type is currently only available on AWS, Azure, and GCE.
---
## Running containers with open ports

View File

@@ -295,7 +295,7 @@ It should show as `portworx-replicated (default)`.
- With a `volumeClaimTemplate` requesting a 1 GB volume
- That volume will be mounted to `/var/lib/postgresql`
- That volume will be mounted to `/var/lib/postgresql/data`
- There is another little detail: we enable the `stork` scheduler
@@ -328,7 +328,7 @@ spec:
- name: postgres
image: postgres:10.5
volumeMounts:
- mountPath: /var/lib/postgresql
- mountPath: /var/lib/postgresql/data
name: postgres
volumeClaimTemplates:
- metadata:
@@ -494,7 +494,7 @@ By "disrupt" we mean: "disconnect it from the network".
- Logout to go back on `node1`
<!-- ```keys ^D``` -->>
<!-- ```keys ^D``` -->
- Watch the events unfolding with `kubectl get events -w` and `kubectl get pods -w`

View File

@@ -38,7 +38,7 @@
- An exporter serves metrics over HTTP, in plain text
- This is was the *node exporter* looks like:
- This is what the *node exporter* looks like:
http://demo.robustperception.io:9100/metrics

View File

@@ -167,7 +167,7 @@ spec:
- It indicates which *provisioner* to use
- And arbitrary paramters for that provisioner
- And arbitrary parameters for that provisioner
(replication levels, type of disk ... anything relevant!)

View File

@@ -22,7 +22,7 @@ class: extra-details
## Kubernetes and Docker compatibility
- Kubernetes 1.10.x only validates Docker Engine versions [1.11.2 to 1.13.1 and 17.03.x](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.10.md#external-dependencies)
- Kubernetes 1.11.x only validates Docker Engine versions [1.11.2 to 1.13.1 and 17.03.x](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.11.md#external-dependencies)
--

View File

@@ -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

View File

@@ -1,14 +1,14 @@
title: |
Deploying and Scaling Microservices
with Kubernetes
D&eacute;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

View File

@@ -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
View 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
}

View File

@@ -6,16 +6,19 @@ class: title, self-paced
---
class: title, pic
![ENIX logo](images/enix-io.svg)
---
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@@**
]

View File

@@ -949,7 +949,7 @@ class: prom
## It's all about the `/metrics`
- This is was the *node exporter* looks like:
- This is what the *node exporter* looks like:
http://demo.robustperception.io:9100/metrics

View File

@@ -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>
<!--