pip install -r requirements.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def connect_to_postgres(host, port, dbname, user, password): | |
try: | |
conn = psycopg2.connect( | |
host=host, | |
port=port, | |
dbname=dbname, | |
user=user, | |
password=password | |
) | |
print("✅ Connexion réussie à PostgreSQL") |
-
Install WSL 2 Ubuntu from Microsoft Store
-
Install Docker Desktop
-
Check Docker Desktop uses Docker
-
Install minikube in windows with docker driver
minikube start --driver docker
-
Install kubectl with
minikube kubectl version
-
Fix docker iussue
docker context use default
-
Add following content to set-k8s-credentials.sh. This script must be rerun every time we relaunch minikube
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastapi import FastAPI | |
from kubernetes import client, config | |
import uvicorn | |
app = FastAPI() | |
# Charger la configuration Kubernetes en utilisant le service account du pod | |
config.load_incluster_config() | |
# Obtenir la liste des namespaces |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# main.py | |
from fastapi import FastAPI, HTTPException | |
from pydantic import BaseModel | |
import os | |
import pymysql | |
app = FastAPI() | |
class Item(BaseModel): | |
name: str |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ETCDCTL_API=3 etcdctl --endpoints=https://127.0.0.1:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key defrag |
Le code a été conçu pour python 3.11 et redis v5.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv | |
sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv |
I hereby claim:
- I am thibaultserti on github.
- I am thibaultserti (https://keybase.io/thibaultserti) on keybase.
- I have a public key whose fingerprint is F2B6 AEF1 AA9B 56B2 90C9 6AC0 7F9A 9687 E7CA 0D86
To claim this, I am signing this object:
NewerOlder