vSphere with Tanzu on NSX-T: Part 10 – Network Policies

vSphere with Tanzu on NSX-T: Part 10 – Network Policies

This is part 10 of a series of videos discussing vSphere with Tanzu on NSX-T where I will demonstrate how to configure and operate vSphere with Tanzu on NSX-T. In this video we look at the creation of Network Policies and we’ll look at how this results in Distributed Firewall rules automatically being configured in NSX-T.

nginx-network-policy.yaml

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: nginx-network-policy
spec:
  podSelector:
    matchLabels:
      app: nginx
  policyTypes:
  - Ingress
  - Egress
  ingress:
  # - ports:
  #   - protocol: TCP
  #     port: 80
  #   - protocol: TCP
  #     port: 443
  - from:
    - ipBlock: 
        cidr: 192.168.10.0/24
    - ipBlock: 
        cidr: 10.29.12.192/27
    ports: 
    - protocol: TCP
      port: 80
  egress:
  - ports:
    - protocol: TCP
      port: 8443

There is 1 comment. Add yours.

Leave a Reply

Your email address will not be published. Required fields are marked *