-
Notifications
You must be signed in to change notification settings - Fork 67
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
Attach Agent Pool network security group to karpenter node nics.. #610
base: main
Are you sure you want to change the base?
Conversation
@johnthompson-ybor please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
@@ -128,7 +128,7 @@ func (o *Options) Parse(fs *coreoptions.FlagSet, args ...string) error { | |||
} | |||
|
|||
// ClusterID is generated from cluster endpoint | |||
o.ClusterID = getAKSClusterID(o.GetAPIServerName()) | |||
o.ClusterID = getAKSClusterID(o.ClusterName) |
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.
how does this work? This changes the GetAPIServerName to use ClusterName, is that the same for private + public cluster? I thought CLUSTER_ENDPOINT will change depending on the cluster type, havent dug super deep into this option though.That is required by me for thorough review.
How is clusterID used in our codebase? Is there wider usage in our bootstrapping configuration?
LaunchTemplate: launchTemplate, | ||
BackendPools: backendPools, | ||
InstanceType: instanceType, | ||
NetworkSecurityGroupID: fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkSecurityGroups/aks-agentpool-%s-nsg", p.subscriptionID, p.resourceGroup, options.FromContext(ctx).ClusterID), |
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.
should we pull ClusterID into NicCreateOptions?
I think a better way to solve this is to make an azure api call to find the default network security group. |
@microsoft-github-policy-service agree company="Ybor AI" |
Fixes #
Description
Your logic for determining the cluster id seems to be wrong, and through experimentation it seems like it was just based on the name of the cluster. In addition, while you add some code to generate the name of the agent pool security group, you didn't actually attach it anywhere. I added the code to attach the security group to the NIC.
How was this change tested?
I tested it on one of my clusters, you should probably do some more thorough testing.
Does this change impact docs?
Release Note