mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-07-28 09:11:18 +00:00
Merge branch 'bridgetkromhout-master-updates'
This commit is contained in:
@@ -4,16 +4,30 @@
|
||||
|
||||
- We want one (and exactly one) instance of `rng` per node
|
||||
|
||||
- If we just scale `deploy/rng` to 4, nothing guarantees that they spread
|
||||
- What if we just scale up `deploy/rng` to the number of nodes?
|
||||
|
||||
- nothing guarantees that the `rng` containers will be distributed evenly
|
||||
|
||||
- if we add nodes later, they will not automatically run a copy of `rng`
|
||||
|
||||
- if we remove (or reboot) a node, one `rng` container will restart elsewhere
|
||||
|
||||
- Instead of a `deployment`, we will use a `daemonset`
|
||||
|
||||
---
|
||||
|
||||
## Daemon sets in practice
|
||||
|
||||
- Daemon sets are great for cluster-wide, per-node processes:
|
||||
|
||||
- `kube-proxy`
|
||||
|
||||
- `weave` (our overlay network)
|
||||
|
||||
- monitoring agents
|
||||
|
||||
- hardware management tools (e.g. SCSI/FC HBA agents)
|
||||
|
||||
- etc.
|
||||
|
||||
- They can also be restricted to run [only on some nodes](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/#running-pods-on-only-some-nodes)
|
||||
@@ -22,7 +36,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 +420,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?
|
||||
|
||||
@@ -89,12 +89,30 @@ The goo.gl URL expands to:
|
||||
|
||||
- Connect to https://oneofournodes:3xxxx/
|
||||
|
||||
(You will have to work around the TLS certificate validation warning)
|
||||
- You will have to work around the TLS certificate validation warning
|
||||
|
||||
<!-- ```open https://node1:3xxxx/``` -->
|
||||
|
||||
]
|
||||
|
||||
The dashboard will then ask you which authentication you want to use.
|
||||
|
||||
.warning[Make sure that you use `https`! Otherwise, you'll get this error:]
|
||||
|
||||
```
|
||||
This page isn’t working
|
||||
<oneofournodes> sent an invalid response.
|
||||
ERR_INVALID_HTTP_RESPONSE
|
||||
```
|
||||
|
||||
.warning[Chrome 63 (and later) as well as recent versions of Edge will refuse to connect.]
|
||||
|
||||
We do not know how to work around that issue for the moment.
|
||||
|
||||
---
|
||||
|
||||
## Dashboard authentication
|
||||
|
||||
- We have three authentication options at this point:
|
||||
|
||||
- token (associated with a role that has appropriate permissions)
|
||||
@@ -109,7 +127,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!
|
||||
|
||||
|
||||
@@ -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,8 @@ 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 +174,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[
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -42,20 +42,21 @@
|
||||
|
||||
## 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:
|
||||
[EKS](https://aws.amazon.com/eks/)
|
||||
or
|
||||
[kops](https://github.com/kubernetes/kops)
|
||||
|
||||
... But with AWS re:invent just around the corner, expect some changes
|
||||
|
||||
- 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)
|
||||
|
||||
@@ -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[
|
||||
|
||||
@@ -160,7 +160,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?
|
||||
|
||||
--
|
||||
|
||||
|
||||
Reference in New Issue
Block a user