Skip to content

Commit

Permalink
🔵🟢 Blue/Green deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehdi-MHO committed Dec 6, 2024
1 parent acae9fa commit 5f67a2d
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 1 deletion.
76 changes: 76 additions & 0 deletions docs/2_application_deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Application Deployment

> [!NOTE]
> Focus sur
> * 🚀🚀 les `deployment`,
> * 🔵🟢 le `blue/green` déploiement,
> * 🚀🐥le `canary` déploiement.
## Primitives k8s pour déployer

* Principales abstractions : le `deployment` et les `replicaSet`

```mermaid
%%{init: {'theme':'forest'}}%%
graph TD
subgraph Deployment
subgraph ReplicaSet
subgraph Pod
Container["Container"]
end
end
end
style Deployment fill:#77F
style ReplicaSet fill:#F77
style Pod fill:#7F7
style Container fill:#77F
```

> [!TIP]
> On peut générer la déclaration d'un `deployment` en CLI pour éviter de chercher ça dans la doc le jour J :
>
> `$> kubectl create deployment nginx --image nginx:alpine --dry-run=client -o yaml > nginx-deploy.yaml;`
> [!NOTE]
> La plupart des exercices vont nous demander d'éditer un `deployment` qui tourne déjà
> Il faut être à l'aise avec les commandes :
> * `kubectl scale`
> * `kubectl edit`
> * `kubectl set`
> * `kubectl create/apply`
## 🔵🟢 Blue/Green deployment

* Principales abstractions : le `deployment`, les `replicaSet` et les `services`

```mermaid
---
config:
look: handDrawn
theme: dark
mainBkg: #f4f4f4
---
graph TD
subgraph "User Testing"
User1[("User 1")] --> BlueTest["Blue Test Service"]
User2[("User 2")] --> GreenTest["Green Test Service"]
BlueTest --> BlueApp["Blue App"]
GreenTest --> GreenApp["Green App"]
end
style BlueTest fill:orange,color:black
style GreenTest fill:orange,color:black
style BlueApp fill:#77F
style GreenApp fill:#7F7,color:black
```

> [!TIP]
> Approche impérative :
>
> `$> kubectl set selector svc [service-name] 'role=green'; # (was 'blue')`
💡 Un exemple de setup blue/green/public `service` pour faire du blue/green deployment [est dispo ici, sur le repo de npoulton](https://github.com/nigelpoulton/ckad/tree/main/2%20Application%20Deployment/2%20Use%20Kubernetes%20Primitives%20to%20Implement%20Common%20Deployment%20Strategies/Blue-Green)

🖼️ Y a ce schéma aussi qui est pas mal pour illustrer : ([crédits Anvesh Muppeda sur Medium](https://medium.com/@muppedaanvesh/blue-green-deployment-in-kubernetes-76f9153e0805)) :

![](https://miro.medium.com/v2/resize:fit:1400/1*oaQ2RlHX1ov6IXV0BSkqRg.gif)
1 change: 1 addition & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* [Home](README.md)
* [1. Define & build an image](1_define_and_build_an_image.md)
* [2. Application deployment](2_application_deployment.md)
* [Divers](utils.md)
8 changes: 7 additions & 1 deletion docs/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

## Ressources pour se former

- Cours Pluralsight [Certified Kubernetes Application Developer: Application Design and Build](https://app.pluralsight.com/library/courses/ckad-services-networking-cert/table-of-contents) de [Nigel Poulton](https://www.nigelpoulton.com/)
- Cours Pluralsight [Certified Kubernetes Application Developer: Application Design and Build](https://app.pluralsight.com/library/courses/ckad-services-networking-cert/table-of-contents)
- de [Nigel Poulton](https://www.nigelpoulton.com/)
- et [Dan Wahlin](https://www.linkedin.com/in/danwahlin/)
- Cours Udemy [Kubernetes Certified Application Developer (CKAD) with Tests](https://www.udemy.com/course/certified-kubernetes-application-developer/)
- de [Mumshad Mannambeth](https://www.linkedin.com/in/mmumshad/)
- cours recommandé par le CNCF
- vient avec un accès à des labs interactif en ligne sur la plateforme [KodeKloud](https://kodekloud.com/)
- Pages officielles du CNCF sur le contenu de l'examen :
- ℹ️ A propos : <https://www.cncf.io/training/certification/ckad/>
- 📖 Certificate handbook : <https://docs.linuxfoundation.org/tc-docs/certification/lf-handbook2>
Expand Down

0 comments on commit 5f67a2d

Please sign in to comment.