NetworkPolicy
This commit is contained in:
@@ -3,88 +3,62 @@ apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: dragonfly
|
||||
namespace: memelord-raiko
|
||||
namespace: memelord-laurivosandi
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: memelord-raiko-redis
|
||||
app: memelord-laurivosandi-redis
|
||||
app.kubernetes.io/name: dragonfly
|
||||
policyTypes:
|
||||
- Ingress
|
||||
ingress:
|
||||
# App -> Redis
|
||||
- from:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app: memelord-raiko
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 6379
|
||||
|
||||
# Prom -> Redis
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: monitoring
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 6379
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: postgres
|
||||
namespace: memelord-raiko
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
cnpg.io/cluster: memelord-raiko-database
|
||||
policyTypes:
|
||||
- Ingress
|
||||
ingress:
|
||||
# App -> Postgres SQL
|
||||
- from:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app: memelord
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 5432
|
||||
|
||||
# Primary-secondary replication (jääb alles)
|
||||
port: 6379
|
||||
- from: # Dragonfly replication
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
app: memelord-laurivosandi-redis
|
||||
app.kubernetes.io/name: dragonfly
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 9999
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: postgres
|
||||
namespace: memelord-laurivosandi
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
cnpg.io/cluster: memelord-laurivosandi-database
|
||||
policyTypes:
|
||||
- Ingress
|
||||
ingress:
|
||||
- from:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
cnpg.io/cluster: memelord-raiko-database
|
||||
app: memelord
|
||||
- podSelector: # Primary-secondary replication!
|
||||
matchLabels:
|
||||
cnpg.io/cluster: memelord-laurivosandi-database
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 5432
|
||||
|
||||
# CNPG operator/controller -> Postgres management/health (sinu log näitas port 8000)
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: cnpg-system
|
||||
ports:
|
||||
- ports: # Probes do work now!
|
||||
- protocol: TCP
|
||||
port: 8000
|
||||
|
||||
# Prometheus -> Postgres (vali õige port vastavalt exporterile/metricsile)
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: monitoring
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 5432
|
||||
# - protocol: TCP
|
||||
# port: 9187
|
||||
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: memelord
|
||||
namespace: memelord-raiko
|
||||
namespace: memelord-laurivosandi
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
@@ -99,5 +73,3 @@ spec:
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 8000
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user