crossplane-contrib / provider-upjet-aws

Official AWS Provider for Crossplane by Upbound.
https://marketplace.upbound.io/providers/upbound/provider-aws
Apache License 2.0
137 stars 112 forks source link

Auth doc: update IRSA example with `DeploymentRuntimeConfig` #1321

Closed ytsarev closed 1 month ago

ytsarev commented 1 month ago

Description of your changes

I have:

How has this code been tested

By applying documented manifests and checking that the annotation was propagated to the provider serviceaccount

k get -f examples/deploymentruntimeconfigs/irsa-drc.yaml  -o yaml
apiVersion: pkg.crossplane.io/v1beta1
kind: DeploymentRuntimeConfig
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"pkg.crossplane.io/v1beta1","kind":"DeploymentRuntimeConfig","metadata":{"annotations":{},"name":"irsa-drc"},"spec":{"serviceAccountTemplate":{"metadata":{"annotations":{"eks.amazonaws.com/role-arn":"arn:aws:iam::111122223333:role/iam-role-name"}}}}}
  creationTimestamp: "2024-05-23T11:24:57Z"
  generation: 1
  name: irsa-drc
  resourceVersion: "22282"
  uid: c4b56d1c-c7e7-4f91-af3a-31a26b859614
spec:
  serviceAccountTemplate:
    metadata:
      annotations:
        eks.amazonaws.com/role-arn: arn:aws:iam::111122223333:role/iam-role-name

k get providers upbound-provider-aws-ec2 -oyaml|k neat
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
  name: upbound-provider-aws-ec2
spec:
  ignoreCrossplaneConstraints: false
  package: xpkg.upbound.io/upbound/provider-aws-ec2:v1.4.0
  packagePullPolicy: IfNotPresent
  revisionActivationPolicy: Automatic
  revisionHistoryLimit: 1
  runtimeConfigRef:
    apiVersion: pkg.crossplane.io/v1beta1
    kind: DeploymentRuntimeConfig
    name: irsa-drc
  skipDependencyResolution: false

k -n upbound-system get sa |grep aws-ec2
upbound-provider-aws-ec2-b040c8e74c2d                          0         6m34s

k -n upbound-system get sa upbound-provider-aws-ec2-b040c8e74c2d -o yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  annotations:
    eks.amazonaws.com/role-arn: arn:aws:iam::111122223333:role/iam-role-name <--- Annotation is properly set
  creationTimestamp: "2024-05-23T11:25:44Z"
  name: upbound-provider-aws-ec2-b040c8e74c2d
  namespace: upbound-system
  ownerReferences:
  - apiVersion: pkg.crossplane.io/v1
    blockOwnerDeletion: true
    controller: true
    kind: ProviderRevision
    name: upbound-provider-aws-ec2-b040c8e74c2d
    uid: 55b24710-317b-4173-bd1a-9efc14fe2104
  resourceVersion: "22657"
  uid: bd3838aa-f589-4b84-949b-0eb7485960bf