Skip to content

Add support for wellKnownPolicies when defining addons #4158

@aclevername

Description

@aclevername

What feature/behavior/change do you want?
When creating an IAMSerivceAccount you can reference wellKnownPolicies, e.g.:

iam:
  withOIDC: true
  serviceAccounts:
  - metadata:
      name: aws-load-balancer-controller
      namespace: kube-system
    wellKnownPolicies:
      awsLoadBalancerController: true

but you can't do this for addons, depsite it creating an equiavlent IAMServiceAccount under the hood.

Example

The following config file:

addons:
- name: some-new-addon
  wellKnownPolicies:
    awsLoadBalancerController: true

Should result in the policies for awsLoadBalancerController getting added to the addons IAMServiceAccount. It should be equivalent to:

addons:
- name: some-new-addon
  attachPolicy: # inline policy can be defined along with `attachPolicyARNs`
    Version: "2012-10-17"
    Statement:
    - Effect: Allow
      Action:
      - "awsLoadBalancerController-actions"
      ...
      Resource: '*'
      ....

Why do you want this feature?
As more addons get introduced some of the existing wellKnownPolicies will be applicable, being able to use this is convienant

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions