Internet access from Pod

sumer:
HI @Rahul Soni, Can i get little help on how to enable the internet connection/access to pod ?

Pavan Yadalla:
Expose the pod using nodePort

sumer:
Hi Pavan, POD is already exposed and accessible from outside. I m trying to run jenkins on pod but while trying to install the plugins, failed to connect internet

Rahul Soni:
Hey @sumer this can be done via network policy

For example you can configure np like this allow
apiVersion: http://networking.k8s.io/v1|networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: internet-access
spec:
podSelector:
matchLabels:
networking/allow-internet-access: “true”
policyTypes:

  • Ingress
    ingress:
    • - {}

Also you can define port protocol cidr to ne more precise

Rahul Soni:
You can make use of any labels this is just for your reference