Skip to content

Commit 4b9ada2

Browse files
committed
docs(k8s): migration tutorial
1 parent c474379 commit 4b9ada2

File tree

1 file changed

+133
-89
lines changed
  • tutorials/migrating-from-another-managed-kubernetes-service-to-scaleway-kapsule

1 file changed

+133
-89
lines changed

tutorials/migrating-from-another-managed-kubernetes/index.mdx renamed to tutorials/migrating-from-another-managed-kubernetes-service-to-scaleway-kapsule/index.mdx

Lines changed: 133 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ meta:
55
content:
66
h1: Migrating from another managed Kubernetes service to Scaleway Kapsule
77
paragraph: Step-by-step guide to migrate your Kubernetes clusters from services like GKE, EKS, or AKS to Scaleway Kapsule with minimal downtime.
8-
tags: pgloader postgresql mysql migration
8+
tags: kubernetes kapsule k8s migration
99
categories:
1010
- kubernetes
1111
dates:
1212
validation: 2024-11-13
1313
posted: 2024-11-13
1414
---
1515

16-
This guide provides a step-by-step process to help you migrate your existing Kubernetes clusters from other managed services like GKE (Google Kubernetes Engine), EKS (Amazon Elastic Kubernetes Service), or AKS (Azure Kubernetes Service) to **Scaleway Kapsule**. The migration aims to minimize downtime and ensure a smooth transition of your workloads.
16+
This guide provides a step-by-step process to help you migrate your existing Kubernetes clusters from other managed services like GKE (Google Kubernetes Engine), EKS (Amazon Elastic Kubernetes Service), or AKS (Azure Kubernetes Service) to **[Scaleway Kapsule](/containers/kubernetes/quickstart/)**. The migration aims to minimize downtime and ensure a smooth transition of your workloads.
1717

1818

1919
<Macro id="requirements" />
@@ -23,42 +23,42 @@ This guide provides a step-by-step process to help you migrate your existing Kub
2323
- Access to an existing Kubernetes cluster
2424
- Basic knowledge and familiarity with Kubernetes concepts and tools.
2525
- Installed the following tools: `kubectl`, `helm` (if used), and `scaleway CLI` (optional but recommended).
26-
-Access to your container images stored in a registry (Scaleway Container Registry, Docker Hub, ECR, GCR, etc.).
26+
- Access to your container images stored in a registry (Scaleway Container Registry, Docker Hub, ECR, GCR, etc.).
2727

2828
## Overview of migration steps
2929

30-
1. **Assess and Document Current Cluster Resources**
31-
2. **Set Up Scaleway Environment**
32-
3. **Migrate Container Images to Scaleway Container Registry**
33-
4. **Create a Kapsule Kubernetes Cluster**
34-
5. **Configure kubectl for Kapsule**
35-
6. **Adapt Kubernetes Manifests and Configurations**
36-
7. **Migrate Persistent Data and Storage**
37-
8. **Deploy Applications to Kapsule**
38-
9. **Update Networking and DNS Configurations**
39-
10. **Test and Validate Deployments**
40-
11. **Switch Over Production Traffic**
41-
12. **Monitor and Optimize the New Cluster**
42-
13. **Decommission the Old Cluster**
30+
- [Step 1: Assess and document current cluster resources](#step-1-assess-and-document-current-cluster-resources)
31+
- [Step 2: Set up Scaleway environment](#step-2-set-up-scaleway-environment)
32+
- [Step 3: Migrate container images to Scaleway Container Registry](#step-3-migrate-container-images-to-scaleway-container-registry)
33+
- [Step 4: Create a Kapsule Kubernetes cluster](#step-4-create-a-kapsule-kubernetes-cluster)
34+
- [Step 5: Configure kubectl for Kapsule](#step-5-configure-kubectl-for-kapsule)
35+
- [Step 6: Adapt Kubernetes manifests and configurations](#step-6-adapt-kubernetes-manifests-and-configurations)
36+
- [Step 7: Migrate persistent data and storage](#step-7-migrate-persistent-data-and-storage)
37+
- [Step 8: Deploy applications to Kapsule](#step-8-deploy-applications-to-kapsule)
38+
- [Step 9: Update networking and DNS configurations](#step-9-update-networking-and-dns-configurations)
39+
- [Step 10: Test and validate deployments](#step-10-test-and-validate-deployments)
40+
- [Step 11: Switch over production traffic](#step-11-switch-over-production-traffic)
41+
- [Step 12: Monitor and optimize the new cluster](#step-12-monitor-and-optimize-the-new-cluster)
42+
- [Step 13: Decommission the old cluster](#step-13-decommission-the-old-cluster)
4343

4444
## Step 1: Assess and document current cluster resources
4545

46-
Before starting the migration, thoroughly document your existing cluster's configuration.
46+
Begin by documenting your existing cluster configuration. This includes namespaces, deployments, services, storage, and any custom resources or policies in use.
4747

4848
### 1.1 Inventory of resources
4949

5050
- **Namespaces**: List all namespaces in use.
51-
- **Deployments and StatefulSets**: Identify all applications running.
52-
- **Services**: Document LoadBalancers, NodePorts, ClusterIPs.
51+
- **Deployments and StatefulSets**: Identify all applications and workloads running.
52+
- **Services**: Document `LoadBalancers`, `NodePorts`, `ClusterIPs`.
5353
- **ConfigMaps and Secrets**: Export configurations and sensitive data.
5454
- **Ingress Controllers**: Note any Ingress resources and controllers used.
5555
- **Persistent Volumes and Claims**: List all storage resources.
5656
- **Custom Resource Definitions (CRDs)**: Document any CRDs and associated operators.
5757
- **Network Policies**: Record any network policies in place.
5858

59-
### 1.2 Export ùanifests
59+
### 1.2 Export manifests
6060

61-
Use kubectl to export the manifests of your resources:
61+
Use `kubectl` to export the manifests of your resources:
6262

6363
```
6464
kubectl get all --all-namespaces -o yaml > cluster-resources.yaml
@@ -88,6 +88,7 @@ If you do not already have one, [sign up for a Scaleway account](https://console
8888

8989
[Installing the Scaleway CLI](https://github.com/scaleway/scaleway-cli) can simplify some tasks.
9090

91+
Run the following command in a terminal to install the Scaleway CLI:
9192
```sh
9293
curl -s <https://raw.githubusercontent.com/scaleway/scaleway-cli/master/scripts/get.sh> | sh
9394
scw init
@@ -109,8 +110,14 @@ Your new cluster will need access to your container images.
109110
4. Provide a **Name** (e.g., `my-apps`) and select a **Region**.
110111
5. Click **Create a Namespace**.
111112

113+
<Message type="note">
114+
Refer to the dedicated documentation [How to create a namespace](/containers/container-registry/how-to/create-namespace/) for detailed information how to create a Scaleway Container Registry namespace.
115+
</Message>
116+
112117
### 3.2 Authenticate Docker with Scaleway Registry
113118

119+
Use the following command to login to your Scaleway Registry using Docker:
120+
114121
```sh
115122
docker login rg.<region>.scw.cloud
116123
```
@@ -143,26 +150,67 @@ docker push rg.<region>.scw.cloud/<namespace>/<image-name>:<tag>
143150

144151
## Step 4: Create a Kapsule Kubernetes cluster
145152

153+
To create and configure a new Kapsule Kubernetes cluster, follow the steps below:
154+
146155
### 4.1 Using the Scaleway console
147156

148-
1. Navigate to **[Kubernetes](https://console.scaleway.com/kubernetes/clusters)** in the Scaleway console.
149-
2. Click **Create a cluster**.
150-
3. Configure your cluster:
151-
152-
- **Name**: e.g., `production-cluster`.
153-
- **Region**: Choose the same region as your container registry if possible.
154-
- **Version**: Select the latest stable Kubernetes version.
155-
- **Node Pools**:
156-
- Add node pools matching your workload requirements.
157-
- Select appropriate **Instance Types** based on CPU, memory, and storage needs.
158-
- **Autoscaling**: Enable if required.
159-
- **Networking**:
160-
- **VPC**: Enable VPC for private networking.
161-
- **CNI Plugin**: Use the default unless you have specific needs.
162-
4. **Advanced Options**:
163-
- **API Server Endpoint Access**: Configure public/private access as needed.
164-
- **Tags and Labels**: Add any metadata for organization.
165-
5. Click **Create Cluster**.
157+
#### Cluster configuration
158+
159+
1. Navigate to **Kubernetes** under the **Containers** section of the [Scaleway console](https://console.scaleway.com/) side menu. The Kubernetes dashboard displays.
160+
2. Click **Create cluster** to launch the cluster creation wizard.
161+
3. On the cluster configuration page, provide the following details:
162+
* Check the Organization and Project for the new cluster.
163+
<Message type="important">
164+
You cannot move a cluster from one Organization or Project to another once created.
165+
</Message>
166+
* Select **Kubernetes Kapsule** as the cluster type, which uses exclusively Scaleway Instances.
167+
* Choose the geographical **region** for the cluster.
168+
* Select the control plane offer for your cluster. Options include shared or dedicated control planes.
169+
<Message type="tip">
170+
Need help deciding on a control plane offer? Learn more about our [Kubernetes control plane offers](/containers/kubernetes/reference-content/kubernetes-control-plane-offers/).
171+
</Message>
172+
* Specify the **Kubernetes version** for your cluster.
173+
4. Enter the **cluster's details**. Provide a name for the cluster. Optionally, you can add a description and tags for better organization.
174+
5. Configure the **Private Network** for the cluster to ensure secure and isolated network communication. Each cluster is auto-configured with a /22 IP subnet. Click **Select Private Network** to:
175+
* Attach an existing Private Network (VPC) within the same Availability Zone from the drop-down menu.
176+
* Attach a new Private Network to the cluster.
177+
<Message type="important">
178+
The Private Network cannot be detached, and the cluster cannot be moved to another Private Network post-creation.
179+
</Message>
180+
6. Click **Configure pools** to proceed.
181+
182+
#### Pool configuration
183+
184+
1. Configure the following for each pool:
185+
* Choose an **Availability Zone** for the pool's nodes.
186+
* Select the **node type** for the pool.
187+
<Message type="tip">
188+
Need advice on choosing a node type? [Learn more about Kubernetes nodes.](/containers/kubernetes/concepts/#node)
189+
</Message>
190+
* Configure the **system volume**. This volume contains the operating system of the nodes in your pool.
191+
* Configure **pool options**, including node count and whether to enable autoscaling. Options also include enabling autoheal and linking to a placement group, or you can retain default settings.
192+
<Message type="tip">
193+
- Unsure about the autoheal feature? [Learn more about autoheal.](/containers/kubernetes/concepts/#autoheal)
194+
- Need more information about placement groups? [Learn more about placement groups.](/compute/instances/concepts/#placement-groups)
195+
</Message>
196+
* Enable full isolation, if required.
197+
<Message type="tip">
198+
Need more information on full isolation? [Learn more about full isolation.](/containers/kubernetes/reference-content/secure-cluster-with-private-network/#what-is-the-difference-between-controlled-isolation-and-full-isolation)
199+
</Message>
200+
2. Click **Add pool** to integrate the pool into the cluster.
201+
3. To add more pools, click **Expand** and repeat the steps above.
202+
<Message type="tip">
203+
You can add or remove pools as needed before finalizing your cluster configuration. To remove a pool, click **Remove** within the respective pool.
204+
</Message>
205+
4. Once all pools are configured, click **Review** to finalize your cluster setup.
206+
207+
#### Review configuration
208+
209+
1. Review the configuration details of your Kubernetes cluster and its pools.
210+
<Message type="tip">
211+
To modify any element, click the <Icon name="edit" /> **Edit** icon next to the respective configuration component.
212+
</Message>
213+
2. Click **Create cluster** to deploy your cluster. Once deployment is complete, the cluster appears in the clusters list.
166214

167215
### 4.2 Wait for cluster provisioning
168216

@@ -171,11 +219,11 @@ docker push rg.<region>.scw.cloud/<namespace>/<image-name>:<tag>
171219

172220
## Step 5: Configure kubectl for Kapsule
173221

174-
### 5.1 Download kubeconfig
222+
### 5.1 Download the kubeconfig file
175223

176224
1. In the Scaleway console, go to your cluster's **Overview** page.
177225
2. Click **Download kubeconfig**.
178-
3. Save the file to ~/.kube/kapsule-config.
226+
3. Save the file to `~/.kube/kapsule-config`.
179227

180228
### 5.2 Update kubeconfig
181229

@@ -189,27 +237,22 @@ mv ~/.kube/config_combined ~/.kube/config
189237
unset KUBECONFIG
190238

191239
```
192-
This merges the Kapsule kubeconfig with your existing config.
240+
This merges the Kapsule `kubeconfig` with your existing config.
193241

194242
### 5.3 Set the current context
195243

196-
- List Available Contexts to identify the name of the context for your Kapsule cluster
197-
198-
```
199-
kubectl config get-contexts
200-
```
201-
202-
- Set the Kapsule Cluster as the Current Context by replacing <kapsule-context-name> with the context name for your Kapsule cluster.
203-
204-
```
205-
kubectl config use-context <kapsule-context-name>
206-
```
207-
208-
- Confirm that your context has been updated
209-
210-
```
211-
kubectl config current-context
212-
```
244+
1. List available contexts to identify the name of the context for your Kapsule cluster
245+
```
246+
kubectl config get-contexts
247+
```
248+
2. Set the Kapsule cluster as the current context by replacing `<kapsule-context-name>` with the context name for your Kapsule cluster.
249+
```
250+
kubectl config use-context <kapsule-context-name>
251+
```
252+
3. Confirm that your context has been updated
253+
```
254+
kubectl config current-context
255+
```
213256

214257
### 5.4 Verify connection
215258

@@ -219,31 +262,29 @@ kubectl get nodes
219262

220263
## Step 6: Adapt Kubernetes manifests and configurations
221264

222-
Your existing manifests may contain cloud-provider-specific settings that need adjustment.
265+
Your existing manifests may contain cloud-provider-specific settings that need adjustment to align with Scaleway Kapsule's configuration.
223266

224267
### 6.1 Review and modify manifests
225268

226269
#### Storage classes
227270

228271
- Update storage classes to match Scaleway's offerings.
229272
- List available storage classes:
230-
231-
```sh
232-
kubectl get storageclass
233-
```
234-
273+
```sh
274+
kubectl get storageclass
275+
```
235276
- Common storage classes in Scaleway:
236277
- `scw-bssd` (Block Storage)
237278
- `scw-sbs` (Faster Block Storage)
238279

239280
#### Load Balancers
240281

241-
- Modify Service definitions of type LoadBalancer to use Scaleway's load balancers.
282+
- Modify Service definitions of type `LoadBalancer` to use [Scaleway's Load Balancers](/network/load-balancer/quickstart/).
242283
- Ensure annotations specific to other cloud providers are removed or replaced.
243284

244285
#### Ingress controllers
245286

246-
- Deploy an Ingress controller compatible with Kapsule (e.g., NGINX Ingress Controller).
287+
- [Deploy an Ingress controller](/containers/kubernetes/how-to/deploy-ingress-controller/) compatible with Kapsule (e.g., NGINX Ingress Controller).
247288

248289
#### Networking policies
249290

@@ -288,17 +329,18 @@ kubectl get storageclass
288329
kubectl apply -f adjusted-manifests
289330
```
290331

291-
- Ensure you are using the correct context for Kapsule.
332+
<Message type="tip">
333+
Ensure you are using the correct context for Kapsule.
334+
</Message>
292335

293336
### 8.2 Deploy Ingress Controller
294337

295338
- Deploy NGINX Ingress Controller:
339+
```
340+
kubectl apply -f <https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.2.1/deploy/static/provider/cloud/deploy.yaml>
341+
```
296342

297-
```
298-
kubectl apply -f <https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.2.1/deploy/static/provider/cloud/deploy.yaml>
299-
```
300-
301-
### 8.3 Verify Deployments
343+
### 8.3 Verify deployments
302344

303345
```
304346
kubectl get pods --all-namespaces
@@ -307,8 +349,9 @@ kubectl get services --all-namespaces
307349
308350
kubectl get ingress --all-namespaces
309351
```
310-
311-
- Ensure all pods are running and services are correctly configured.
352+
<Message type="note">
353+
Ensure all pods are running and services are correctly configured.
354+
</Message>
312355

313356
## Step 9: Update networking and DNS configurations
314357

@@ -325,15 +368,16 @@ kubectl get ingress --all-namespaces
325368

326369
- Use Cert-Manager to manage SSL certificates in Kapsule.
327370
- Install Cert-Manager:
328-
329-
```
330-
kubectl apply -f <https://github.com/jetstack/cert-manager/releases/download/v1.8.0/cert-manager.yaml>
331-
```
371+
```
372+
kubectl apply -f <https://github.com/jetstack/cert-manager/releases/download/v1.8.0/cert-manager.yaml>
373+
```
332374

333375
Configure issuers and certificates as per your requirements.
334376

335377
## Step 10: Test and validate deployments
336378

379+
Conduct functional, performance, and end-to-end testing to verify the applications work as expected in the new environment.
380+
337381
### 10.1 Functional testing
338382

339383
- Access your applications via their URLs.
@@ -376,7 +420,7 @@ Configure issuers and certificates as per your requirements.
376420

377421
### 12.1 Resource usage
378422

379-
- Monitor CPU, memory, and storage usage in [Scaleway Cockpit](add link).
423+
- Monitor CPU, memory, and storage usage in [Scaleway Cockpit](/observability/cockpit/quickstart/).
380424
- Adjust node pool sizes or autoscaling settings as needed.
381425

382426
### 12.2 Security
@@ -416,24 +460,24 @@ Configure issuers and certificates as per your requirements.
416460
- **Resource Quotas**: Check for any limitations in Scaleway that may affect deployments.
417461
- **Persistent Volume Issues**: Ensure storage classes and PVCs are correctly configured.
418462
- **Networking Problems**: Verify VPC configurations, network policies, and firewall rules.
419-
- **Image Pull Errors**: Confirm that images are correctly tagged and accessible in Scaleway Container Registry.
463+
- **Image Pull Errors**: Confirm that images are correctly tagged and accessible in [Scaleway Container Registry]().
420464

421465
## Additional considerations
422466

423467
### Leveraging Scaleway features
424468

425-
- **Elastic Metal nodes**: For workloads requiring dedicated resources, consider adding Elastic Metal nodes to your cluster.
426-
- **Autoscaling**: Use cluster and pod autoscaling to handle variable workloads efficiently.
427-
- **Private Networking**: Use VPC and private networks for enhanced security.
469+
- **Elastic Metal nodes**: For workloads requiring dedicated resources, consider adding [Production-Optimized or Workload-Optimized nodes](/compute/instances/reference-content/choosing-instance-type/) to your cluster.
470+
- **Autoscaling**: Use cluster and [pod autoscaling](/containers/kubernetes/concepts/#autoscale) to handle variable workloads efficiently.
471+
- **Private Networking**: Use [VPC and Private Networks](/network/vpc/quickstart/) for enhanced security.
428472

429473
### Cost management
430474

431-
- **Transparent pricing**: Familiarize yourself with Scaleway's pricing models.
475+
- **Transparent pricing**: Familiarize yourself with [Scaleway's pricing models](https://www.scaleway.com/en/pricing/containers/#kubernetes-kapsule).
432476
- **Cost estimation tools**: Use Scaleway's tools or third-party services to estimate and monitor costs.
433477

434478
### Security best practices
435479

436-
- **IAM policies**: Set up proper access controls.
480+
- **IAM policies**: Set up proper [access controls]().
437481
- **Regular updates**: Keep Kubernetes and applications up to date with security patches.
438482
- **Secrets management**: Use Kubernetes Secrets securely, and consider external secret management solutions if necessary.
439483

@@ -449,13 +493,13 @@ Configure issuers and certificates as per your requirements.
449493
- [Ingress Controllers](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/)
450494
- **Community and Support**:
451495
- [Scaleway Support](https://console.scaleway.com/support/tickets)
452-
- [Scaleway Community](https://community.scaleway.com/)
496+
- [Scaleway Community](https://slack.scaleway.com/)
453497
- [Kubernetes Slack](https://slack.k8s.io/)
454498

455499
## Feedback and assistance
456500

457501
If you encounter issues or have questions during your migration:
458502

459-
- **Contact support**: Use the Scaleway support portal for technical assistance.
460-
- **Community forums**: Engage with other users and experts in the Scaleway Community.
503+
- **Contact support**: Use the [Scaleway support portal](https://console.scaleway.com/support/tickets) for technical assistance.
504+
- **Community Slack**: Engage with other users and experts in the [Scaleway Community](https://slack.scaleway.com).
461505
- **Provide feedback**: Your input helps improve services and documentation.

0 commit comments

Comments
 (0)