pod in Kubernetes cluster is unable to connect to internet with egress networkpolicy

5/16/2020

I have deployed a vendor container in an on-prem Kubernetes cluster and the container in the pod needs to connect to internet to validate license and few other details. I have checked the environment and I don't see any existing network policies in the cluster and/or pod level. I then added below networkpolicy entry for the pod namespace but still seeing following error in pods and service log.

level=fatal msg="Unable to connect to the license server"

.

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
 name: allow-ingress-egress
 namespace: myappns
spec:
 podSelector:
 matchLabels: {}
 egress:
 - {}
 policyTypes:
 - Ingress
 - Egress
 ingress: 
 - {}
 egress: 
 - {}
-- cnu
kubernetes-pod

0 Answers