Sitemap

How to Enable NetworkPolicy in AWS EKS?

3 min readSep 27, 2023

--

AWS VPC CNI NetworkPolicy support has been available for a while.

I will demonstrate how to activate the NetworkPolicy plugin in an EKS cluster.

Press enter or click to view image in full size
Photo by JJ Ying on Unsplash

You may activate VPC CNI with the following command:

eksctl create addon --name vpc-cni --version v1.15.0-eksbuild.2 --cluster YOUR_CLUSTER_NAME --service-account-role-arn arn:aws:iam::account:role/AmazonEKSCNIAccess --force

You may not be able to activate VPC CNI without the — forceargument.

You may enable VPC CNI through the AWS Management Console:

On your EKS Console, click add-ons:

Press enter or click to view image in full size

Click more add-ons:

Press enter or click to view image in full size

Select Amazon VPC CNI:

Press enter or click to view image in full size

Click next. Then select the latest version:

Press enter or click to view image in full size

Click next. Review your configuration:

Press enter or click to view image in full size

Click create. You may see the progress in the Add-ons tab

Press enter or click to view image in full size

It is enabled:

Press enter or click to view image in full size

Open the Amazon VPC CNI’s configuration:

Press enter or click to view image in full size

Expand the “Optional configuration settings”:

Press enter or click to view image in full size

Update the configuration values with a JSON value:

Press enter or click to view image in full size

Here’s the configuration value:

{"enableNetworkPolicy": "true"}

Then, click “Save changes”

In the vpc-cni add-on page, you may see the progress:

Press enter or click to view image in full size

Enjoy your Network Policies in your EKS Cluster:

Press enter or click to view image in full size

--

--