0

My K8s cluster is running on Azure VM. I'm facing with a TLS error when I try to get something from a cluster. However the config of k8s is correct and it has the public IP I need, also it has all the required certs, and I already checked if they are correct.

But If I execute "kubectl get pods -A" it give me an output:

E0617 18:44:33.767685 2601946 memcache.go:265] couldn't get current server API group list: Get "https://SERVER_IP_AND_PORT/api?timeout=32s": tls: first record does not look like a TLS handshakeE0617 18:44:33.780378 2601946 memcache.go:265] couldn't get current server API group list: Get "https://SERVER_IP_AND_PORT/api?timeout=32s": tls: first record does not look like a TLS handshakeE0617 18:44:33.792515 2601946 memcache.go:265] couldn't get current server API group list: Get "https://SERVER_IP_AND_PORT/api?timeout=32s": tls: first record does not look like a TLS handshakeE0617 18:44:33.804779 2601946 memcache.go:265] couldn't get current server API group list: Get "https://SERVER_IP_AND_PORT/api?timeout=32s": tls: first record does not look like a TLS handshakeE0617 18:44:33.816601 2601946 memcache.go:265] couldn't get current server API group list: Get "https://SERVER_IP_AND_PORT/api?timeout=32s": tls: first record does not look like a TLS handshakeUnable to connect to the server: tls: first record does not look like a TLS handshake

SERVER_IP_AND_PORT = the same IP I use to connect to the server with ssh

here is an output of "kubectl get pods -A -v=10"

I0617 19:11:42.270715 2603986 loader.go:395] Config loaded from file:  /home/dev/.kube/config
I0617 19:11:42.271332 2603986 round_trippers.go:466] curl -v -XGET  -H "Accept: application/json;g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList,application/json;g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList,application/json" -H "User-Agent: kubectl/v1.30.2 (linux/amd64) kubernetes/3968350" 'https://SERVER_IP_AND_PORT/api?timeout=32s'
I0617 19:11:42.272932 2603986 round_trippers.go:510] HTTP Trace: Dial to tcp:SERVER_IP_AND_PORT succeed
I0617 19:11:42.284952 2603986 round_trippers.go:553] GET https://SERVER_IP_AND_PORT/api?timeout=32s  in 13 milliseconds
I0617 19:11:42.285014 2603986 round_trippers.go:570] HTTP Statistics: DNSLookup 0 ms Dial 1 ms TLSHandshake 11 ms Duration 13 ms
I0617 19:11:42.285027 2603986 round_trippers.go:577] Response Headers:
E0617 19:11:42.285103 2603986 memcache.go:265] couldn't get current server API group list: Get "https://SERVER_IP_AND_PORT/api?timeout=32s": tls: first record does not look like a TLS handshake
I0617 19:11:42.285118 2603986 cached_discovery.go:120] skipped caching discovery info due to Get "https://SERVER_IP_AND_PORT/api?timeout=32s": tls: first record does not look like a TLS handshake
I0617 19:11:42.285199 2603986 round_trippers.go:466] curl -v -XGET  -H "Accept: application/json;g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList,application/json;g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList,application/json" -H "User-Agent: kubectl/v1.30.2 (linux/amd64) kubernetes/3968350" 'https://SERVER_IP_AND_PORT/api?timeout=32s'
I0617 19:11:42.286838 2603986 round_trippers.go:510] HTTP Trace: Dial to tcp:SERVER_IP_AND_PORT succeed
I0617 19:11:42.299499 2603986 round_trippers.go:553] GET https://SERVER_IP_AND_PORT/api?timeout=32s  in 14 milliseconds
I0617 19:11:42.299518 2603986 round_trippers.go:570] HTTP Statistics: DNSLookup 0 ms Dial 1 ms TLSHandshake 12 ms Duration 14 ms
I0617 19:11:42.299535 2603986 round_trippers.go:577] Response Headers:
E0617 19:11:42.299589 2603986 memcache.go:265] couldn't get current server API group list: Get "https://SERVER_IP_AND_PORT/api?timeout=32s": tls: first record does not look like a TLS handshake
I0617 19:11:42.299607 2603986 cached_discovery.go:120] skipped caching discovery info due to Get "https://SERVER_IP_AND_PORT/api?timeout=32s": tls: first record does not look like a TLS handshake
I0617 19:11:42.299623 2603986 shortcut.go:103] Error loading discovery information: Get "https://SERVER_IP_AND_PORT/api?timeout=32s": tls: first record does not look like a TLS handshake
I0617 19:11:42.299705 2603986 round_trippers.go:466] curl -v -XGET  -H "Accept: application/json;g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList,application/json;g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList,application/json" -H "User-Agent: kubectl/v1.30.2 (linux/amd64) kubernetes/3968350" 'https://SERVER_IP_AND_PORT/api?timeout=32s'
I0617 19:11:42.300813 2603986 round_trippers.go:510] HTTP Trace: Dial to tcp:SERVER_IP_AND_PORT succeed
I0617 19:11:42.313162 2603986 round_trippers.go:553] GET https://SERVER_IP_AND_PORT/api?timeout=32s  in 13 milliseconds
I0617 19:11:42.313183 2603986 round_trippers.go:570] HTTP Statistics: DNSLookup 0 ms Dial 1 ms TLSHandshake 12 ms Duration 13 ms
I0617 19:11:42.313193 2603986 round_trippers.go:577] Response Headers:
E0617 19:11:42.313241 2603986 memcache.go:265] couldn't get current server API group list: Get "https://SERVER_IP_AND_PORT/api?timeout=32s": tls: first record does not look like a TLS handshake
I0617 19:11:42.313253 2603986 cached_discovery.go:120] skipped caching discovery info due to Get "https://SERVER_IP_AND_PORT/api?timeout=32s": tls: first record does not look like a TLS handshake
I0617 19:11:42.313376 2603986 round_trippers.go:466] curl -v -XGET  -H "Accept: application/json;g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList,application/json;g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList,application/json" -H "User-Agent: kubectl/v1.30.2 (linux/amd64) kubernetes/3968350" 'https://SERVER_IP_AND_PORT/api?timeout=32s'
I0617 19:11:42.314300 2603986 round_trippers.go:510] HTTP Trace: Dial to tcp:SERVER_IP_AND_PORT succeed
I0617 19:11:42.325425 2603986 round_trippers.go:553] GET https://SERVER_IP_AND_PORT/api?timeout=32s  in 12 milliseconds
I0617 19:11:42.325447 2603986 round_trippers.go:570] HTTP Statistics: DNSLookup 0 ms Dial 0 ms TLSHandshake 11 ms Duration 12 ms
I0617 19:11:42.325457 2603986 round_trippers.go:577] Response Headers:
E0617 19:11:42.325503 2603986 memcache.go:265] couldn't get current server API group list: Get "https://SERVER_IP_AND_PORT/api?timeout=32s": tls: first record does not look like a TLS handshake
I0617 19:11:42.325513 2603986 cached_discovery.go:120] skipped caching discovery info due to Get "https://SERVER_IP_AND_PORT/api?timeout=32s": tls: first record does not look like a TLS handshake
I0617 19:11:42.325591 2603986 round_trippers.go:466] curl -v -XGET  -H "Accept: application/json;g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList,application/json;g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList,application/json" -H "User-Agent: kubectl/v1.30.2 (linux/amd64) kubernetes/3968350" 'https://SERVER_IP_AND_PORT/api?timeout=32s'
I0617 19:11:42.326556 2603986 round_trippers.go:510] HTTP Trace: Dial to tcp:SERVER_IP_AND_PORT succeed
I0617 19:11:42.338013 2603986 round_trippers.go:553] GET https://SERVER_IP_AND_PORT/api?timeout=32s  in 12 milliseconds
I0617 19:11:42.338068 2603986 round_trippers.go:570] HTTP Statistics: DNSLookup 0 ms Dial 0 ms TLSHandshake 11 ms Duration 12 ms
I0617 19:11:42.338080 2603986 round_trippers.go:577] Response Headers:
E0617 19:11:42.338129 2603986 memcache.go:265] couldn't get current server API group list: Get "https://SERVER_IP_AND_PORT/api?timeout=32s": tls: first record does not look like a TLS handshake
I0617 19:11:42.338142 2603986 cached_discovery.go:120] skipped caching discovery info due to Get "https://SERVER_IP_AND_PORT/api?timeout=32s": tls: first record does not look like a TLS handshake
I0617 19:11:42.338166 2603986 helpers.go:264] Connection error: Get https://SERVER_IP_AND_PORT/api?timeout=32s: tls: first record does not look like a TLS handshake
Unable to connect to the server: tls: first record does not look like a TLS handshake

how can I fix that?

0

You must log in to answer this question.

Browse other questions tagged .