Mam problem z dodaniem klastra k8s do ranchera (są na dwóch oddzielnych). Wykonałem pierwszą komendę
curl --insecure -sfL https://rancher.homelab.com/v3/import/xxx.yaml | kubectl apply -f -
no i potem żeby już importa zrobić, ale dostaje błąd:
[root@master ~]# kubectl apply -f https://rancher.homelab.com/v3/import/kk7smtcrlnmr9cbnl9p6hjk2kc4dv547hql97c7r9k64btnwdwvwsr_c-k6gjz.yaml
Unable to connect to the server: tls: failed to verify certificate: x509: certificate signed by unknown authority
[root@master ~]#
tak wygląda log z poda cattle-system-agent
INFO: Using resolv.conf: search cattle-system.svc.cluster.local svc.cluster.local cluster.local example.com nameserver 169.254.25.10 options ndots:5
INFO: https://rancher.homelab.com/ping is accessible
INFO: rancher.homelab.com resolves to 192.168.1.11
INFO: Value from https://rancher.homelab.com/v3/settings/cacerts is an x509 certificate
time="2025-05-28T17:03:28Z" level=info msg="starting cattle-credential-cleanup goroutine in the background"
time="2025-05-28T17:03:28Z" level=info msg="Listening on /tmp/log.sock"
time="2025-05-28T17:03:28Z" level=info msg="Rancher agent version v2.11.2 is starting"
time="2025-05-28T17:03:28Z" level=info msg="Testing connection to https://rancher.homelab.com using trusted certificate authorities within: /etc/kubernetes/ssl/certs/serverca"
time="2025-05-28T17:03:28Z" level=error msg="Could not securely connect to https://rancher.homelab.com: Get \"https://rancher.homelab.com\": tls: failed to verify certificate: x509: certificate signed by unknown authority"
[root@master ~]#
Sam instalacja rancher jest praktycznie default tylko mam dodane privateCA = true i tak go tworze
openssl req -x509 -newkey rsa:2048 -keyout /dev/null -out /dev/stdout -days 365 -nodes -subj '/CN=rancher-ca' > cacerts.pem
kubectl create secret generic tls-ca --from-file=cacerts.pem -n cattle-system
już tyle próbowałem rzeczy z neta i z AI, takich jak import certa z secretu tls-ca do /etc/pki/ca-trust, podmontowywanie tego certa w deploymencie cattle-system-agent, dodanie flag --insecure-skip-tls-verify nic nie pomagało zawsze wracałem do tego samego błędu