crossplane-contrib / provider-argocd

Crossplane provider to provision and manage Argo CD objects
Apache License 2.0
68 stars 35 forks source link

Provider is failed to connect to argocd server #157

Closed zahodi closed 4 months ago

zahodi commented 5 months ago

What happened?

argocd-provider pod is failing to connect to argocd

time="2024-04-03T18:12:28Z" level=fatal msg="Failed to establish connection to argocd-server.argocd.svc:443: read tcp 100.64.78.83:49608->172.20.75.34:443: read: connection reset by peer"

How can we reproduce it?

A test curl in another pod is able to get to argocd api:

curl -X GET argocd-server.argocd.svc:443/api/version -H "Authorization: Bearer $ARGOCD_TOKEN"
{"Version":"v2.10.5+335875d","BuildDate":"2024-03-28T15:02:45Z","GitCommit":"335875d13e018bed6e03873f4742582582964745","GitTreeState":"clean","GoVersion":"go1.21.3","Compiler":"gc","Platform":"linux/amd64","KustomizeVersion":"v5.2.1 2023-10-19T20:13:51Z","HelmVersion":"v3.14.3+gf03cc04","KubectlVersion":"v0.26.11","JsonnetVersion":"v0.20.0"}

Provider config:

apiVersion: argocd.crossplane.io/v1alpha1
kind: ProviderConfig
metadata:
  name: argocd-provider
spec:
  credentials:
    secretRef:
      key: authToken
      name: argocd-credentials
      namespace: crossplane-system
    source: Secret
  insecure: true
  plainText: false
  serverAddr: argocd-server.argocd.svc:443

Provider:

apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
  name: provider-argocd
spec:
  ignoreCrossplaneConstraints: false
  package: xpkg.upbound.io/crossplane-contrib/provider-argocd:v0.6.0
  packagePullPolicy: IfNotPresent
  revisionActivationPolicy: Automatic
  revisionHistoryLimit: 1
  runtimeConfigRef:
    apiVersion: pkg.crossplane.io/v1beta1
    kind: DeploymentRuntimeConfig
    name: default
  skipDependencyResolution: false

What environment did it happen in?

Crossplane version: 1.15.1 Crossplane Provider argocd version: 0.6.0 EKS: 1.24 ArgoCD: v2.10.5+335875d

MisterMX commented 4 months ago

That looks like a network misconfiguration to me. Have you checked that the you can connect to ArgoCD from the same pod as the provider?

zahodi commented 4 months ago

This fix here was to set plainText to true