Skip to content
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

Auth doc: update IRSA example with DeploymentRuntimeConfig #1321

Merged
merged 2 commits into from
May 23, 2024

Conversation

ytsarev
Copy link
Collaborator

@ytsarev ytsarev commented May 23, 2024

Description of your changes

  • Replace deprecate ControllerConfig-based example with DeploymentRuntimeConfig instructions to set IRSA annotation on Provider ServiceAccount
  • Occasional whitespace busting

I have:

  • Read and followed Crossplane's [contribution process].
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

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

* Replace deprecate `ControllerConfig`-based example with
  `DeploymentRuntimeConfig` instructions to set IRSA annotation on
  Provider ServiceAccount
* Occasional whitespace busting

Signed-off-by: Yury Tsarev <yury@upbound.io>
Signed-off-by: Yury Tsarev <yury@upbound.io>
@ytsarev ytsarev merged commit 13c3eba into crossplane-contrib:main May 23, 2024
11 checks passed
@ytsarev ytsarev deleted the drc-to-auth-doc branch May 23, 2024 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants