-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add securityGroups field to IngressClassParams #3277
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: johngmyers The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I'm not entirely sure of the naming of the |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #3277 +/- ##
==========================================
+ Coverage 54.70% 55.50% +0.80%
==========================================
Files 148 149 +1
Lines 8590 8952 +362
==========================================
+ Hits 4699 4969 +270
- Misses 3559 3644 +85
- Partials 332 339 +7
☔ View full report in Codecov by Sentry. |
/retest |
4 similar comments
/retest |
/retest |
/retest |
/retest |
Exactly one of this, `managedInbound`, or `tags` must be specified. | ||
items: | ||
description: SecurityGroupID specifies a security group ID. | ||
pattern: sg-[0-9a-f]+ |
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.
Can it also accept SG names just to keep consistent with the alb.ingress.kubernetes.io/security-groups
annotation
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.
No, the field should be strongly typed. If you want to search by the Name
tag, use the tags
field using a tag key of Name
.
Using the spec field of a resource, one can specify precise semantics using structured data. Resources should not use the loosey-goosey semantics that the lack of structure in annotations tend to lead to.
return allErrs | ||
} | ||
if securityGroups.Tags != nil { | ||
allErrs = append(allErrs, field.Forbidden(fieldPath.Child("tags"), "may not have both `ids` and `tags` set")) |
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.
I'm just wondering why would the ids
and tags
be exclusive? Let's say if a user specifies both (for fine-grained filtering purpose, or just by accident), can we just filter the SG by both field instead of error out?
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.
What is the use case for specifying both ids and tags? An admin would typically have one way of communicating security groups from the IaC provisioning system to the deploy-to-Kubernetes system. Either they'd propagate a list of IDs or they'd provision the groups with tags according to some convention. Why would someone use one mechanism for some groups and another mechanism for others?
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.
I don't see much point in having both. If you have id, there isn't much value in having the name (e.g. for the sake of documentation one can always put this information in comments or in some non-actionable annotation). Allowing both means you either have to make one take precedence when these don't agree; or still fail at runtime - but this is way more complicated to explain what's wrong (e.g. the message would have to read something like "sg-123 has name 'name-1', but the annotation specified 'name-2' - you have to either only use name/id; or if both are used - they should point to the same entity" - but having such a reasonable message is somewhat a security concern because you can now map security-group-id to a name which might have sensitive info)
At the same time clearly having a behavior to fail when both are specified allows using things like admission controllers to explicitly fail when resource are provisioned, rather than at runtime, so you can't even deploy incorrectly configured ingress.
bbd806c
to
a806430
Compare
/retest |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Issue
#2920
Competes with #2919.
Description
Adds a
securityGroups
field toIngressClassParams
, to allow overriding thealb.ingress.kubernetes.io/security-groups
andalb.ingress.kubernetes.io/manage-backend-security-group-rules
annotations for all Ingresses in an IngressClass.Checklist
README.md
, or thedocs
directory)BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯