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
| Task: Generate comprehensive technical documentation for implementing and using PROXY Protocol version 2. | |
| Audience: Senior DevOps engineers, backend developers, software and system architects, security managers. | |
| Format Requirements: Use Markdown with clear headings, code blocks for configuration snippets, and bulleted lists for specifications. | |
| Content Requirements: | |
| Business Context & Specific Requirements: | |
| The "Why": Detail the exact infrastructure problem driving the adoption of PROXY protocol v2 instead of v1 or standard X-Forwarded-For headers (e.g., requirement for binary parsing efficiency at 10k+ requests per second, strict TCP streaming requirements where HTTP header injection is impossible). |
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
| import asyncio | |
| import sys | |
| import time | |
| from kr8s.asyncio import Resource | |
| from prometheus_client import Gauge, start_http_server | |
| # Prometheus metric | |
| argocd_application_override = Gauge( | |
| 'argocd_application_override', |
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
| import kopf | |
| import kr8s | |
| from prometheus_client import start_http_server, Gauge | |
| # Initialize Kubernetes client | |
| kr8s.load_config() | |
| # Define Prometheus metric | |
| argocd_application_override = Gauge('argocd_application_override', 'Tracks changes in Application helm parameters', ['application']) |
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
| import kr8s | |
| import time | |
| import random | |
| import os | |
| import json | |
| from kr8s.objects import Node | |
| # the label selector | |
| egress_selector = {'egress': 'ready'} | |
| #egress_nodes = ["kind-worker", "kind-worker2"] |
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
| #!/bin/bash | |
| #usage: mysql-drop-all-tables -d database -u dbuser -p dbpass | |
| TEMP_FILE_PATH='./drop_all_tables.sql' | |
| while getopts d:u:p: option | |
| do | |
| case "${option}" | |
| in |
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
| # VIM - order and ident HTML | |
| :s/<[^>]*>/\r&\r/g | |
| :g/^$/d |