AKS icon indicating copy to clipboard operation
AKS copied to clipboard

Bring-your-own OMS Agent identity

Open Harshith-Bhaskar opened this issue 5 years ago • 8 comments

What happened: When using the OMSagent add-on, AKS creates a user-assigned MI in the generated resource group. This makes it harder to assign the required permissions as this identity requires Monitoring Metrics Publisher role to send AKS metrics to Azure Monitor.

What you expected to happen: BYO managed identity for OMSagent2, so that we can have an identity created with necessary roles attached and can be used while creating AKS cluster

Harshith-Bhaskar avatar Oct 18 '21 05:10 Harshith-Bhaskar

Hi Harshith-Bhaskar, AKS bot here :wave: Thank you for posting on the AKS Repo, I'll do my best to get a kind human from the AKS team to assist you.

I might be just a bot, but I'm told my suggestions are normally quite good, as such:

  1. If this case is urgent, please open a Support Request so that our 24/7 support team may help you faster.
  2. Please abide by the AKS repo Guidelines and Code of Conduct.
  3. If you're having an issue, could it be described on the AKS Troubleshooting guides or AKS Diagnostics?
  4. Make sure your subscribed to the AKS Release Notes to keep up to date with all that's new on AKS.
  5. Make sure there isn't a duplicate of this issue already reported. If there is, feel free to close this one and '+1' the existing issue.
  6. If you have a question, do take a look at our AKS FAQ. We place the most common ones there!

ghost avatar Oct 18 '21 05:10 ghost

The Container Insights team is working on an MSI private preview feature, where you can BYO identity to your cluster. Please reach out to us at [email protected], if you would like to onboard to it.

austonli avatar Oct 22 '21 16:10 austonli

Triage required from @Azure/aks-pm

ghost avatar Nov 03 '21 06:11 ghost

Action required from @Azure/aks-pm

ghost avatar Nov 08 '21 16:11 ghost

Triage required from @Azure/aks-pm @austonli

ghost avatar Nov 11 '21 00:11 ghost

@vishiy, @saaror would you be able to assist?

Issue Details

What happened: When using the OMSagent add-on, AKS creates a user-assigned MI in the generated resource group. This makes it harder to assign the required permissions as this identity requires Monitoring Metrics Publisher role to send AKS metrics to Azure Monitor.

What you expected to happen: BYO managed identity for OMSagent2, so that we can have an identity created with necessary roles attached and can be used while creating AKS cluster

Author: Harshith-Bhaskar
Assignees: austonli
Labels:

azure/oms, feature-request, addon/container-insights

Milestone: -

ghost avatar Nov 11 '21 01:11 ghost

@Harshith-Bhaskar you can automate OMS agent role assignment with the following code. Put it after AKS resource definition in the same Bicep module, if you are using Bicep.

resource omsAgentRoleAssignment 'Microsoft.Authorization/roleAssignments@2020-10-01-preview' = {
  name: guid(resourceGroup().name, 'omAgentMsi', roleDefinitionId)
  scope: aks
  properties: {
    principalType: 'ServicePrincipal'
    principalId: aks.properties.addonProfiles.omsagent.identity.objectId
    roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionId)
  }
}

Where aks is a symbolic name of AKS cluster resource definition, roleDefinitionId is a role definition GUID, e.g. Monitoring Metrics Publisher role's GUID, which is 3913510d-42f4-4e42-8a64-420c390055eb. You might need to adjust the role assignment name/GUID generation params so it'd be unique in your particular case.

rootik avatar May 09 '22 13:05 rootik

Hi @Harshith-Bhaskar, this feature is now available in public preview https://azure.microsoft.com/en-us/updates/public-preview-use-managed-identitybased-authentication-to-enable-azure-monitor-container-insights/

vdiec avatar Sep 06 '22 18:09 vdiec