mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-07-22 14:26:27 +00:00
Reorganize managed options; add Scaleway
This commit is contained in:
@@ -11,6 +11,8 @@ else to do it for you."
|
||||
|
||||
(the goal is to show the actual steps to get started)
|
||||
|
||||
- The list is sorted alphabetically
|
||||
|
||||
- All the options mentioned here require an account
|
||||
with a cloud provider
|
||||
|
||||
@@ -18,123 +20,6 @@ with a cloud provider
|
||||
|
||||
---
|
||||
|
||||
## EKS (the old way)
|
||||
|
||||
- [Read the doc](https://docs.aws.amazon.com/eks/latest/userguide/getting-started-console.html)
|
||||
|
||||
- Create service roles, VPCs, and a bunch of other oddities
|
||||
|
||||
- Try to figure out why it doesn't work
|
||||
|
||||
- Start over, following an [official AWS blog post](https://aws.amazon.com/blogs/aws/amazon-eks-now-generally-available/)
|
||||
|
||||
- Try to find the missing Cloud Formation template
|
||||
|
||||
--
|
||||
|
||||
.footnote[(╯°□°)╯︵ ┻━┻]
|
||||
|
||||
---
|
||||
|
||||
## EKS (the new way)
|
||||
|
||||
- Install `eksctl`
|
||||
|
||||
- Set the usual environment variables
|
||||
|
||||
([AWS_DEFAULT_REGION](https://docs.aws.amazon.com/general/latest/gr/rande.html#eks_region), AWS_ACCESS_KEY, AWS_SECRET_ACCESS_KEY)
|
||||
|
||||
- Create the cluster:
|
||||
```bash
|
||||
eksctl create cluster
|
||||
```
|
||||
|
||||
- Wait 15-20 minutes (yes, it's sloooooooooooooooooow)
|
||||
|
||||
- Add cluster add-ons
|
||||
|
||||
(by default, it doesn't come with metrics-server, logging, etc.)
|
||||
|
||||
---
|
||||
|
||||
## EKS (cleanup)
|
||||
|
||||
- Delete the cluster:
|
||||
```bash
|
||||
eksctl delete cluster <clustername>
|
||||
```
|
||||
|
||||
- If you need to find the name of the cluster:
|
||||
```bash
|
||||
eksctl get clusters
|
||||
```
|
||||
|
||||
.footnote[Note: the AWS documentation has been updated and now includes [eksctl instructions](https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html).]
|
||||
|
||||
---
|
||||
|
||||
## GKE (initial setup)
|
||||
|
||||
- Install `gcloud`
|
||||
|
||||
- Login:
|
||||
```bash
|
||||
gcloud auth init
|
||||
```
|
||||
|
||||
- Create a "project":
|
||||
```bash
|
||||
gcloud projects create my-gke-project
|
||||
gcloud config set project my-gke-project
|
||||
```
|
||||
|
||||
- Pick a [region](https://cloud.google.com/compute/docs/regions-zones/)
|
||||
|
||||
(example: `europe-west1`, `us-west1`, ...)
|
||||
|
||||
---
|
||||
|
||||
## GKE (create cluster)
|
||||
|
||||
- Create the cluster:
|
||||
```bash
|
||||
gcloud container clusters create my-gke-cluster --region us-west1 --num-nodes=2
|
||||
```
|
||||
|
||||
(without `--num-nodes` you might exhaust your IP address quota!)
|
||||
|
||||
- The first time you try to create a cluster in a given project, you get an error
|
||||
|
||||
- you need to enable the Kubernetes Engine API
|
||||
- the error message gives you a link
|
||||
- follow the link and enable the API (and billing)
|
||||
<br/>(it's just a couple of clicks and it's instantaneous)
|
||||
|
||||
- Wait a couple of minutes (yes, it's faaaaaaaaast)
|
||||
|
||||
- The cluster comes with many add-ons
|
||||
|
||||
---
|
||||
|
||||
## GKE (cleanup)
|
||||
|
||||
- List clusters (if you forgot its name):
|
||||
```bash
|
||||
gcloud container clusters list
|
||||
```
|
||||
|
||||
- Delete the cluster:
|
||||
```bash
|
||||
gcloud container clusters delete my-gke-cluster --region us-west1
|
||||
```
|
||||
|
||||
- Delete the project (optional):
|
||||
```bash
|
||||
gcloud projects delete my-gke-project
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## AKS (initial setup)
|
||||
|
||||
- Install the Azure CLI
|
||||
@@ -168,8 +53,6 @@ with a cloud provider
|
||||
az aks get-credentials --resource-group my-aks-group --name my-aks-cluster
|
||||
```
|
||||
|
||||
- The cluster has useful components pre-installed, such as the metrics server
|
||||
|
||||
---
|
||||
|
||||
## AKS (cleanup)
|
||||
@@ -190,6 +73,95 @@ with a cloud provider
|
||||
|
||||
---
|
||||
|
||||
## AKS (notes)
|
||||
|
||||
- The cluster has useful components pre-installed, such as the metrics server
|
||||
|
||||
- There is also a product called [AKS Engine](https://github.com/Azure/aks-engine):
|
||||
|
||||
- leverages ARM (Azure Resource Manager) templates to deploy Kubernetes
|
||||
|
||||
- it's "the library used by AKS"
|
||||
|
||||
- fully customizable
|
||||
|
||||
- think of it as "half-managed" Kubernetes option
|
||||
|
||||
---
|
||||
|
||||
## Amazon EKS (the old way)
|
||||
|
||||
- [Read the doc](https://docs.aws.amazon.com/eks/latest/userguide/getting-started-console.html)
|
||||
|
||||
- Create service roles, VPCs, and a bunch of other oddities
|
||||
|
||||
- Try to figure out why it doesn't work
|
||||
|
||||
- Start over, following an [official AWS blog post](https://aws.amazon.com/blogs/aws/amazon-eks-now-generally-available/)
|
||||
|
||||
- Try to find the missing Cloud Formation template
|
||||
|
||||
--
|
||||
|
||||
.footnote[(╯°□°)╯︵ ┻━┻]
|
||||
|
||||
---
|
||||
|
||||
## Amazon EKS (the new way)
|
||||
|
||||
- Install `eksctl`
|
||||
|
||||
- Set the usual environment variables
|
||||
|
||||
([AWS_DEFAULT_REGION](https://docs.aws.amazon.com/general/latest/gr/rande.html#eks_region), AWS_ACCESS_KEY, AWS_SECRET_ACCESS_KEY)
|
||||
|
||||
- Create the cluster:
|
||||
```bash
|
||||
eksctl create cluster
|
||||
```
|
||||
|
||||
- Cluster can take a long time to be ready (15-20 minutes is typical)
|
||||
|
||||
- Add cluster add-ons
|
||||
|
||||
(by default, it doesn't come with metrics-server, logging, etc.)
|
||||
|
||||
---
|
||||
|
||||
## Amazon EKS (cleanup)
|
||||
|
||||
- Delete the cluster:
|
||||
```bash
|
||||
eksctl delete cluster <clustername>
|
||||
```
|
||||
|
||||
- If you need to find the name of the cluster:
|
||||
```bash
|
||||
eksctl get clusters
|
||||
```
|
||||
|
||||
.footnote[Note: the AWS documentation has been updated and now includes [eksctl instructions](https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html).]
|
||||
|
||||
---
|
||||
|
||||
## Amazon EKS (notes)
|
||||
|
||||
- Convenient if you *have to* use AWS
|
||||
|
||||
- Needs extra steps to be truly production-ready
|
||||
|
||||
- [Versions tend to be outdated](https://twitter.com/jpetazzo/status/1252948707680686081)
|
||||
|
||||
- The only officially supported pod network is the [Amazon VPC CNI plugin](https://docs.aws.amazon.com/eks/latest/userguide/pod-networking.html)
|
||||
|
||||
- integrates tightly with security groups and VPC networking
|
||||
|
||||
- not suitable for high density clusters (with many small pods on big nodes)
|
||||
|
||||
- other plugins [should still work](https://docs.aws.amazon.com/eks/latest/userguide/alternate-cni-plugins.html) but will require extra work
|
||||
|
||||
---
|
||||
|
||||
## Digital Ocean (initial setup)
|
||||
|
||||
- Install `doctl`
|
||||
@@ -242,6 +214,162 @@ with a cloud provider
|
||||
|
||||
---
|
||||
|
||||
## GKE (initial setup)
|
||||
|
||||
- Install `gcloud`
|
||||
|
||||
- Login:
|
||||
```bash
|
||||
gcloud auth init
|
||||
```
|
||||
|
||||
- Create a "project":
|
||||
```bash
|
||||
gcloud projects create my-gke-project
|
||||
gcloud config set project my-gke-project
|
||||
```
|
||||
|
||||
- Pick a [region](https://cloud.google.com/compute/docs/regions-zones/)
|
||||
|
||||
(example: `europe-west1`, `us-west1`, ...)
|
||||
|
||||
---
|
||||
|
||||
## GKE (create cluster)
|
||||
|
||||
- Create the cluster:
|
||||
```bash
|
||||
gcloud container clusters create my-gke-cluster --region us-west1 --num-nodes=2
|
||||
```
|
||||
|
||||
(without `--num-nodes` you might exhaust your IP address quota!)
|
||||
|
||||
- The first time you try to create a cluster in a given project, you get an error
|
||||
|
||||
- you need to enable the Kubernetes Engine API
|
||||
- the error message gives you a link
|
||||
- follow the link and enable the API (and billing)
|
||||
<br/>(it's just a couple of clicks and it's instantaneous)
|
||||
|
||||
- Clutser should be ready in a couple of minutes
|
||||
|
||||
---
|
||||
|
||||
## GKE (cleanup)
|
||||
|
||||
- List clusters (if you forgot its name):
|
||||
```bash
|
||||
gcloud container clusters list
|
||||
```
|
||||
|
||||
- Delete the cluster:
|
||||
```bash
|
||||
gcloud container clusters delete my-gke-cluster --region us-west1
|
||||
```
|
||||
|
||||
- Delete the project (optional):
|
||||
```bash
|
||||
gcloud projects delete my-gke-project
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## GKE (notes)
|
||||
|
||||
- Well-rounded product overall
|
||||
|
||||
(it used to be one of the best managed Kubernetes offerings available;
|
||||
now that many other providers entered the game, that title is debatable)
|
||||
|
||||
- The cluster comes with many add-ons
|
||||
|
||||
- Versions lag a bit:
|
||||
|
||||
- latest minor version (e.g. 1.18) tends to be unsupported
|
||||
|
||||
- previous minor version (e.g. 1.17) supported through alpha channel
|
||||
|
||||
- previous versions (e.g. 1.14-1.16) supported
|
||||
|
||||
---
|
||||
|
||||
## Scaleway (initial setup)
|
||||
|
||||
- After creating your account, make sure you set a password or get an API key
|
||||
|
||||
(by default, it uses email "magic links" to sign in)
|
||||
|
||||
- Install `scw`
|
||||
|
||||
(you need [CLI v2](https://github.com/scaleway/scaleway-cli/tree/v2#Installation), which in beta as of May 2020)
|
||||
|
||||
- Generate the CLI configuration with `scw init`
|
||||
|
||||
(it will prompt for your API key, or email + password)
|
||||
|
||||
---
|
||||
|
||||
## Scaleway (create cluster)
|
||||
|
||||
- Create the cluster:
|
||||
```bash
|
||||
k8s cluster create name=my-kapsule-cluster version=1.18.3 cni=cilium \
|
||||
default-pool-config.node-type=DEV1-M default-pool-config.size=3
|
||||
```
|
||||
|
||||
- Get cluster ID:
|
||||
```bash
|
||||
scw k8s cluster list
|
||||
# or
|
||||
CLUSTERID=$(scw k8s cluster list -o json | \
|
||||
jq -r '.[] | select(.name="my-kapsule-cluster") | .id')
|
||||
```
|
||||
|
||||
- Check cluster status with e.g. `scw k8s cluster list` on a wide terminal
|
||||
|
||||
- After less than 5 minutes, status should be `ready`
|
||||
|
||||
- Add connection information to your `.kube/config` file:
|
||||
```bash
|
||||
scw k8s kubeconfig install $CLUSTERID
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Scaleway (cleanup)
|
||||
|
||||
- Get cluster ID (e.g. with `scw k8s cluster list`)
|
||||
|
||||
- Delete the cluster:
|
||||
```bash
|
||||
scw cluster delete cluster-id=$CLUSTERID
|
||||
```
|
||||
|
||||
- Warning: as of May 2020, load balancers have to be deleted separately!
|
||||
|
||||
---
|
||||
|
||||
## Scaleway (notes)
|
||||
|
||||
- The `create` command is a bit more complex than with other providers
|
||||
|
||||
(you must specify the Kubernetes version, CNI plugin, and node type)
|
||||
|
||||
- To see available versions and CNI plugins, run `scw k8s version list`
|
||||
|
||||
- As of May 2020, Kapsule supports:
|
||||
|
||||
- multiple CNI plugins, including: cilium, calico, weave, flannel
|
||||
|
||||
- Kubernetes versions 1.15 to 1.18
|
||||
|
||||
- multiple container runtimes, including: Docker, containerd, CRI-O
|
||||
|
||||
- To see available node types and their price, check their [pricing page](
|
||||
https://www.scaleway.com/en/pricing/)
|
||||
|
||||
---
|
||||
|
||||
## More options
|
||||
|
||||
- Alibaba Cloud
|
||||
@@ -250,8 +378,6 @@ with a cloud provider
|
||||
|
||||
- OVH
|
||||
|
||||
- Scaleway
|
||||
|
||||
- ...
|
||||
|
||||
???
|
||||
|
||||
Reference in New Issue
Block a user