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 support for well known policies with IRSA #3045
Merged
michaelbeaumont
merged 9 commits into
eksctl-io:master
from
michaelbeaumont:irsa_addon_policies
Jan 28, 2021
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
30a5983
Add support for well known policies with IRSA
michaelbeaumont 0347704
Don't skip policies
michaelbeaumont fa4f8f6
Simplify statements for well known and addon IAM policies
michaelbeaumont 7cd2224
Add test that wellKnownPolicies are respected
michaelbeaumont a0e0b0e
Improve docs for wellKnownPolicies
michaelbeaumont ac7bc9d
Simplify irsa well known policy code
michaelbeaumont d364084
Merge branch 'master' into irsa_addon_policies
michaelbeaumont bc5daf0
Merge remote-tracking branch 'upstream/master' into irsa_addon_policies
michaelbeaumont 5260127
Merge branch 'master' into irsa_addon_policies
michaelbeaumont File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package v1alpha5 | ||
|
||
// WellKnownPolicies for attaching common IAM policies | ||
type WellKnownPolicies struct { | ||
// ImageBuilder allows for full ECR (Elastic Container Registry) access. | ||
ImageBuilder bool `json:"imageBuilder,inline"` | ||
// AutoScaler adds policies for cluster-autoscaler. See [autoscaler AWS | ||
// docs](https://docs.aws.amazon.com/eks/latest/userguide/cluster-autoscaler.html). | ||
AutoScaler bool `json:"autoScaler,inline"` | ||
// AWSLoadBalancerController adds policies for using the | ||
// aws-load-balancer-controller. See [Load Balancer | ||
// docs](https://docs.aws.amazon.com/eks/latest/userguide/aws-load-balancer-controller.html). | ||
AWSLoadBalancerController bool `json:"awsLoadBalancerController,inline"` | ||
// ExternalDNS adds external-dns policies for Amazon Route 53. | ||
// See [external-dns | ||
// docs](https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/aws.md). | ||
ExternalDNS bool `json:"externalDNS,inline"` | ||
// CertManager adds cert-manager policies. See [cert-manager | ||
// docs](https://cert-manager.io/docs/configuration/acme/dns01/route53). | ||
CertManager bool `json:"certManager,inline"` | ||
} | ||
|
||
func (p *WellKnownPolicies) HasPolicy() bool { | ||
return p.ImageBuilder || p.AutoScaler || p.AWSLoadBalancerController || p.ExternalDNS || p.CertManager | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
would
attachWellKnownPolicies
be better? I'm still open forWellKnownPolicies
to change, but I think havingattach
prefixed helps to describe the intentThere 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 think it's a little odd that this is would be a verb, when the general idea of declarative config suggests using nouns instead, to describe the resulting state, not how you get there.
attachedWellKnownPolicies
perhaps, but that's pretty verbose, and only subtly different, so likely to lead to muscle-memory mistakes.I think the various uses of
attach
in eksctl config stand out as verbs in a sea of nouns, but I guess usingattach
specifically is consistent here, e.g., we also havesecurityGroups.attachIDs
, notsecurityGroups.attachedIDs
.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.
Yes, I was trying to avoid a verb but maybe
withWellKnownPolicies
?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.
Would I be at risk of ruining everything by saying I am not a fan of
WellKnown
?withCommonPolicies
?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.
the one problem with "common" is that it has two meanings, one "well known", the other "shared"...
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.
yeh that's totally right.
withNamedPolicies
? although I suppose all policies have names.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.
Struggling to find a better alternative to
WellKnownPolicies
so I'm happy to stick with that. I'm still unsure aboutwith
vsattach
. I know that using the wordattach
isn't technically correct, but IMO its worth using it to remain consistent with the other fields.