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

service_principal in aks no longer required #6205

Closed
wants to merge 1 commit into from

Conversation

torresdal
Copy link
Contributor

Fixes #6178. service_principal is no longer required, as Managed Identity is now GA: https://github.com/Azure/AKS/releases/tag/2020-03-16

Been a while since I've contributed here, so probably other files that needs to be updated?

Looks like version 2019-11-01/containerservice (which is the current in terraform) already support managed identities, but there are newer API versions available which I have not studied in detail.

Ref hashicorp#6178 service_principal is no longer required as Managed Identity is now GA: https://github.com/Azure/AKS/releases/tag/2020-03-16
@ghost ghost added the size/XS label Mar 20, 2020
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Hi @torresdal,

thanks for the PR, all it is missing is a test without the SP to confirm it works (and doesn't stop working in the future) and the docs to be updated.

@ghost
Copy link

ghost commented Mar 21, 2020

According to the docs, when an AKS cluster is created with managed identity, the service_principal should be set like this:

  service_principal {
    client_id     = "msi"
    client_secret = null
  }

Therefore, client_secret may also need to be made optional when client_id=msi.

@anlutro
Copy link

anlutro commented Mar 25, 2020

The way I read the Azure docs, you shouldn't set the client ID/secret to that, it's just what Azure will set it to for you. If the whole service_principal block becomes optional I don't see why client_secret needs to be set to be optional.

@ghost ghost removed the waiting-response label Mar 25, 2020
@tombuildsstuff tombuildsstuff self-assigned this Mar 27, 2020
@elsesiy
Copy link

elsesiy commented Apr 2, 2020

@anlutro That's how I read the docs too. It says
A successful cluster creation using managed identities contains this service principal profile information which nowhere indicates the user should provide these values. What's the ETA change and how will this work for clusters that have been provisioned in the transitional period with a SP and MI?

@tombuildsstuff
Copy link
Contributor

hey @torresdal

Thanks for this PR - apologies for the delayed review here, we've been trying to determine the intended behaviour of the AKS API to work out how to move forward here - since the API's changed behaviour several times during the past couple of weeks.

Prior to the recent changes in the Azure API there were 2 different use-cases for the AKS resource:

  1. Creating an AKS Cluster using a Service Principal for Cluster Authentication
  2. Creating an AKS Cluster using a Service Principal for Cluster Authentication with a Managed Identity attached

However the GA of the Managed Identity functionality introduced the third use-case was introduced:

  1. Creating an AKS Cluster using a Managed Identity for Authentication

After spending some time digging into this, it appeared this (after chatting with the AKS Team, by design) broke use-case 2 here (creating a Cluster with a Service Principal & a Managed Identity attached), however it appeared that we could conditionally use the older API version to support use-case 2, meaning we'd support all 3 use-cases here.

Unfortunately after finishing up support for that (and confirming it works) the older API (2019-10-01) has been updated such that use-case 2 is no longer possible; as such unfortunately we're going to need to make some larger changes to the AKS resource.

Since AKS is a highly used and fast moving resource, there's currently several PR's open which change the functionality of this resource. In order to be able to make the larger changes needed for this issue - and consulate the other PR's which are open, I hope you don't mind but I'm going to close this PR in favour of #6095, which includes support for creating an AKS Cluster without a Service Principal, and the other changes mentioned above.

As such whilst I'd like to thank you for this contribution, I hope you don't mind but I'm going to close this PR in favour of #6095, which incorporates these changes and will ship in v2.5 of the Azure Provider.

Thanks!

@ghost
Copy link

ghost commented May 6, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators May 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AKS Managed Identity configuration can't be used without service_principal block
5 participants