Pod creation succeeds but response structure may not have metadata.
Add safe navigation to prevent error.
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
applyToHTTPSOptions doesn't work reliably. Instead, pass the
httpsAgent as the last parameter to createNamespacedPod.
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
skipTLSVerify flag is not respected by @kubernetes/client-node.
Solution: Create custom https.Agent with rejectUnauthorized: false
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
When K8S_IN_CLUSTER=true, backend uses loadFromCluster() which needs
skipTLSVerify to work with self-signed cluster certificates.
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
The @kubernetes/client-node API expects parameters as an object:
{ namespace: 'ns', body: pod } instead of positional params.
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
- Remove apiVersion and kind from pod spec (not needed for client-node)
- Remove namespace from metadata (passed as parameter)
- Use proper V1Pod type from @kubernetes/client-node
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>