2

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.

1 Answers1

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.