https://rancher.com/ logo
#k3s
Title
# k3s
b

breezy-autumn-81048

02/15/2023, 3:12 PM
Good day to all, Sorry if it's not the right place to ask for help. I want to run Rancher as a single node (basically, separately from other clusters, in a separate VM) and with its help create k8s clusters. For testing purposes in two different environments: Mac pc and RHEL8 VM, I have installed the same rancher v2.7.1 image in the docker container. However, the output was different: Mac (everything works fine): INFO: Running k3s server --cluster-init --cluster-reset 2023/02/15 134709 [INFO] Rancher version v2.7.1 (bb1c35fc4) is starting 2023/02/15 134709 [INFO] Rancher arguments {ACMEDomains:[] AddLocal:true Embedded:false BindHost: HTTPListenPort:80 HTTPSListenPort:443 K8sMode:auto Debug:false Trace:false NoCACerts:false AuditLogPath:/var/log/auditlog/rancher-api-audit.log AuditLogMaxage:10 AuditLogMaxsize:100 AuditLogMaxbackup:10 AuditLevel:0 Features: ClusterRegistry:} 2023/02/15 134709 [INFO] Listening on /tmp/log.sock 2023/02/15 134709 [INFO] Waiting for server to become available: Get "https://127.0.0.1:6444/version?timeout=15m0s": dial tcp 127.0.0.16444 connect: connection refused 2023/02/15 134711 [INFO] Waiting for server to become available: Get "https://127.0.0.1:6444/version?timeout=15m0s": dial tcp 127.0.0.16444 connect: connection refused 2023/02/15 134713 [INFO] Waiting for server to become available: Get "https://127.0.0.1:6444/version?timeout=15m0s": dial tcp 127.0.0.16444 connect: connection refused 2023/02/15 134715 [INFO] Waiting for server to become available: Get "https://127.0.0.1:6444/version?timeout=15m0s": dial tcp 127.0.0.16444 connect: connection refused 2023/02/15 134723 [INFO] Running in single server mode, will not peer connections 2023/02/15 134723 [INFO] Applying CRD features.management.cattle.io 2023/02/15 134751 [INFO] Applying CRD navlinks.ui.cattle.io On RHEL8 VM: INFO: Running k3s server --cluster-init --cluster-reset 2023/02/15 150513 [INFO] Rancher version v2.7.1 (bb1c35fc4) is starting 2023/02/15 150513 [INFO] Rancher arguments {ACMEDomains:[] AddLocal:true Embedded:false BindHost: HTTPListenPort:80 HTTPSListenPort:443 K8sMode:auto Debug:false Trace:false NoCACerts:false AuditLogPath:/var/log/auditlog/rancher-api-audit.log AuditLogMaxage:10 AuditLogMaxsize:100 AuditLogMaxbackup:10 AuditLevel:0 Features: ClusterRegistry:} 2023/02/15 150513 [INFO] Listening on /tmp/log.sock 2023/02/15 150513 [INFO] Waiting for server to become available: Get "https://127.0.0.1:6444/version?timeout=15m0s": dial tcp 127.0.0.16444 connect: connection refused 2023/02/15 150515 [INFO] Waiting for server to become available: Get "https://127.0.0.1:6444/version?timeout=15m0s": dial tcp 127.0.0.16444 connect: connection refused 2023/02/15 150517 [INFO] Waiting for server to become available: Get "https://127.0.0.1:6444/version?timeout=15m0s": dial tcp 127.0.0.16444 connect: connection refused 2023/02/15 150519 [INFO] Waiting for server to become available: Get "https://127.0.0.1:6444/version?timeout=15m0s": dial tcp 127.0.0.16444 connect: connection refused 2023/02/15 150521 [INFO] Waiting for server to become available: Get "https://127.0.0.1:6444/version?timeout=15m0s": dial tcp 127.0.0.16444 connect: connection refused 2023/02/15 150523 [INFO] Waiting for server to become available: Get "https://127.0.0.1:6444/version?timeout=15m0s": dial tcp 127.0.0.16444 connect: connection refused 2023/02/15 150530 [FATAL] k3s exited with: exit status 2 My question is why in one case it automatically switched to the "single server mode" and in another, it didn't? Thanks in advance,
r

rough-farmer-49135

02/15/2023, 3:25 PM
Did you disable firewalld? That'd be my first guess. As for the single server mode I'm guessing it timed out & died before getting to that point.
b

breezy-autumn-81048

02/15/2023, 4:59 PM
Thank you for your reply! Yes, I have disabled firewalld and restarted docker.service as well as recreated the docker container. However, I'm still getting:
Copy code
2023/02/15 16:56:21 [INFO] Done waiting for CRD <http://projects.management.cattle.io|projects.management.cattle.io> to become available
2023/02/15 16:56:21 [INFO] Waiting for CRD <http://clustertemplates.management.cattle.io|clustertemplates.management.cattle.io> to become available
2023/02/15 16:56:21 [FATAL] k3s exited with: exit status 2
INFO: Running k3s server --cluster-init --cluster-reset
2023/02/15 16:56:47 [INFO] Rancher version v2.7.1 (bb1c35fc4) is starting
2023/02/15 16:56:47 [INFO] Rancher arguments {ACMEDomains:[] AddLocal:true Embedded:false BindHost: HTTPListenPort:80 HTTPSListenPort:443 K8sMode:auto Debug:false Trace:false NoCACerts:false AuditLogPath:/var/log/auditlog/rancher-api-audit.log AuditLogMaxage:10 AuditLogMaxsize:100 AuditLogMaxbackup:10 AuditLevel:0 Features: ClusterRegistry:}
2023/02/15 16:56:47 [INFO] Listening on /tmp/log.sock
2023/02/15 16:56:47 [INFO] Waiting for server to become available: Get "<https://127.0.0.1:6444/version?timeout=15m0s>": dial tcp 127.0.0.1:6444: connect: connection refused
2023/02/15 16:56:49 [INFO] Waiting for server to become available: Get "<https://127.0.0.1:6444/version?timeout=15m0s>": dial tcp 127.0.0.1:6444: connect: connection refused
2023/02/15 16:56:51 [INFO] Waiting for server to become available: Get "<https://127.0.0.1:6444/version?timeout=15m0s>": dial tcp 127.0.0.1:6444: connect: connection refused
2023/02/15 16:56:53 [INFO] Waiting for server to become available: Get "<https://127.0.0.1:6444/version?timeout=15m0s>": dial tcp 127.0.0.1:6444: connect: connection refused
2023/02/15 16:56:55 [INFO] Waiting for server to become available: Get "<https://127.0.0.1:6444/version?timeout=15m0s>": dial tcp 127.0.0.1:6444: connect: connection refused
2023/02/15 16:56:57 [INFO] Waiting for server to become available: Get "<https://127.0.0.1:6444/version?timeout=15m0s>": dial tcp 127.0.0.1:6444: connect: connection refused
2023/02/15 16:56:59 [INFO] Waiting for server to become available: Get "<https://127.0.0.1:6444/version?timeout=15m0s>": dial tcp 127.0.0.1:6444: connect: connection refused
2023/02/15 16:57:06 [FATAL] k3s exited with: exit status 2
Docker version 23.0.1, build a5ee5b1; Python 3.6.8;
r

rough-farmer-49135

02/15/2023, 5:02 PM
Are you using k3d? If so you might try the k3d channel instead, if not I'm not sure why Docker is involved as k3s & RKE2 don't use it.
b

breezy-autumn-81048

02/15/2023, 5:05 PM
Nope, the thing is that I have only installed docker, and python so I could run Rancher without k3s, k3d, or even k8s cluster
r

rough-farmer-49135

02/15/2023, 5:11 PM
Ok, so you're just running Rancher there. What you're seeing is that it's failing to connect to the kubernetes API server in the control plane. You're going to need to check some other logs to see what's blocking it from starting up, because it's taking too long to start so things are timing out. I'm less familiar with k3s than rke2, but I believe you can check the command
systemctl
to find the name of the RHEL 8 OS service that is running k3s. From there try
journalctl -u $K3S_SERVICE_NAME
and see what you can find. You may have something else off. If you have selinux enabled that might do it too. The
getenforce
command will say Enforcing if it's on and Permissive or Disabled if it's not. If it's on the place you can turn it off is by editing /etc/selinux/config and set SELINUX to permissive or disabled. RKE2 can handle SELinux enforcing but I don't know that k3s can, and RKE2 needs some additional steps to do so anyway so even if it can then you probably don't have that set up and that might be what's biting you.
b

breezy-autumn-81048

02/15/2023, 7:16 PM
Thank you for suggestion! I have disabled selinux, but that didn't help. There is no systemd service running with the name k3s and in general I didn't install it on that VM.
Copy code
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      81783/docker-proxy
tcp        0      0 0.0.0.0:9323            0.0.0.0:*               LISTEN      2550/dockerd
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      81795/docker-proxy
r

rough-farmer-49135

02/15/2023, 8:16 PM
I'm not sure I understand what you're doing then. Only other suggestion I have is that SELinux could've made part of the install fail, so a complete uninstall on the RHEL 8 and then re-install with SELinux off may change things. If that doesn't work not sure what to suggest.
b

breezy-autumn-81048

02/17/2023, 1:17 PM
It seems that there is a Rancher version 2.7.1 compatibility issue with RHEL8. I have tried to use v2.5.7 and it works fine, I could access Rancher from the UI via port 80.
99 Views