arlon icon indicating copy to clipboard operation
arlon copied to clipboard

[Bug] Arlon Controller Fails to Create Socket for ArgoCD gRPC Proxy Client

Open mattroark opened this issue 2 years ago • 0 comments

Describe the bug A gRPC proxy server is started by the ArgoCD API client if grpc-web-root-path is set in the configuration which is passed: https://github.com/argoproj/argo-cd/blob/master/pkg/apiclient/apiclient.go#L496-L498

e.g.

❯ cat ~/.config/argocd/config
contexts:
- name: example
  server: example.domain.tld
  user: [email protected]
current-context: example
servers:
- grpc-web-root-path: argocd
  server: example.domain.tld
...

The arlon-controller pod will transition into a CrashLoopBackOff once deployed as it tries to initialize the client, but, fails (due to a socket binding failure shown below). https://github.com/arlonproj/arlon/blob/58caaef5bf9e276e951fdc071b732df8eadd9a89/controllers/clusterregistration_controller.go#L112

❯ k get po
NAME                                READY   STATUS             RESTARTS   AGE
arlon-controller-75ccb8dc5d-gtvdg   0/1     CrashLoopBackOff   7          13m
❯ k logs arlon-controller-75ccb8dc5d-dt4t8
time="2022-09-21T16:56:39Z" level=fatal msg="Failed to establish connection to example.domain.tld:443: listen unix /tmp/argocd-mMgptNUtlpbVjcHJ.sock: bind: read-only file system"

The issue is due to the "read-only file system" as called out in the error. The securityContext will need to be modified to account for this edge-case.

Version Impacted: v0.9.9

To Reproduce

  1. argocd login example.domain.tld --sso --grpc-web-root-path argocd
  2. cp ${HOME}/.config/argocd/config /tmp/config
  3. kubectl -n arlon create secret generic argocd-creds --from-file /tmp/config
  4. kubectl apply -f deploy/manifests/deploy.yaml

Expected behavior The arlon-controller svc/pod would transition into a Ready state after successfully establishing a connection to ArgoCD.

mattroark avatar Sep 21 '22 19:09 mattroark