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

feat(in-cluster): update example to use native crossplane way #190

Merged

Conversation

haarchri
Copy link
Member

@haarchri haarchri commented Feb 2, 2024

Description of your changes

use crossplane native way to grant a static service account the needed cluster-admin rights

Fixes #

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

examples/provider/provider-in-cluster.yaml Outdated Show resolved Hide resolved
examples/provider/config-in-cluster.yaml Outdated Show resolved Hide resolved
@@ -0,0 +1,33 @@
---
apiVersion: pkg.crossplane.io/v1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make more sense/be easier to read if the resources are listed in the order that they need to be created? I know reconciliation will resolve ordering issues, but it might be more readable if it starts with ServiceAccount then ClusterRoleBinding then DeploymentRuntimeConfig and then Provider.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split the File only for ordered creation - can add it in one file with an comment

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to create the ServiceAccount - RuntimeConfig will create the ServiceAccount for you

name: provider-kubernetes-cluster-admin
subjects:
- kind: ServiceAccount
name: provider-kubernetes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The referenced Service Account is not created by this example - does it need to be for completeness?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RuntimeConfig will create the ServiceAccount for you

Copy link
Collaborator

@turkenh turkenh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looking good to me!

@turkenh turkenh merged commit f071360 into crossplane-contrib:main Feb 8, 2024
7 checks passed
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.

4 participants