1

I am facing issue when trying to import k8s cluster in Rancher.

here are the logs of when trying to run the commands:

Commnad:

curl --insecure -sfL https://172.31.91.168/v3/import/zlxz57dj7nhpdzx4cw7lvfdnj9zt7n2tpk4df5v7frq2tfjf52j49j_c-m-jgw4wzm5.yaml | kubectl apply -f -

Logs

clusterrole.rbac.authorization.k8s.io/proxy-clusterrole-kubeapiserver unchanged

clusterrolebinding.rbac.authorization.k8s.io/proxy-role-binding-kubernetes-master unchanged
namespace/cattle-system unchanged
serviceaccount/cattle unchanged
clusterrolebinding.rbac.authorization.k8s.io/cattle-admin-binding unchanged
secret/cattle-credentials-f144527 unchanged
clusterrole.rbac.authorization.k8s.io/cattle-admin unchanged
deployment.apps/cattle-cluster-agent configured
service/cattle-cluster-agent unchanged

Second Command:

kubectl apply -f https://172.31.91.168/v3/import/zlxz57dj7nhpdzx4cw7lvfdnj9zt7n2tpk4df5v7frq2tfjf52j49j_c-m-jgw4wzm5.yaml

Logs:

Unable to connect to the server: tls: failed to verify certificate: x509: certificate signed by unknown authority

Unable to identify the issue. As rancher is running on separate e2 instance under Docker and K8s cluster is running separate machine and worker node as well.

For reference sharing the snap shot:

enter image description here enter image description here

I check out almost the number of given answer here related to SSL but not able to find and relevant answer.

3
  • Can you check the api server logs or certificate paths? Jul 19, 2023 at 11:53
  • @DeepakMourya thanks . AS the issue has been resolved. Jul 19, 2023 at 12:19
  • There was issue with kubectl version of Rancher and K8s server. By the way we can use the first command to add import the cluster. Jul 19, 2023 at 12:20

1 Answer 1

0

Create file daemon.json in /etc/docker/ inside put this: { "insecure-registries" : ["docker-registry-machine-name:443","docker-registry-machine-name:80","0.0.0.0/0"] } and save it.

After that with jenkins user run this command: git config --global http.sslVerify "false"

Then restart Jenkins and should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.