Gitops
Jira Ticket Jira service desks RUN équipement validation technique Envoie demande de validation aux responsable Faire action sur le projet yaml sur git Push
Jira Ticket Jira service desks RUN équipement validation technique Envoie demande de validation aux responsable Faire action sur le projet yaml sur git Push
sp log dynatrace grafana loki prometheus ELK Elasticsearch Logstash Kibana
Vscode Remote Development avec SSH et Google Cloud Platform 1 2 3 4 5 ssh-keygen -t rsa -b 4096 -C "your-email@example.com" ssh -i "chemin_vers_votre_clé_privée" username@external_ip_address
Introduction to Helm Helm is the package manager for Kubernetes, similar to how apt is for Ubuntu or pip for Python. It helps you manage Kubernetes applications through Helm Charts. Core Concepts Charts: Helm packages that contain all the resource definitions necessary to run an application in Kubernetes Repositories: Places where charts are collected and shared Releases: Instances of charts running in a Kubernetes cluster Helm vs. Kustomize Helm: Template-based approach, package management, versioning Kustomize: Overlay-based approach, native to kubectl, no templating Basic Commands Repository Management 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 # Add repository helm repo add bitnami https://charts.bitnami.com/bitnami # Update repositories helm repo update # List repositories helm repo list # Remove repository helm repo remove bitnami # Search charts helm search repo mysql helm search hub wordpress Chart Installation 1 2 3 4 5 6 7 8 9 10 11 # Install a chart helm install release-name chart-name helm install my-mariadb bitnami/mariadb helm install my-mariadb bitnami/mariadb --version 14.1.2 # Install with custom values helm install my-mariadb bitnami/mariadb -f values.yaml helm install my-mariadb bitnami/mariadb --set param=value # Install from OCI registry helm install my-release oci://registry-1.docker.io/bitnamicharts/mariadb Release Management 1 2 3 4 5 6 7 8 9 10 # List releases helm list helm ls -A # All namespaces # Uninstall release helm uninstall release-name # Get release information helm get values my-mariadb helm get notes my-mariadb Working with MariaDB Example Installation and Setup 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 # Install MariaDB helm install my-mariadb bitnami/mariadb --namespace devops # Get root password (Bash) kubectl get secret --namespace devops my-mariadb \ -o jsonpath="{.data.mariadb-root-password}" | base64 -d # Get root password (PowerShell) $encoded = kubectl get secret --namespace devops my-mariadb ` -o jsonpath="{.data.mariadb-root-password}" $decoded = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($encoded)) Write-Output $decoded # Connect to MariaDB kubectl run my-mariadb-client --rm --tty -i \ --restart='Never' \ --image docker.io/bitnami/mariadb:11.1.3-debian-11-r0 \ --namespace devops \ --command -- bash Best Practices Version Control ...
Python Installation Ubuntu/Debian 1 2 3 4 5 6 7 # Install Python sudo apt update sudo apt install python3 sudo apt install python3-pip # Install virtual environment sudo apt install python3-venv macOS 1 2 # Using Homebrew brew install python3 Windows Download from Python.org or use: 1 winget install Python.3 Virtual Environments Using venv (Built-in) 1 2 3 4 5 6 7 8 9 10 # Create virtual environment python3 -m venv myenv # Activate virtual environment source myenv/bin/activate # Linux/macOS myenv\Scripts\activate.bat # Windows CMD myenv\Scripts\Activate.ps1 # Windows PowerShell # Deactivate deactivate Package Management with pip 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 # Install packages pip install package_name pip install package_name==1.2.3 # Specific version # Install from requirements.txt pip install -r requirements.txt # Generate requirements.txt pip freeze > requirements.txt # Upgrade pip python -m pip install --upgrade pip # List installed packages pip list Anaconda Environment Installation Download from Anaconda website Or install Miniconda for a minimal installation Conda Commands 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 # Create environment conda create --name myenv python=3.9 # Activate environment conda activate myenv # Deactivate environment conda deactivate # List environments conda env list # Install packages conda install package_name # Update conda conda update conda # List installed packages conda list # Remove environment conda env remove --name myenv Environment Management 1 2 3 4 5 6 7 8 # Export environment conda env export > environment.yml # Create environment from file conda env create -f environment.yml # Clean unused packages and caches conda clean --all Project Structure Best Practices 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 project_name/ ├── README.md ├── requirements.txt ├── setup.py ├── .gitignore ├── .env ├── docs/ ├── tests/ │ ├── __init__.py │ └── test_main.py └── project_name/ ├── __init__.py ├── main.py └── utils/ └── __init__.py Development Tools Code Formatting 1 2 3 4 5 6 7 # Install formatters pip install black pip install isort # Format code black . isort . Linting 1 2 3 4 5 6 7 # Install linters pip install flake8 pip install pylint # Run linters flake8 . pylint your_module.py Type Checking 1 2 3 4 5 # Install mypy pip install mypy # Run type checking mypy your_module.py Testing 1 2 3 4 5 6 7 # Install pytest pip install pytest pip install pytest-cov # Run tests pytest pytest --cov=your_module # With coverage Common Development Patterns Environment Variables 1 2 3 4 5 6 # Using python-dotenv from dotenv import load_dotenv import os load_dotenv() api_key = os.getenv('API_KEY') Logging 1 2 3 4 5 6 7 8 9 10 import logging # Configure logging logging.basicConfig( level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' ) logger = logging.getLogger(__name__) logger.info('This is an info message') Exception Handling 1 2 3 4 5 6 7 8 9 10 11 12 13 try: # Risky operation result = some_function() except ValueError as e: logger.error(f"Value error occurred: {e}") except Exception as e: logger.error(f"Unexpected error: {e}") else: # Run if no exception process_result(result) finally: # Always run cleanup() Performance Tips Use list comprehensions instead of loops when possible Use generators for large datasets Profile code with cProfile or line_profiler Use appropriate data structures (sets for lookups, etc.) Consider using NumPy for numerical operations Use multiprocessing for CPU-bound tasks Use asyncio for I/O-bound tasks Security Best Practices Never store secrets in code Use environment variables for sensitive data Keep dependencies updated Validate all input data Use HTTPS for network connections Follow principle of least privilege Regularly update Python and packages