Kubectl get logs not work

What kind of request is this (question/bug/enhancement/feature request): bug

Steps to reproduce (least amount of steps as possible):

I followed the steps on these documents. I have installed this to three vm servers.(HA-Cluster)
and create one pod

apiVersion: v1
kind: Pod
metadata:
  name: test1
  namespace: jenkins
spec:
  containers:
    - name: docker
      image: docker:20.10-dind
      command:
        - cat
      tty: true

Result:
i get error on get logs.

> kubectl logs test1 -n jenkins
Error from server: Get https://n3-paean:10250/containerLogs/jenkins/test1/docker: dial tcp: lookup n3-paean on 213.133.98.98:53: no such host

image

  • n3-paean is cluster node.

Environment information

  • Rancher version (rancher/rancher/rancher/server image tag or shown bottom left in the UI): v2.5.7
  • Installation option (single install/HA): HA

Cluster information

  • Cluster type (Hosted/Infrastructure Provider/Custom/Imported): Custom (Hetzner Cloud VMs)
  • Machine type (cloud/VM/metal) and specifications (CPU/memory): VM, 4 VCpu 8 GB memory per node
  • Kubernetes version (use kubectl version):
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.16+rke2r1", GitCommit:"7a98bb2b7c9112935387825f2fce1b7d40b76236", GitTreeState:"clean", BuildDate:"2021-02-24T15:46:26Z", GoVersion:"go1.13.15b4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.16+rke2r1", GitCommit:"7a98bb2b7c9112935387825f2fce1b7d40b76236", GitTreeState:"clean", BuildDate:"2021-02-24T15:46:26Z", GoVersion:"go1.13.15b4", Compiler:"gc", Platform:"linux/amd64"}
  • Docker version (use docker version): Rancherd (v1.18.16+rke2r1)

is there someone to help ??

This forum seems somewhat unhelpful :confused:

dial tcp: lookup n3-paean on 213.133.98.98:53: no such host

This means the hostname used for the rancherd install cannot be resolved on the host(s). The nameserver is coming from /etc/resolv.conf (or a local DNS cache resolver). I think /etc/hosts might also be consulted in this request.

If you can’t use that hostname, you can override the kubelet preferred address types using --kubelet-preferred-address-types on the kube-apiserver (kube-apiserver | Kubernetes) or provide a different value using --hostname-override on the kubelet (kubelet | Kubernetes)

i added kube-apiserver-arg: "kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname" to /etc/rancher/rke2/config.yaml and its work now!