calico: network policy add OR option to selector

9/18/2019

as part of Calico Global network policy i can use the selector. in the selector definition i cant find the "OR" option, if i would like to enable the same option to A OR B , how can i define it with one rule only? https://docs.projectcalico.org/v3.9/reference/resources/globalnetworkpolicy#selector

apiVersion: projectcalico.org/v3
kind: GlobalNetworkPolicy
metadata:
  name: allow-tcp-6379
spec:
  selector: role == 'database'

i would like to be able to create the following:

 {
                   "action": "Allow",
                   "source": {
                       "selector": "key == 'value' || key1 == 'value1' "
                   }
   } 
-- inza
kubernetes-networkpolicy
project-calico

0 Answers