argo-cd: argocd cluster add fails
Checklist:
- I’ve searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
- I’ve included steps to reproduce the bug.
- I’ve pasted the output of
argocd version
.
Describe the bug
argocd cluster add <cluster> fails.
To Reproduce
- Install argocd in local docker desktop k8s, and login argocd by argocd login command.
- minikube start. kubectl to minikube is no problem.
- exec
kubectl port-forward svc/argocd-server -n argocd 8080:443
- exec
argocd cluster add minikube --insecure
. logs are below.
INFO[0000] ServiceAccount "argocd-manager" created in namespace "kube-system"
INFO[0000] ClusterRole "argocd-manager-role" created
INFO[0000] ClusterRoleBinding "argocd-manager-role-binding" created
FATA[0001] rpc error: code = Unknown desc = Get "https://127.0.0.1:32768/version?timeout=32s": dial tcp 127.0.0.1:32768 connect: connection refused
- argocd cluster add <k3d cluster running in local> also fails. The error message is the same.
Expected behavior
Add cluster succeeds.
Version
argocd: v1.7.1+da5fa74
BuildDate: 2020-08-26T21:13:01Z
GitCommit: da5fa74ca1bf9e025dcfe3c8cac083da1b7b45c8
GitTreeState: clean
GoVersion: go1.14.1
Compiler: gc
Platform: darwin/amd64
argocd-server: v1.7.2+c342d3f
BuildDate: 2020-08-27T23:34:52Z
GitCommit: c342d3fc9c9c9f0d1c18254b6ffa1e106984a76c
GitTreeState: clean
GoVersion: go1.14.1
Compiler: gc
Platform: linux/amd64
Ksonnet Version: v0.13.1
Kustomize Version: {Version:kustomize/v3.6.1 GitCommit:c97fa946d576eb6ed559f17f2ac43b3b5a8d5dbd BuildDate:2020-05-27T20:47:35Z GoOs:linux GoArch:amd64}
Helm Version: version.BuildInfo{Version:"v3.2.0", GitCommit:"e11b7ce3b12db2941e90399e874513fbd24bcb71", GitTreeState:"clean", GoVersion:"go1.13.10"}
Kubectl Version: v1.17.8
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18 (3 by maintainers)
Workaround for kind, might work for other single node k8s solutions:
Find the entry belonging to the cluster in your
.kube/config
, and change theserver
entry:Verify that
kubectl get pods
is still working, then tryargocd cluster add
.You can also use the
--in-cluster
flagEDIT: the above doesn’t work when it comes to deploying but allows the cluster to be added 😃
Kind does have the
kind get kubeconfig --internal --name <cluster name>
command.This works great with minikube. Thanks!
Hi,
cluster add
takes cluster API information from your K8s client configuration. Most likely, this is set to localhost. The error message you see comes from theargocd-server
pod, who obviously cannot connect to any K8s API at127.0.0.1:32768
.To solve this, modify the context in your
~/.kube/config
to point to an IP reachable from within your Docker desktop K8s (and possibly reconfigure your K3s or minikube API server to listen not only on localhost.Also worked with kind cluster
for those who are experiencing the issue while running kind clusters on mac, I have created this repository: https://github.com/akram/docker-argo-oc-kind
It builds an image with docker, argo and kubectl, and it documents how to change the ~/.kube/config to make clusters addable to argo
I have tried to above work around, but none is working for me Executing on local cluster
argocd cluster add kind-dev-cluster --insecure
Errorwe are able to connect
https://127.0.0.1:62826/version?timeout=32s
as this is not authenticate, here is the argocd server errorHowever API server require authentication, and give this error while unauthenticated connection