apiVersion: networking.k8s.io/v1 
kind: NetworkPolicy 
metadata: 
  name: specific-ip-policy 
spec: 
  podSelector: 
    matchLabels: 
      app: worker 
  policyTypes: 
  - Ingress 
  - Egress 
  ingress: 
  - from: 
    - ipBlock: 
        cidr: 157.10.0.0/16 
        except: 
        - 157.10.1.0/24 
  egress: 
  - to: 
    - ipBlock: 
        cidr: 157.10.0.0/16 
        except: 
        - 157.10.1.0/24 
