mirror of https://github.com/k3s-io/k3s
Fix egress selector proxy/bind-address support
Use same kubelet-preferred-address-types setting as RKE2 to improve reliability of the egress selector when using a HTTP proxy. Also, use BindAddressOrLoopback to ensure that the correct supervisor address is used when --bind-address is set. Signed-off-by: Brad Davidson <brad.davidson@rancher.com>pull/5812/head
parent
4f4cf18fb6
commit
ff6c233e41
|
@ -734,7 +734,7 @@ func genEgressSelectorConfig(controlConfig *config.Control) error {
|
|||
ProxyProtocol: apiserver.ProtocolHTTPConnect,
|
||||
Transport: &apiserver.Transport{
|
||||
TCP: &apiserver.TCPTransport{
|
||||
URL: fmt.Sprintf("https://%s:%d", controlConfig.Loopback(), controlConfig.SupervisorPort),
|
||||
URL: fmt.Sprintf("https://%s:%d", controlConfig.BindAddressOrLoopback(false), controlConfig.SupervisorPort),
|
||||
TLSConfig: &apiserver.TLSConfig{
|
||||
CABundle: controlConfig.Runtime.ServerCA,
|
||||
ClientKey: controlConfig.Runtime.ClientKubeAPIKey,
|
||||
|
|
|
@ -192,6 +192,7 @@ func apiServer(ctx context.Context, cfg *config.Control) error {
|
|||
argsMap["kubelet-certificate-authority"] = runtime.ServerCA
|
||||
argsMap["kubelet-client-certificate"] = runtime.ClientKubeAPICert
|
||||
argsMap["kubelet-client-key"] = runtime.ClientKubeAPIKey
|
||||
argsMap["kubelet-preferred-address-types"] = "InternalIP,ExternalIP,Hostname"
|
||||
argsMap["requestheader-client-ca-file"] = runtime.RequestHeaderCA
|
||||
argsMap["requestheader-allowed-names"] = deps.RequestHeaderCN
|
||||
argsMap["proxy-client-cert-file"] = runtime.ClientAuthProxyCert
|
||||
|
|
Loading…
Reference in New Issue