diff --git a/src/lib/k8s.ts b/src/lib/k8s.ts index f33c092..4ef7320 100644 --- a/src/lib/k8s.ts +++ b/src/lib/k8s.ts @@ -3,6 +3,7 @@ */ import * as k8s from '@kubernetes/client-node' +import * as https from 'https' let k8sClient: k8s.CoreV1Api | null = null let k8sConfig: k8s.KubeConfig | null = null @@ -28,6 +29,16 @@ export function initK8sClient() { cluster.skipTLSVerify = true console.log('🔓 K8s client configured to skip TLS verification (in-cluster mode)') } + + // Create custom HTTPS agent that ignores certificate errors + const httpsAgent = new https.Agent({ + rejectUnauthorized: false + }) + + // Apply custom agent to the config + k8sConfig.applyToHTTPSOptions({ + httpsAgent: httpsAgent + } as any) } else { // Load from kubeconfig file const configPath = process.env.K8S_CONFIG_PATH || process.env.KUBECONFIG || '~/.kube/config'