fix: Add tls-server-name support for Teleport and similar proxies #502
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #495 - SSL certificate verification fails when using Teleport Kubernetes proxy
Problem
When using KRR with Kubernetes clusters accessed through Teleport or similar proxies, SSL certificate verification fails with:
This happens because Teleport kubeconfigs use
tls-server-nameto specify the SNI hostname for TLS negotiation, which differs from the server URL:The CA certificate is valid for the
tls-server-name(SNI) hostname, not the server URL hostname.Solution
Extended the existing
config_patch.py(which already handlesproxy-url) to also supporttls-server-name:tls-server-namefrom the cluster configuration in kubeconfigtls_server_nameThis follows the same pattern already established for
proxy-urlsupport.Changes
robusta_krr/core/integrations/kubernetes/config_patch.py:tls-server-namefrom kubeconfig cluster configConfigurationclass to accepttls_server_nameparameter_set_configto iterate over bothproxyandtls_server_namekeysTesting
Users with Teleport access can test by:
tsh kube login)kubectl get podsworkskrr simple -p <prometheus-url>cc @prein (issue reporter who offered to help test)