76 lines
1.5 KiB
YAML
76 lines
1.5 KiB
YAML
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: dragonfly
|
|
namespace: memelord-raiko
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app: memelord-raiko-redis
|
|
app.kubernetes.io/name: dragonfly
|
|
policyTypes:
|
|
- Ingress
|
|
ingress:
|
|
- from:
|
|
- podSelector:
|
|
matchLabels:
|
|
app: memelord
|
|
ports:
|
|
- protocol: TCP
|
|
port: 6379
|
|
- from: # Dragonfly replication
|
|
- podSelector:
|
|
matchLabels:
|
|
app: memelord-raiko-redis
|
|
app.kubernetes.io/name: dragonfly
|
|
ports:
|
|
- protocol: TCP
|
|
port: 9999
|
|
---
|
|
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:
|
|
- from:
|
|
- podSelector:
|
|
matchLabels:
|
|
app: memelord
|
|
- podSelector: # Primary-secondary replication!
|
|
matchLabels:
|
|
cnpg.io/cluster: memelord-raiko-database
|
|
ports:
|
|
- protocol: TCP
|
|
port: 5432
|
|
- ports: # Probes do work now!
|
|
- protocol: TCP
|
|
port: 8000
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: memelord
|
|
namespace: memelord-raiko
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app: memelord
|
|
policyTypes:
|
|
- Ingress
|
|
ingress:
|
|
- from:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: traefik
|
|
ports:
|
|
- protocol: TCP
|
|
port: 8000
|