argoproj-labs / argocd-notifications

Notifications for Argo CD
https://argocd-notifications.readthedocs.io/
Apache License 2.0
494 stars 140 forks source link

argocd-notifications cannot reach argocd-repo-server because of NetworkPolicy #294

Open timoschwarzer opened 3 years ago

timoschwarzer commented 3 years ago

Summary

Argo CD Notifications cannot connect to argocd-repo-server because of the recently added NetworkPolicy resources in Argo CD.

Applying an additional policy fixes this problem:

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: argocd-repo-server-network-policy-argocd-notifications
spec:
  ingress:
  - from:
    - podSelector:
        matchLabels:
          app.kubernetes.io/name: argocd-notifications
    ports:
    - port: 8081
      protocol: TCP
  podSelector:
    matchLabels:
      app.kubernetes.io/name: argocd-repo-server
  policyTypes:
  - Ingress

This policy should probably be added to Argo CD Notifications. Alternatively, the Argo CD NetworkPolicy should include a selector for argocd-notifications.

Diagnostics

What Kubernetes provider are you using?

K3s 1.20.6+k3s1

What version of Argo CD and Argo CD Notifications are you running?


Message from the maintainers:

Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.

ichwahyudi commented 3 years ago

Hi @timoschwarzer,

Thanks for the solution! Works on me! :raised_hands:

In my case, I used this manifest -> https://raw.githubusercontent.com/argoproj-labs/argocd-notifications/v1.1.1/manifests/install.yaml. So the label is argocd-notifications-controller not argocd-notifications

Thank you,

AravindanSridhar commented 3 years ago

Hi, I am new to Open Source contribution and would like to create a fix for this issue. I have encountered it and solved it by adding additional Network Policy. How do I contribute to this issue? Can someone please point me in the right direction in terms of the procedure. (So far what I know is to fork this repo and raise PR, but not sure how to link to this issue or the exact procedure.) @timoschwarzer @ichwahyudi

sergeyshevch commented 3 years ago

@AravindanSridhar You can just mention this issue in your PR with # symbol. For this issue it will be #294