Skip to content

Commit

Permalink
adding external-dns policy support
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Hein <me@christopherhein.com>
  • Loading branch information
christopherhein committed Dec 17, 2018
1 parent 66a7888 commit 1c4d0bc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkg/cfn/builder/iam.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,19 @@ func (n *NodeGroupResourceSet) addResourcesForIAM() {
)
}

if n.clusterSpec.Addons.WithIAM.PolicyExternalDNS {
n.rs.attachAllowPolicy("PolicyExternalDNSChangeSet", refIR, "arn:aws:route53:::hostedzone/*",
[]string{
"route53:ChangeResourceRecordSets",
},
)
n.rs.attachAllowPolicy("PolicyExternalDNSHostedZones", refIR, "*",
[]string{
"route53:ListHostedZones",
"route53:ListResourceRecordSets",
},
)
}

n.rs.newOutputFromAtt(cfnOutputInstanceRoleARN, "NodeInstanceRole.Arn", true)
}
1 change: 1 addition & 0 deletions pkg/ctl/create/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func createClusterCmd(g *cmdutils.Grouping) *cobra.Command {

group.InFlagSet("Cluster add-ons", func(fs *pflag.FlagSet) {
fs.BoolVar(&cfg.Addons.WithIAM.PolicyAutoScaling, "asg-access", false, "enable iam policy dependency for cluster-autoscaler")
fs.BoolVar(&cfg.Addons.WithIAM.PolicyExternalDNS, "external-dns-access", false, "enable iam policy dependency for external-dns")
fs.BoolVar(&cfg.Addons.WithIAM.PolicyAmazonEC2ContainerRegistryPowerUser, "full-ecr-access", false, "enable full access to ECR")
fs.BoolVar(&cfg.Addons.Storage, "storage-class", true, "if true (default) then a default StorageClass of type gp2 provisioned by EBS will be created")
})
Expand Down
1 change: 1 addition & 0 deletions pkg/eks/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,5 +193,6 @@ type (
AddonIAM struct {
PolicyAmazonEC2ContainerRegistryPowerUser bool
PolicyAutoScaling bool
PolicyExternalDNS bool
}
)

0 comments on commit 1c4d0bc

Please sign in to comment.