MicrosoftDocs / azure-aks-docs

Public sync with private repo azure-aks-docs-pr
Creative Commons Attribution 4.0 International
3 stars 60 forks source link

GMSASpec is Poorly documented #44

Open kaushalendra-kumar opened 2 months ago

kaushalendra-kumar commented 2 months ago

In the section "Install GMSA cred spec", the placeholder values/comments for the actual GMSACredentialSpec are poorly documented. We tried to implement this and our container got in to ContianerCreating state.

Consider:

apiVersion: windows.k8s.io/v1
kind: GMSACredentialSpec
metadata:
  name: aks-gmsa-spec  # This name can be changed, but it will be used as a reference in the pod spec
credspec:
  ActiveDirectoryConfig:
    GroupManagedServiceAccounts:
    - Name: $GMSA_ACCOUNT_USERNAME
      Scope: $NETBIOS_DOMAIN_NAME
    - Name: $GMSA_ACCOUNT_USERNAME
      Scope: $DNS_DOMAIN_NAME
    HostAccountConfig:
      PluginGUID: '{CCC2A336-D7F3-4818-A213-272B7924213E}'
      PortableCcgVersion: "1"
      PluginInput: "ObjectId=$MANAGED_ID;SecretUri=$SECRET_URI"  # SECRET_URI takes the form https://$akvName.vault.azure.net/secrets/$akvSecretName
  CmsPlugins:
 - ActiveDirectory
  DomainJoinConfig:
    DnsName: $DNS_DOMAIN_NAME
    DnsTreeName: $DNS_ROOT_DOMAIN_NAME
    Guid:  $AD_DOMAIN_OBJECT_GUID
    MachineAccountName: $GMSA_ACCOUNT_USERNAME
    NetBiosName: $NETBIOS_DOMAIN_NAME
    Sid: $GMSA_SID

In particular the following needs to be more clear:

Having a completed example without the placeholders would be a big benefit, such as:

apiVersion: windows.k8s.io/v1
kind: GMSACredentialSpec
metadata:
  name: aks-gmsa-spec  # This name can be changed, but it will be used as a reference in the pod spec
credspec:
  ActiveDirectoryConfig:
    GroupManagedServiceAccounts:
    - Name: gmsa
      Scope: contoso
    - Name: gmsa
      Scope: contoso.com
    HostAccountConfig:
      PluginGUID: '{CCC2A336-D7F3-4818-A213-272B7924213E}'
      PortableCcgVersion: "1"
      PluginInput: "ObjectId=00000000-0000-0000-0000-000000000000;SecretUri=https://{keyvaultname}.vault.azure.net/secrets/{secretname}"  # SECRET_URI takes the form https://$akvName.vault.azure.net/secrets/$akvSecretName
  CmsPlugins:
  - ActiveDirectory
  DomainJoinConfig:
    DnsName: contoso.com
    DnsTreeName: contoso.com
    Guid: 00000000-0000-0000-0000-000000000000
    MachineAccountName: gmsa
    NetBiosName: contoso
    Sid: S-1-5-21-0000059250-1095680357-2181600000 # this is the SID of the domain not SID of GSMA Account