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

Create a Service Principal for Azure clusters #864

Merged

Conversation

sgibson91
Copy link
Member

@sgibson91 sgibson91 commented Dec 1, 2021

This PR updates our Azure Terraform config to create a service principal and secret and output these so we can use the info to login in a similar way to how GCP uses Service Accounts, and hence replacing the raw kubeconfig auth method.

This is the first piece for both #840 and #841

Copy link
Member

@yuvipanda yuvipanda left a comment

Choose a reason for hiding this comment

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

\o/ This is super awesome.

Our UToronto access doesn't let us create service principals. While we should eventually get that fixed, I don't want the migration to block on that. So we should try make these temporarily conditional.

@sgibson91
Copy link
Member Author

Good to know, cheers!

@sgibson91
Copy link
Member Author

sgibson91 commented Dec 1, 2021

Ok @yuvipanda I have now made it optional to create service principals

Copy link
Member

@yuvipanda yuvipanda left a comment

Choose a reason for hiding this comment

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

LGTM!

@sgibson91
Copy link
Member Author

Hmmmm, seems like I still don't have enough privileges - @jhamman?

Error: Could not list existing service principals

with azuread_service_principal.service_principal[0],
on service-principal.tf line 1, in resource "azuread_service_principal" "service_principal":
1: resource "azuread_service_principal" "service_principal" {

ServicePrincipalsClient.BaseClient.Get(): unexpected status 403 with OData error: Authorization_RequestDenied: Insufficient privileges to complete the
operation.

@sgibson91
Copy link
Member Author

sgibson91 commented Dec 2, 2021

Ok, I'm going to rescope this PR to not apply the change to carbonplan and then merge it. We can figure out the permissions to create a service principal for carbonplan later.

@sgibson91 sgibson91 merged commit c66a05c into 2i2c-org:master Dec 2, 2021
@sgibson91 sgibson91 deleted the terraform-azure/create-service-principal branch December 2, 2021 09:56
@jhamman
Copy link

jhamman commented Dec 2, 2021

Thanks @sgibson91 for working on this. Happy to adjust permissions as needed on our side. Confirming that right now, you do have the Owner role in the subscription being used for our deployment.

@sgibson91
Copy link
Member Author

Thanks @jhamman. Knowing Azure, I am 100% confident that it's something far more complicated and annoying :) I will update the main issue tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants