Fix: Updated deployment files with correct Prometheus URL and RBAC permissions

This commit is contained in:
2025-09-25 22:15:54 -03:00
parent f38689d9dd
commit 1bc1a40a02
8 changed files with 138 additions and 98 deletions

View File

@@ -22,7 +22,23 @@ class PrometheusClient:
async def initialize(self):
"""Initialize Prometheus client"""
try:
self.session = aiohttp.ClientSession()
# Create session with SSL verification disabled for self-signed certificates
connector = aiohttp.TCPConnector(ssl=False)
# Get service account token for authentication
token = None
try:
with open('/var/run/secrets/kubernetes.io/serviceaccount/token', 'r') as f:
token = f.read().strip()
except FileNotFoundError:
logger.warning("Service account token not found, proceeding without authentication")
# Create headers with token if available
headers = {}
if token:
headers['Authorization'] = f'Bearer {token}'
self.session = aiohttp.ClientSession(connector=connector, headers=headers)
# Test connection
async with self.session.get(f"{self.base_url}/api/v1/query?query=up") as response: