I have two network policies (one with pod selector app=db and the other with app=proxy) and I have one pod to apply both network policies, the pod config doesn't allow to have 2 different labels with the same key app.
How can I do it in this case without modifying any network policies?
If the pod/label/app selector is the only selector in each policy then it's not possible. The net policy probably needs a matchExpressions
selector then a new label.
Ingress and Egress rules can supply an array of podSelector
s for the network targets, or similar matchExpressions
spec:
podSelector:
matchExpressions:
- key: role
operator: In
values: [ "db-proxy", "db" ]