-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VpcCniAddOn - enable supports of Kubernetes Network Policies with enableNetworkPolicy after Amazon VPC CNI version 1.14.0 #850 #851
Conversation
Running cdk diff with this changes produces this diff: And when cdk deploy is done VPC-CNI is run with enabled Network policy. How to check: kubectl get pods -n kube-system | grep 'aws-node\|amazon' An example output is as follows. aws-node-gmqp7 2/2 Running 1 (1h ago) 1h
aws-node-prnsh 2/2 Running 1 (1h ago) 1h If network policy is enabled, there are 2 containers in the aws-node pods. In previous versions and if network policy is disabled, there is only a single container in the aws-node pods. More info here: https://docs.aws.amazon.com/eks/latest/userguide/cni-network-policy.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @shapirov103 Please review and run e2e
e0a42f8
to
58e7add
Compare
fix fix fix
b96bb59
to
1549361
Compare
@shapirov103 please check this MR when you have time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bnaydenov awesome work. Please my comment, it is mostly release process related and docs.
@@ -292,7 +299,7 @@ export interface CustomNetworkingConfig { | |||
|
|||
const defaultProps: CoreAddOnProps = { | |||
addOnName: 'vpc-cni', | |||
version: 'v1.13.4-eksbuild.1', | |||
version: 'v1.14.1-eksbuild.1', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on https://docs.aws.amazon.com/eks/latest/userguide/managing-vpc-cni.html the version should be v1.15.0-eksbuild.2
, however incremental update is needed.
It looks like the network policy will not be available with this version, is that correct? If so, can we add a check to fail if version is less than 1.15 so that we don't get questions from the customers on why my network policy does not work?
The error should state that customers should apply incremental update and use network policy starting from 1.15.
I will need to include it in the release notes, so if you can update the PR desc with these instructions as well that would help.
@shapirov103 Network policy is available on Amazon VPC CNI version 1.14.0 or a later version. I am setting here as default current latest version for major version
And you have to make 2 steps update, first to Step 1 const addOns: Array<blueprints.ClusterAddOn> = [
new blueprints.addons.VpcCniAddOn({ enableNetworkPolicy: 'true', version: 'v1.14.1-eksbuild.1' })
]; cdk deploy Step 2 const addOns: Array<blueprints.ClusterAddOn> = [
new blueprints.addons.VpcCniAddOn({ enableNetworkPolicy: 'true', version: 'v1.15.0-eksbuild.2' })
]; cdk deploy @shapirov103 Tell me what you think about this? Should we set default to |
@bnaydenov if 14.1 works with network policy, then I agree with your decision to use 1.14 at the moment to avoid inadvertent deployment failures in customers (and AWS SDE internal) environments due to the version skip. Let's release with 1.14 and mention 1.15 in the docs so that they can upgrade in a two step process. I will upgrade the blueprints to use 1.15 in the next minor release. |
ok let's go with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor comment
lib/addons/vpc-cni/index.ts
Outdated
* More informaton on official AWS documentation: https://docs.aws.amazon.com/eks/latest/userguide/cni-network-policy.html | ||
* | ||
*/ | ||
enableNetworkPolicy?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment: why is it a string? Let's make it a boolean, then it is clear and we don't have to handle cases like "FALSE" vs "false".
it must be a Check here JSON schema . "enableNetworkPolicy": {
"format": "boolean",
"type": "string"
}, You can get it with this command: aws eks describe-addon-configuration --addon-name vpc-cni --addon-version v1.15.0-eksbuild.2 --query configurationSchema --output text |
@bnaydenov in the addon it should be a boolean as this is the best experience for the customer. Please check the rest of the properties in the You can apply |
@shapirov103 check my latest commit. now |
@shapirov103 any more comments or concerns? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/do-e2e-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
end to end tests passed
Issue #850 :
Description of changes:
Introduce enableNetworkPolicy parameter and when is set to 'true' enable Network policy with AWS VPC-CNI plugin.
For example:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.