Skip to content

Commit

Permalink
fix: remove Egress NetworkPolicy for argocd-redis and argocd-redis-ha…
Browse files Browse the repository at this point in the history
…-haproxy - 2.9

Signed-off-by: pashakostohrys <pavel@codefresh.io>
  • Loading branch information
pasha-codefresh committed May 23, 2024
1 parent 423ad6b commit 929373d
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 76 deletions.
53 changes: 53 additions & 0 deletions docs/operator-manual/upgrading/2.8-2.9.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,56 @@
## Upgraded Kustomize Version

Note that bundled Kustomize version has been upgraded from 5.1.0 to 5.2.1.

## Egress NetworkPolicy for `argocd-redis` and `argocd-redis-ha-haproxy`

Starting with Argo CD 2.9.16, the NetworkPolicy for the `argocd-redis` and `argocd-redis-ha-haproxy` dropped Egress restrictions. This change was made
to allow access to the Kubernetes API to create a secret to secure Redis access.

To retain similar networking restrictions as before 2.9.16, you can add an Egress rule to allow access only to the
Kubernetes API and access needed by Redis itself. The Egress rule for Kubernetes access will depend entirely on your
Kubernetes setup. The access for Redis itself can be allowed by adding the following to the
`argocd-redis-network-policy` NetworkPolicy:

```diff
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: argocd-redis-network-policy
spec:
policyTypes:
- Ingress
+ - Egress
+ egress:
+ - ports:
+ - port: 53
+ protocol: UDP
+ - port: 53
+ protocol: TCP
```

```diff
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: argocd-redis-ha-haproxy
spec:
policyTypes:
- Ingress
+ - Egress
+ egress:
+ - ports:
+ - port: 6379
+ protocol: TCP
+ - port: 26379
+ protocol: TCP
+ to:
+ - podSelector:
+ matchLabels:
+ app.kubernetes.io/name: argocd-redis-ha
+ - ports:
+ - port: 53
+ protocol: UDP
+ - port: 53
+ protocol: TCP
```
7 changes: 0 additions & 7 deletions manifests/base/redis/argocd-redis-network-policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ spec:
app.kubernetes.io/name: argocd-redis
policyTypes:
- Ingress
- Egress
ingress:
- from:
- podSelector:
Expand All @@ -23,9 +22,3 @@ spec:
ports:
- protocol: TCP
port: 6379
egress:
- ports:
- port: 53
protocol: UDP
- port: 53
protocol: TCP
7 changes: 0 additions & 7 deletions manifests/core-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21477,12 +21477,6 @@ kind: NetworkPolicy
metadata:
name: argocd-redis-network-policy
spec:
egress:
- ports:
- port: 53
protocol: UDP
- port: 53
protocol: TCP
ingress:
- from:
- podSelector:
Expand All @@ -21502,7 +21496,6 @@ spec:
app.kubernetes.io/name: argocd-redis
policyTypes:
- Ingress
- Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ spec:
app.kubernetes.io/name: argocd-redis-ha-haproxy
policyTypes:
- Ingress
- Egress
ingress:
- from:
- podSelector:
Expand All @@ -25,18 +24,4 @@ spec:
protocol: TCP
- port: 26379
protocol: TCP
egress:
- to:
- podSelector:
matchLabels:
app.kubernetes.io/name: argocd-redis-ha
ports:
- port: 6379
protocol: TCP
- port: 26379
protocol: TCP
- ports:
- port: 53
protocol: UDP
- port: 53
protocol: TCP

16 changes: 0 additions & 16 deletions manifests/ha/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23544,21 +23544,6 @@ kind: NetworkPolicy
metadata:
name: argocd-redis-ha-proxy-network-policy
spec:
egress:
- ports:
- port: 6379
protocol: TCP
- port: 26379
protocol: TCP
to:
- podSelector:
matchLabels:
app.kubernetes.io/name: argocd-redis-ha
- ports:
- port: 53
protocol: UDP
- port: 53
protocol: TCP
ingress:
- from:
- podSelector:
Expand All @@ -23580,7 +23565,6 @@ spec:
app.kubernetes.io/name: argocd-redis-ha-haproxy
policyTypes:
- Ingress
- Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
Expand Down
16 changes: 0 additions & 16 deletions manifests/ha/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3205,21 +3205,6 @@ kind: NetworkPolicy
metadata:
name: argocd-redis-ha-proxy-network-policy
spec:
egress:
- ports:
- port: 6379
protocol: TCP
- port: 26379
protocol: TCP
to:
- podSelector:
matchLabels:
app.kubernetes.io/name: argocd-redis-ha
- ports:
- port: 53
protocol: UDP
- port: 53
protocol: TCP
ingress:
- from:
- podSelector:
Expand All @@ -3241,7 +3226,6 @@ spec:
app.kubernetes.io/name: argocd-redis-ha-haproxy
policyTypes:
- Ingress
- Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
Expand Down
7 changes: 0 additions & 7 deletions manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22382,12 +22382,6 @@ kind: NetworkPolicy
metadata:
name: argocd-redis-network-policy
spec:
egress:
- ports:
- port: 53
protocol: UDP
- port: 53
protocol: TCP
ingress:
- from:
- podSelector:
Expand All @@ -22407,7 +22401,6 @@ spec:
app.kubernetes.io/name: argocd-redis
policyTypes:
- Ingress
- Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
Expand Down
7 changes: 0 additions & 7 deletions manifests/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2043,12 +2043,6 @@ kind: NetworkPolicy
metadata:
name: argocd-redis-network-policy
spec:
egress:
- ports:
- port: 53
protocol: UDP
- port: 53
protocol: TCP
ingress:
- from:
- podSelector:
Expand All @@ -2068,7 +2062,6 @@ spec:
app.kubernetes.io/name: argocd-redis
policyTypes:
- Ingress
- Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
Expand Down

0 comments on commit 929373d

Please sign in to comment.