REFACTOR(app): use native Python clients
Major changes: - Kubernetes tools: Replace subprocess kubectl calls with kubernetes-client library - Supports in-cluster config for pod execution - Fallback to local kubeconfig for development - All k8s tools (nodes, pods, deployments, logs, describe) now use Python API - PostgreSQL tools: Replace kubectl exec psql with direct psycopg2 connection - Connect via Kubernetes service DNS - Support for environment-based configuration - Improved error handling with proper pgcode/pgerror - Prometheus tools: Replace kubectl exec wget with direct HTTP requests - Use requests library to query Prometheus API - Connect via Kubernetes service DNS - Configurable via PROMETHEUS_URL env var - Deployment updates: Add explicit PostgreSQL connection env vars - POSTGRES_HOST, POSTGRES_PORT, POSTGRES_USER - Already had POSTGRES_PASSWORD from secret Benefits: - No longer requires kubectl binary in container - Faster execution (no subprocess overhead) - Better error handling and type safety - Works seamlessly in Kubernetes pods with RBAC
This commit is contained in:
@@ -42,6 +42,12 @@ spec:
|
||||
# SQLAlchemy format (if needed)
|
||||
- name: DATABASE_URL
|
||||
value: "postgresql+asyncpg://bluemayne:$(POSTGRES_PASSWORD)@postgresql-primary.postgresql.svc.cluster.local:5432/mas"
|
||||
- name: POSTGRES_HOST
|
||||
value: "postgresql-primary.postgresql.svc.cluster.local"
|
||||
- name: POSTGRES_PORT
|
||||
value: "5432"
|
||||
- name: POSTGRES_USER
|
||||
value: "bluemayne"
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
|
||||
@@ -16,5 +16,5 @@ commonLabels:
|
||||
# 이미지 태그 설정 (ArgoCD Image Updater가 자동으로 업데이트)
|
||||
images:
|
||||
- name: gitea0213.kro.kr/bluemayne/mas
|
||||
newTag: main-sha-28c6e6f8b827900a25c03f3e63c874ddedecf535
|
||||
newTag: main-sha-22b0840afde85b864df82a5c9408da8c78e28195
|
||||
|
||||
|
||||
Reference in New Issue
Block a user