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

Upgrade project to kubebuilder v3 #46

Merged
merged 1 commit into from Mar 16, 2023
Merged

Upgrade project to kubebuilder v3 #46

merged 1 commit into from Mar 16, 2023

Conversation

soellman
Copy link
Contributor

@soellman soellman commented Aug 20, 2021

Updates to kubebuilder 3.1.0.

kubebuilder 3.1.0 was used to create a new repo, made changes the new repo, and then merged back into the existing repo. Any non-cosmetic changes were performed to prefer the standard scaffolding in v3.

One change of note: the k8s service account used is now autoneg-system:autoneg-controller-manager instead of autoneg-system:default. README.md and deploy/workload-identity.sh reflect that change.

Terraform updates have not yet been made - do not merge until this is complete.

@soellman soellman requested a review from rosmo August 26, 2021 13:39
@soellman
Copy link
Contributor Author

Fixes #35

@soellman
Copy link
Contributor Author

Fixes #22

@soellman soellman changed the title WIP: Upgrade project to kubebuilder v3 Upgrade project to kubebuilder v3 Aug 26, 2021
@soellman
Copy link
Contributor Author

Ready for review @rosmo (especially the TF pieces)

@@ -251,24 +299,44 @@ resource "kubernetes_deployment" "deployment_autoneg_controller_manager" {

spec {
service_account_name = kubernetes_service_account.service_account.metadata[0].name
automount_service_account_token = true
Copy link

Choose a reason for hiding this comment

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

Was this removed because terraform now defaults the value to true?

While technically not required, it does seem nice to explicitly assert that the service account token is used by this workload. Terraform has already changed this default once (from false which is more secure to true which matches the kubernetes default) and kubernetes wants to change the default to false since it's more secure but hasn't done so because it would be a breaking change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed this to match the kubebuilder autogenerated manifests more closely. That said, I'm happy to consider particular cases.

For posterity, I'll sat that these changes were made by hand, and any exceptions we have here could conceivably get overwritten if/when we'd have some automated tooling to do the conversion.

That said, I'll defer to you - would you like to see an explicit statement here affirming the default of true for automount_service_account_token ?

Copy link

@rwkarg rwkarg Sep 13, 2021

Choose a reason for hiding this comment

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

The default in the terraform kubernetes provider was changed in 2.0.0:
https://github.com/hashicorp/terraform-provider-kubernetes/releases/tag/v2.0.0

This either needs to require >= 2.0.0 (doesn't look like it sets a min version?) or explicitly set the value to true to support earlier versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've readded this explicit declaration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rwkarg PTAL and resolve if you're satisfied

@soellman
Copy link
Contributor Author

I've rebased and addressed @rwkarg's concern around the automount_service_account_token variable in the terraform resource. @rosmo please review

@rosmo
Copy link
Collaborator

rosmo commented May 27, 2022

@soellman Could you rebase? Thank you :)

@rosmo
Copy link
Collaborator

rosmo commented Mar 14, 2023

@soellman Would you mind signing the CLA again with your current email and letting me know what that is so I can amend the commits to include your new email address.

@rosmo
Copy link
Collaborator

rosmo commented Mar 14, 2023

Fixes #75

Add full Terraform testing example (not E2E yet though) to validate Autoneg setup easier.
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.

None yet

3 participants