kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
    name: db-ingress-allow
    namespace: test-webapp-backend
    selfLink: >-
        /apis/networking.k8s.io/v1/namespaces/test-webapp-backend/networkpolicies/db-ingress-allow
    uid: 68cabe6f-7ce2-4cc7-9131-09aca60d31c2
    resourceVersion: '140041924'
    generation: 1
    creationTimestamp: '2020-11-25T08:06:58Z'
    annotations:
        kubectl.kubernetes.io/last-applied-configuration: >
            {"apiVersion":"networking.k8s.io/v1","kind":"NetworkPolicy","metadata":{"annotations":{},"name":"db-ingress-allow","namespace":"test-webapp-backend"},"spec":{"ingress":[{"from":[{"podSelector":{"matchLabels":{"app":"backend"}}}],"ports":[{"port":3306,"protocol":"TCP"}]}],"podSelector":{"matchLabels":{"app":"db"}},"policyTypes":["Ingress"]}}
spec:
    podSelector:
        matchLabels:
            app: db
    ingress:
        -
            ports:
                -
                    protocol: TCP
                    port: 3306
            from:
                -
                    podSelector:
                        matchLabels:
                            app: backend
    policyTypes:
        - Ingress

